akhauriyash/Code-Regression huggingface dataset:
<?php
//error_reporting(0);
//$X = explode(" ",trim(fgets(STDIN)));
$X = trim(fgets(STDIN));
$A = trim(fgets(STDIN));
$B = trim(fgets(STDIN));
//list($r,$c) =  explode(" ",trim(fgets(STDIN)));
$l = $X - $A;
printf("%d\n",$l%$B);


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

#define ld			long double
#define int         long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define MOD         1000000007
#define sd(t) 		scanf("%d",&(t))
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define hii 		cout << "hii" << endl
#define okay 		cout << "okay" << endl
#define hey 		cout << "hey" << endl

template <class T> ostream& operator << (ostream &os, const vector<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const pair<T, S> &v) { os << v.first << ' ' << v.second; return os; }
template <class T, class S> ostream& operator << (ostream &os, const unordered_map<T, S> &v) { for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' '; return os; } 
 
 
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <class Arg1> void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 << endl; }
    template <class Arg1, class... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args) {
        const char* sep = strchr(names + 1, ',');
        cerr.write(names, sep - names) << " : " << arg1 << "  ";
        __f(sep + 1, args...);
    }
#else
#define trace(...) 
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#endif // ifndef ONLINE_JUDGE

void fast()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
   
}

clock_t time_p=clock();
void starboy1299()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}

const int N = 2e5+5;
int vis[N] = {0};
vector<int> adj[N];
int dp[N] = {0};

void dfs(int src){

	vis[src] = 1;
	for(auto it: adj[src]){
		if(!vis[it]){
			dfs(it);
		}
		// cout << src << " " << it << endl;
		// hey;
		dp[src] = max(dp[src], 1+dp[it]);
	}

	// cout << src << endl;
	// okay;

}

void solve()
{
	int n, m;
	cin >> n >> m;

	rep(i, 0, m){

		int a, b;
		cin >> a >> b;
		adj[a].pb(b);
	}

	for(int i=1; i<=n; i++){
		if(!vis[i]){
			dfs(i);
		}
	}

	cout << *max_element(dp+1, dp+n+1) << endl;
}			 	

int32_t main(){
	fast();
    int t = 1;
    // cin>> t;
    while(t--){
    	solve();
    }
	starboy1299();
}




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

using namespace std;

#define MAX_H 20
#define MAX_W 20
#define MAX_N 5
#define MAX_S 40
#define INF 1e9

struct P{
    int x,y;
    P(){}
    P(int x,int y) : x(x),y(y) {}
};

struct State{
    int x,y,S,t;
    State(int x,int y,int S,int t) : x(x),y(y),S(S),t(t) {}
};

int H,W,N,L[MAX_N],b;
bool can[MAX_H][MAX_W];
bool dp[MAX_H][MAX_W][1<<MAX_N][MAX_S];
vector<P> path[MAX_N];
const int dx[9] = {-1,-1,-1,0,0,0,1,1,1};
const int dy[9] = {-1,0,1,-1,0,1,-1,0,1};

bool inField(int x,int y){
    return (0 <= x && x < W && 0 <= y && y < H);
}

int bfs(int sx,int sy){
    if(b == (1<<N)-1) return 0;
    queue<State> Q; Q.push(State(sx,sy,b,0));
    memset(dp,false,sizeof(dp));
    dp[sy][sx][b][0] = true;
    while(!Q.empty()){
        State s = Q.front(); Q.pop();
        int x = s.x,y = s.y,S = s.S;
        int t = s.t+1;
        bool ok = true;
        for(int i = 0 ; i < N ; i++){
            if(!(S >> i & 1) && L[i] <= s.t){
                ok = false;
                break;
            }
        }
        if(!ok) continue;
        if(S == (1<<N)-1) continue;
        for(int i = 0 ; i < 9 ; i++){
            int nx = x + dx[i];
            int ny = y + dy[i];
            if(!inField(nx,ny)) continue;
            if(!can[ny][nx]) continue;
            int nS = S;
            for(int j = 0 ; j < N ; j++){
                if(L[j] <= t) continue;
                P p = path[j][t];
                if(p.x == nx && p.y == ny){
                    nS |= 1<<j;
                }
            }
            if(!dp[ny][nx][nS][t]){
                dp[ny][nx][nS][t] = true;
                Q.push(State(nx,ny,nS,t));
            }
        }
    }
    int res = INF;
    for(int i = 0 ; i < H ; i++){
        for(int j = 0 ; j < W ; j++){
            for(int k = 1 ; k < H+W ; k++){
                if(dp[i][j][(1<<N)-1][k]){
                    res = min(res,k);
                }
            }
        }
    }
    return (res == INF ? -1 : res);
}

int main(){
 int sx,sy,x,y;
    cin >> W >> H >> N >> sx >> sy; sx--; sy--;
    fill(can[0],can[0]+MAX_H*MAX_W,1); b = 0;
    for(int i = 0 ; i < N ; i++){
        cin >> L[i]; path[i].resize(L[i]);
        for(int j = 0 ; j < L[i] ; j++){
            cin >> x >> y; x--; y--;
            path[i][j] = P(x,y);
            if(j == L[i]-1) can[y][x] = 0;
            if(j == 0 && x == sx && y == sy){
                b |= 1<<i;
            }
        }
    }
    cout << bfs(sx,sy) << endl;
    return 0;
}

Measured memory_bytes: 1856
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int h, a, b; cin >> h >> a >> b;
    int ans = 0;
    for(int i = a; i <= b; i++)
    {
        if(h % i == 0) ans++;
    }
    cout << ans << endl;
    return 0;
}




Measured memory_bytes: 3236
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
A_Counter = Counter(A)
A_Counter = sorted(A_Counter.items(), key=lambda x:x[0],reverse=True)



anslis = []
count = 0 
for single in A_Counter:

    key = int(single[0])
    value = int(single[1])
    
    if value >= 4:
        if count == 0:
            anslis.append(int(key))
            break
        else:
            anslis.append(int(key))
            count += 1
    
    if 2 <= value <= 3:
        anslis.append(int(key))
        count += 1
    
    if count == 2:
        break

if len(anslis) == 0:
    print(0)
elif len(anslis) == 1:
    print(anslis[0]**2)
else:
    print(anslis[0]*anslis[1])
    
    
    




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

int main() {
  int N, D1, D2, cnt=0, max=-1; cin >> N;
  for(int i = 0; i < N; i++) {
    cin >> D1 >> D2;
    if(D1 == D2) {
      cnt++;
    } else {
      cnt = 0;
    }
    if(max <= cnt) max = cnt;
  }

  if(max >= 3) cout << "Yes" << endl;
  else cout << "No" << endl;
}

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

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using pll = pair<ll,ll>;

#define INF (1LL << 60)
#define MOD 1000000007
#define PI 3.14159265358979323846

#define REP(i,m,n) for(ll (i)=(m),(i_len)=(n);(i)<(i_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define PR(x) cout << (x) << endl
#define PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define REV(x) reverse(ALL((x)))
#define ASC(x) sort(ALL((x)))
#define DESC(x) ASC((x)); REV((x))
#define pb push_back
#define eb emplace_back

int main()
{
    ll N, M;
    cin >> N >> M;
    mat G(N);
    REP(i,0,M) {
        ll a, b;
        cin >> a >> b;
        --a; --b;
        G[a].pb(b);
        G[b].pb(a);
    }

    queue<ll> Q;
    vec D(N, INF);
    Q.push(0);
    D[0] = 0;
    while(!Q.empty()) {
        ll v = Q.front(); Q.pop();
        FORR(nv,G[v]) {
            if(D[nv] > D[v] + 1) {
                D[nv] = D[v] + 1;
                Q.push(nv);
            }
        }
    }

    if(D[N-1] <= 2) PR("POSSIBLE");
    else PR("IMPOSSIBLE");



    return 0;
}

/*



*/

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

int main() {
  int n,m,c,ans=0;
  cin>>n>>m>>c;
  vector<int> t(m);
  rep(i,0,m){cin>>t[i];}
  //rep(i,0,m){cout<<t[i]<<endl;}

  rep(i,0,n){
    vector<int> a(m);
    int tot=0;
    rep(j,0,m){cin>>a[j];}
    rep(j,0,m){tot+=a[j]*t[j];}
    if(tot+c>0){ans++;}
  }

  cout<<ans<<endl;
  
  return 0;
}

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

int w[200005],h[200005];

int main(){
  int n;
  scanf("%d",&n);
  for(int i=1;i<=n;i++){
    scanf("%d%d",&w[i],&h[i]);
  }
  int maxadd=INT_MIN,minadd=INT_MAX,maxsub=INT_MIN,minsub=INT_MAX;
  for(int i=1;i<=n;i++){
    maxadd=max(maxadd,w[i]+h[i]);
    minadd=min(minadd,w[i]+h[i]);
    maxsub=max(maxsub,w[i]-h[i]);
    minsub=min(minsub,w[i]-h[i]);
  }
  int ans=max(maxadd-minadd,maxsub-minsub);
  printf("%d\n",ans);
  return 0;
}

Measured memory_bytes: 5360
#exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']

def inpf() a=gets.chomp.split(" ").map(&:to_f)end

def inps() a=gets.chomp.split(" ")end

def copy(a) Marshal.load(Marshal.dump(a)) end

def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end

def na(n,d=0) Array.new(n,d)end

def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end

def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end

def inp() a=gets.chomp.split(" ").map(&:to_i)end

def r_up(a, b) (a+b-1)/b end

def sum(a) a.inject(:+) end

def big(a,b) return (a>b)? a:b end
a,b,c,k  = inp
ans = 0
if(k > a)
  ans += a
  k -= a
else
  puts k
  exit
end
k -= b
if(k > 0)
  puts a-k
else
  puts a
end


Measured memory_bytes: 14352
// https://atcoder.jp/contests/dp/tasks/dp_t

#include <bits/stdc++.h>

using namespace std;

#define REP(i,n)   for(int i=0; i<(int)(n); i++)
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); i++)
#define DUMP(a, n) REP(i, n) printf("%d%c", a[i], i + 1 == n ? '\n' : ' ')
#define DUMP2D(a, n, m) REP(i, n) REP(j, m) printf("%d%c", a[i][j], j + 1 == m ? '\n' : ' '); puts("")

const int N_MAX = 3000;
const int MOD = 1e9+7;

int N;
char s[N_MAX];

int dp0[N_MAX];
int dp1[N_MAX];
int acc[N_MAX + 1];

void solve() {
  auto cur = dp0;
  auto nxt = dp1;
  fill(cur, cur + N, 1);
  REP(k, N - 1) {
    int l = N - 1 - k;
    FOR(i, 0, l) acc[i + 1] = (acc[i] + cur[i]) % MOD;
    fill(nxt, nxt + N, 0);
    REP(i, l) {
      if (s[k] == '<') {
        nxt[i] = (MOD + acc[i + 1] - acc[0]) % MOD;
      } else {
        nxt[i] = (MOD + acc[l + 1] - acc[i + 1]) % MOD;
      }
    }
    swap(cur, nxt);
  }
  printf("%d\n", cur[0]);
}

void input() {
  scanf("%d", &N);
  scanf("%s", s);
}

int main() {
  input();
  solve();
  return 0;
}


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

int main(){
    int n; cin >> n;
    vector<int> a(n);
    rep(i , n) cin >> a[i];
    int q; cin >> q;
    rep(i , q){
        int b , e , t;
        cin >> b >> e >> t;
        rep(j , e - b){
            swap( a[b + j] , a[t + j]);
        }
    }
    rep(j , n - 1) cout << a[j] << " ";
    cout << a[n - 1] << endl;
}


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

//long long
using ll = long long;

// pair<int, int>
using PII = pair<int, int>;

//最大値、mod
const int MOD = 1000000007;
const int INF = 1000000000;
const long long LINF = 1e18;

//出力系
#define print(x) cout << x << endl
#define prints(x) cout << fixed << setprecision(10) << x << endl
#define printc(x) cout << setw(2) << setfill('0') << x << endl;
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()

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

//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

// 最小公倍数
unsigned lcm(unsigned a, unsigned b){
    return a / gcd(a, b) * b; 
}

// a = max(a, b), a = min(a, b)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

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





int cnt;
int H, W, N;
char c[1010][1010];
int sx[10];
int sy[10];
ll ans = 0;
int d[1010][1010];

int bfs(int y, int x){
  queue<PII>que;
  REP(i, H)REP(j, W) d[i][j] = INF;
  d[y][x] = 0;
  que.push(PII(y, x));
  while(!que.empty()){
    PII p = que.front(); que.pop();
    if(p.first == sy[cnt] && p.second == sx[cnt]) break;
    REP(i, 4){
      int ny = p.first + dy[i]; int nx = p.second + dx[i];
      if(nx >= 0 && nx < W && ny >= 0 && ny < H && c[ny][nx] != 'X' && d[ny][nx] == INF){
        que.push(PII(ny, nx));
        d[ny][nx] = d[p.second][p.first] + 1;
      }
    }
  }
  return d[sy[cnt]][sx[cnt]];
}


int main(){
  bool d[10][10] = {false};
  int N, M;
  cin >> N >> M;
  REP(i, M){
    int a, b;
    cin >> a >> b;
    --a; --b;
    d[a][b] = true;
    d[b][a] = true;
  }
  vector<int>retu(N);
   REP(i, N) retu[i] = i;
  int ans = 0;
  do{
    if(retu[0] != 0) break;
    bool flag = true;
    REP(i, N - 1){
      int x = retu[i];
      int y = retu[i + 1];
      if(!d[x][y]) flag = false;
    }
    if(flag) ans++;
  }while(next_permutation(all(retu)));
print(ans);
}


Measured memory_bytes: 256
import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int a = sc.nextInt();
    if(x < a){
      System.out.println("0");
    }else{
      System.out.println("10");
    }
  }
}

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

using namespace std;
using ll = long long;
using ld = long double;

const int MOD = 1000000007;

vector<ll> inv,finv;
void COMinit(ll siz) {
    ll buf=5;
    inv.resize(siz+buf);
    finv.resize(siz+buf);

    finv[0]=finv[1]=1;
    inv[1]=1;

    for (int i = 2; i < siz+buf; i++){
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
ll COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    ll ans=1;
    for(ll i = n; i >= n-k+1; i--) {
        ans*=i;
        ans%=MOD;
    }
    ans*=finv[k];
    return ans%MOD;
}

ll modpow(ll a, ll n, ll mod){
    ll res=1;
    while(n>0){
        if(n&1) res=res*a%mod;
        a=a*a%mod;
        n>>=1;
    }
    return res;
}

//#define int long long
//signed main(){
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,a,b;
    cin >> n >> a >> b;

    COMinit(max(a,b));
    ll ans=modpow(2,n,MOD)-1;
    ans-=COM(n,a);
    if(ans<0) ans+=MOD;
    ans-=COM(n,b);
    if(ans<0) ans+=MOD;

    cout << ans << "\n";

    return 0;
}

Measured memory_bytes: 3328
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from math import floor

def main():
  a, b = map(int, input().strip().split())
  for x in range(10**4+1):
    if floor(x * 0.08) == a and floor(x * 0.10) == b:
      print(x)
      return
  print(-1)

if __name__=='__main__':
  main()



Measured memory_bytes: 2940
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>

using namespace std;

int main(){
	int a,b;
	char s[20];
	scanf("%d %d",&a,&b);
	scanf("%s",s);
	for(int i=0;i<a+b+1;i++){
		if(i==a && s[i] != '-'){
			printf("No\n");
			return 0;
		}else if( i!=a && ('0'>s[i] || s[i]>'9')){
			printf("No\n");
			return 0;
		}
	}
	printf("Yes\n");
	return 0;
}


Measured memory_bytes: 128
n = int(input())
c = {"M": 0, "A": 0, "R": 0, "C": 0, "H": 0}
march = "MARCH"

for i in range(0, n):
    s = input()[0]
    if s == "M" or s == "A" or s == "R" or s == "C" or s == "H":
        c[s] += 1

s = 0
for i in range(0, 5):
    for j in range(i + 1, 5):
        for k in range(j + 1, 5):
            s += c[march[i]] * c[march[j]] * c[march[k]]

print(s)

Measured memory_bytes: 3064
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <functional>
#include <queue>
#define FOR(x, z, y) for(int x = (z); y; x++)
#define rep(x, y) for(int x = 0; x < (y); x++)
#define all(x) x.begin(), x.end()
#define len(x) (sizeof(x) / sizeof(x[0]))
#define split_str(str, sp_word) istringstream stream(str); string res; FOR(cnt, 0, getline(stream,res,sp_word))
#define scanln(x) fgets(x, sizeof x, stdin)
#define down_queue(x) priority_queue<x>
#define up_queue(x) priority_queue<x, vector<x>, greater<x>>
#define i_str(x) atoi(x.c_str())
typedef long long ll;
using namespace std;

int main(){
  int A,B,C;
  scanf("%d%d%d",&A,&B,&C);

  FOR(i,1,i <= B){
    if((A * i) % B == C){
      puts("YES");
      return 0;
    }
  }

  puts("NO");
  return 0;
}

Measured memory_bytes: 256
primes=[]
def getprime():
    for i in range(2,10000):
        ok=True
        for p in primes:
            if i%p==0:
                ok=False
        if ok:
            primes.append(i)

def check(n):
    for p in primes:
        if n<=p:
            return True
        if n%p==0:
            return False
    return True

getprime()
n=int(input())
ns=[]
ans=0
for i in range(n):
    a=int(input())
    if check(a):
        ans+=1
print(ans)

    

Measured memory_bytes: 7684
#include <iostream>

int main() {
 
  int x, y;
  std::cin >> x >> y;
  
  if(y == 0) std::cout << x << std::endl;
  else {
    int p[y];
    for(int i=0; i<y; i++) std::cin >> p[i];
    
    int found = 0;
    int neighbor;
    int distance = 0;
    while(found == 0){
      int a, b, a_found, b_found;
      a = x + distance;
      b = x - distance;
      a_found = 0;
      b_found = 0;
      
      for(int i=0; i<y; i++){
        if(a == b) {
          if(p[i] == b){ 
            a_found = 1;
            b_found = 1;
          }
        }else {
          if(p[i] == b) b_found = 1;
          else if(p[i] == a) a_found = 1;
        }
      }
      
      if(b_found != 1) {
        neighbor = b;
        found = 1;
      }else if(a_found != 1) {
        neighbor = a;
        found =1;
      }
        
      distance  += 1;
    }
    std::cout << neighbor << std::endl;
  }
  
  return 0;
}

Measured memory_bytes: 3556
H, W, M = map(int, input().split())

H_bomb = [0 for i in range(H)]
W_bomb = [0 for i in range(W)]
bomb_list = []

for i in range(M):
    M_temp = tuple(map(int, input().split()))
    H_bomb[M_temp[0]-1] += 1
    W_bomb[M_temp[1]-1] += 1
    bomb_list.append(M_temp)

#print(bom_map)
H_bomb_max = max(H_bomb)
W_bomb_max = max(W_bomb)
H_bomb_line = []
W_bomb_line = []

for i in range(H):
    if H_bomb[i] == H_bomb_max:
        H_bomb_line.append(i)
for i in range(W):
    if W_bomb[i] == W_bomb_max:
        W_bomb_line.append(i)

bomb_set = set(bomb_list)
for i in H_bomb_line:
    for j in W_bomb_line:
        if (i+1, j+1) not in bomb_set:
            print(H_bomb_max + W_bomb_max)
            exit()
print(H_bomb_max + W_bomb_max - 1)


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

struct Data {
    int x{};
    string y;
};

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

    vector<Data> submit;

    for (int i = 0; i < 1; i++) {
        for (int j = 0; j < m; j++) {
            Data data;
            cin >> data.x;
            cin >> data.y;
            submit.push_back(data);
        }
    }

    vector<bool> ex_flg;
    ex_flg.reserve(n);
for (int k = 0; k < n; k++) {
        ex_flg.push_back(false);
    }

    vector<int> ac_cnt;
    ac_cnt.reserve(n);
    for (int l = 0; l < n; l++) {
        ac_cnt.push_back(0);
    }

    vector<int> wa_cnt;
    wa_cnt.reserve(n);
for (int l = 0; l < n; l++) {
        wa_cnt.push_back(0);
    }

    long int ac_total = 0;
    long int wa_total = 0;

    for (const auto& e: submit) {
        if (e.y == "WA") {
            if (!ex_flg.at(e.x-1)) {
                wa_cnt.at(e.x-1) += 1;
            }
        }
        else if (e.y == "AC") {
            if (!ex_flg.at(e.x-1)) {
//            ey_cnt.at(e.x-1) += 1;
                ex_flg.at(e.x - 1) = true;
                wa_total += wa_cnt.at(e.x - 1);
                ac_total += 1;
            }
        }
    }

    cout << ac_total << " " << wa_total;

    return 0;
}


Measured memory_bytes: 7280
#include<iostream>
using namespace std;
int a[100];
int n;
bool flag;
int main(){
	cin >> n;
	int k = 1;
	for(int i = 1; i <= 9; i++){
		for(int j = 1; j <= 9; j++){
			a[k] = i * j;
			k++;
		}
	}
	for(int i = 1; i <= 81; i++){
		if(n == a[i])
			flag = 1;
	}
	if(flag == 1) cout << "Yes" << endl;
	else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<math.h>
using namespace std;
int main(){
	double r,s,c;
	scanf("%lf",&r);
        s = r*r*M_PI;
        c = r*2*M_PI;
	printf("%lf %lf\n",r*r*M_PI,r*2*M_PI);
	return 0;
}

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

using namespace std;
const int maxn = 2e5+2;
const int mod = 1e9+7;
const int inf = 1e9;

typedef long long ll;

int n, k;
int arr[maxn], dp[maxn];

int solve_dp (int pos){
    if (pos > n) return inf;
    if (pos == n - 1) return 0;

    if (dp[pos] != -1) return dp[pos];

    int ans = inf;
    for (int i = 1; i <= k; i++){
        ans = min(ans, solve_dp(pos + i) + abs(arr[pos + i] - arr[pos]));
    }

    return dp[pos] = ans;
}

int main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    cin >> n >> k;

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

    memset(dp, -1, sizeof dp);

    cout << solve_dp(0) << "\n";

    return 0;
}


Measured memory_bytes: 6144
#include <bits/stdc++.h>
 
#define int long long
 
// loop
#define FOR(i, a, b) for (int i = (a); i < (b); i++) 	// a ~ b-1	(ascending)
#define REP(i, n) FOR(i, 0, n)							// 0 ~ n-1
#define NREP(i, n) FOR(i, 1, n + 1)						// 1 ~ n
#define RFOR(i, a, b) for (int i = (a); i >= (b); i--)	// a ~ b	(descending)
#define RREP(i, n) RFOR(i, n, 0)						// n ~ 0
#define RNREP(i, n) RFOR(i, n, 1)						// n ~ 1
 
// container operation
#define EACH(i, c) for (auto i = (c).begin(); i != (c).end(); i++)
#define ASORT(c) std::sort((c).begin(), (c).end())
#define DSORT(c) std::sort((c).begin(), (c).end(), std::greater<typeof((c).front())>())
#define SIZE(x) ((int)(x).size())
 
// debug
#define check(x) std::cout << #x << " = " << x << '\n'
 
// print
#define cout(x) std::cout << x << '\n'
 
// typedef
typedef std::vector<int> VI;
typedef std::vector<VI> VII;
typedef std::vector<bool> VB;
typedef std::vector<std::string> VS;

std::string yes = "Yes\n";
std::string no = "No\n";

void solve();

signed main() {
  solve();
  return 0;
}

void solve() {
  int x, a;
  std::cin >> x >> a;
  if (x < a) {
    cout(0);
  } else {
    cout(10);
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define print(x)cout<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

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

map<ll, int > prime_factor(ll n) {
  map< ll, int > ret;
  for(ll i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}

int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i,n) cin >>a[i];
  map<ll, int > mp;
  rep(i,n){
    auto m =  prime_factor(a[i]);
    for(auto it :m){
      mp[it.fi] = max(mp[it.fi],it.se);
    }
  }
  mint c = 1;
  for(auto it : mp){
    c*=pow(it.fi,it.se);
  }
  mint ans = 0;
  rep(i,n){
    ans+=c/a[i];
  }
  print(ans.x);
  return 0;
}

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

using ll = long long;
const ll mod = 998244353;

const int maxn = 3030;
ll dp[maxn][maxn][3];

int a[maxn];

int main() {
    int n, k;
    cin >> n >> k;
    for (int i = 0; i < n; ++i) cin >> a[i];
    dp[0][0][0] = 1;
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j <= k; ++j) {
            (dp[i + 1][j][0] += dp[i][j][0]) %= mod;
            (dp[i + 1][j][1] += dp[i][j][0] + dp[i][j][1]) %= mod;
            (dp[i + 1][j][2] += dp[i][j][0] + dp[i][j][1] + dp[i][j][2]) %= mod;

            if (j + a[i] <= k) {
                (dp[i + 1][j + a[i]][1] += dp[i][j][0] + dp[i][j][1]) %= mod;
                (dp[i + 1][j + a[i]][2] += dp[i][j][0] + dp[i][j][1]) %= mod;
            }
        }
    }
    cout << dp[n][k][2] << endl;
    return 0;
}

Measured memory_bytes: 215168
import java.util.*;

public class Main {

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

        int a = sc.nextInt();
        int b = sc.nextInt();

        if (b % a == 0) {
            System.out.println(a + b);
        } else {
            System.out.println(b - a);
        }
    }

}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
int main(){

    int a,b,c; cin >> a >> b >> c;

    int cnt = 0;
    if(a != b)cnt++;
    if(a != c)cnt++;
    if(b != c)cnt++;
    if(cnt != 0)cout << cnt;
    else cout << 1;

}

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

int main()
{
	ll n,k;
	cin >> n >> k;
	vector<ll> a(n);
	for(int i = 0;i<n;i++)cin >> a[i];
	ll l = 0,r = 2*1e9;

	while(r-l>1)
	{
		ll mid = (l+r)/2;
		//最大の長さをmidにできるか
		ll now = 0;
		for(int i = 0;i<n;i++)
		{
			if(a[i]<=mid)continue;
			now += (a[i]+mid-1)/mid;
			now--;
		}
		if(now<=k)r=mid;

		else l = mid;
	}
	cout<<r<<endl;
}


Measured memory_bytes: 4740
#include <bits/stdc++.h>
#define LL               long long
#define PB               push_back
using namespace std;
void pintvec(vector <int> v){
    for (int i : v)
        cout<<i<<" ";
    cout<<endl;
}
int main() {
    int n;cin>>n;
    string s;cin >>s;
    vector <int> w,r;
    for (int i=0;i<s.length();i++){
        if (s[i]=='W') w.PB(i);
        else r.PB(i);
    }
//    pintvec(w); pintvec(r);
    int count=0;
    for (int wi=0,ri=r.size()-1;wi<w.size() && ri>=0;wi++,ri-- ){
        if (w[wi]<r[ri]) count++;
    }
    cout<< count<<endl;
}

Measured memory_bytes: 4852
#include<bits/stdc++.h>
#include<iomanip>
#define fast {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define ld long double
#define pb push_back
#define mod 1000000007
typedef long long int ll;
using namespace std;
int main(void){
	fast;
	int n,k,i,j;
	cin>>n>>k;
	int a[n];
	for(i=0;i<n;i++)
	cin>>a[i];
	for(j=1;j<=min(k,42);j++){
	int b[n]={0};
	for(i=0;i<n;i++){
		int l=max(0,i-a[i]);
		int r=min(n-1,i+a[i]);
		b[l]++;
		if(r<n-1)
		b[r+1]--;
	}
	for(i=1;i<n;i++)
	b[i]=b[i-1]+b[i];
	for(i=0;i<n;i++)
	a[i]=b[i];
	}
	for(i=0;i<n;i++)
	cout<<a[i]<<" ";
}
	


Measured memory_bytes: 5164
#include <stdio.h>
#include <algorithm>

using namespace std;

int main(){
	int H,W;
	while(true){
		scanf("%d %d",&H,&W);
		if(H == 0 && W == 0) break;
		for(int i = 0; i < H; i++){
			for(int j = 0; j < W; j++){
				printf("#");
			}
			printf("\n");
		}
		printf("\n");
	}
}



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

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define rng(a) a.begin(), a.end()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) {
    if (i)
      os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}

template <typename T, size_t S> void printArray(const T (&array)[S]) {
  for (auto val : array)
    std::cout << val << ", ";
  std::cout << "\n";
}

const int mod = 1e9 + 7;
const int inf = 1e9 + 5;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << std::setprecision(10);

  int h, w; std::cin >> h >> w;
  vector<string> grid(h); rep(i, h) std::cin >> grid[i];
  vi que;
  vvi cost(h, vi(w, inf));
  cost[0][0] = 0;
  que.pb(0);
  rep(i, que.size()) {
    int x = que[i] % w, y = que[i] / w;
    srep(dx, -1, 2) srep(dy, -1, 2) if (dx*dx+dy*dy == 1) {
      int nx = x+dx, ny = y+dy;
      if (nx < 0 || nx >= w || ny < 0 || ny >= h) continue;
      if (grid[ny][nx] == '#' || cost[ny][nx] != inf) continue;
      cost[ny][nx] = cost[y][x] + 1;
      que.pb(ny*w+nx);
    }
  }
  int ans = h * w;
  rep(i, h) rep(j, w) ans -= (grid[i][j] == '#');
  if (cost[h-1][w-1] == inf)
    std::cout << -1 << "\n";
  else
    std::cout << ans - cost[h-1][w-1] - 1 << "\n";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define rep1(i,n) for (ll i = 1; i <= (n); ++i)
#define rrep(i,n) for (ll i = (n)-1; i >=0; --i)
#define ALL(a) a.begin(),a.end()
#define pb push_back
#define dame { puts("-1"); return 0;}
#define show(x) cerr<<#x<<" = "<<x<<endl;

using namespace std;
using ll = long long;
using ld = long double;
using pl = pair<ll, ll>;

typedef vector<ll> vl;
typedef vector<pl> vp;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }


// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const ll mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
} c(200005);


int main() {
  ll n,m;
  cin >> n>>m;

  ll ans = m*n;
  cout << ans << endl;
  return 0;
}


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

using namespace std;
typedef long long ll;

#define out(ans) cout << ans << endl
#define in(n) cin >> n
#define floop(i, N) for (ll i = 0; i < N; i++)
#define floop1(i, N) for (ll i = 1; i <= N; i++)
#define floopi(i, j, N) for (ll j = i + 1; j < N; j++)

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;
}

constexpr int inf = 1e9;
constexpr ll linf = 1e18;

void solve();

int main()
{
    solve();
}

void solve()
{
    ll n;
    in(n);
    ll ans = 0;
    if (n % 2 == 0)
    {
        while (n != 0)
        {
            ans += n / 10;
            n /= 5;
        }
    }
    out(ans);
}

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

int main(){
    long long n,x;
    cin>>n>>x;
    long long a[n],i,c=0;
    for(i=0;i<n;i++)    
        cin>>a[i];
    for(i=0;i<n-1;i++){
        if(a[i]+a[i+1]>x){
            long long del=a[i]+a[i+1]-x;
            if(del>0){
            c+=del;
            if(del<=a[i+1])
                a[i+1]-=del;
            else{
                a[i]=a[i]-(del-a[i+1]);
                a[i+1]=0;
            }
            }
        }
    }
    if(c==0)
        cout<<0;
    else
        cout<<c;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <stdio.h>

using namespace std;

void solve() {
    int n; cin >> n;
    int p[10];
    for(int i = 0; i < n; i++){
        cin >> p[i];
    }

    int maxValue;
    for(int i = 0; i < n; i++){
        if(i == 0) {
            maxValue = p[0];
        } else {
            if(maxValue < p[i]){
                maxValue = p[i];
            }
        }
    }

    int sum = 0;
    for(int i = 0; i < n; i++){
        sum += p[i];
    }
    sum -= maxValue;
    sum += maxValue/2;
    cout << sum << endl;
}

int main() {
    solve();
    return 0;
}

Measured memory_bytes: 256
#include <math.h>
#include <regex>
#include "bits/stdc++.h"
#define FOR(i, s, e) for (int i = int(s); i < int(e); ++i)
#define REP(i, e) FOR(i, 0, e)
#define INF (INT_MAX / 2)
#define LINF (LLONG_MAX / 2)
#define EPS (1.0e-8)
const int MGN = 10;
const int ARY_SZ_MAX = (int)1e7;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>;
using vb = vector<bool>; using vvb = vector<vb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>; using psl = pair<string, ll>;


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


  int R; cin>>R;

  int ans = R*R;
  
  cout << ans << endl;


  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main(){

  int64_t N;
  cin >> N;
  
  vector<int64_t> f(N);
  for(int64_t i=0; i<N; i++){
    f.at(i)=i+1;
  }
  
  int64_t sum=0;
  for(int64_t i=0; i<N; i++){
    if(f.at(i)%3 == 0 || f.at(i)%5 == 0){
      continue;
    }
    else{
      sum=sum+f.at(i);
    }
  }
  cout << sum << endl;
}

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

using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL<<60;

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

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; }

ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

const int MAX = 300300;
const ll MOD = 998244353;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll n, m;

ll calc_f(int n, int k){

  ll ret = 1;
  ret = COM(n-1, k);
  ret = (ret * m) % MOD;
  ret = (ret * modpow(m-1, n-k-1, MOD)) % MOD;

  return ret;
}

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

  COMinit();

  int k;

  cin >> n >> m >> k;

  ll ans = 0;

  for(int i = 0; i <= k; i++){
    ans = (ans + calc_f(n, i)) % MOD;
  }

  cout << ans << endl;

  return 0;
}


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

import math
import sys
import heapq
from operator import itemgetter
import itertools
input = sys.stdin.readline

# a = int(input().rstrip())
# a, b = map(int, input().rstrip().split())
# D = list(map(int, input().rstrip().split()))
# H = [int(input().rstrip()) for _ in range(L)]
# DD = [[0 for j in range(100)] for i in range(200)]
# dict = {} ## dictionary

# a = sorted(a, key=lambda x: x[1]))
# if __name__ == '__main__':


a, b = map(int, input().rstrip().split())
if a == 2 or b == 2:
	print("No")
else:
	print("Yes")




Measured memory_bytes: 3188
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <numeric>
#include <climits>
#include <iterator>
#include <iomanip>
#include <stack>
#include <set>
#include <cstdio>
#include <bitset>
#include <functional>
#include <tuple>
#include <list>
#include <deque>
using namespace std;
typedef pair<int, int> P;

#define FOR(i, a, n) for (ll i = (ll)a; i<(ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)

typedef long long ll;
typedef vector<int> VI;


int a[200010];
int b[200010];
int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);
    
    ll n; cin >> n;
    typedef multimap<string, int> MCI;
    MCI mp;
    REP(i, n){
        ll a; string b; cin >> a;
        if(a==0){
            int c;
            cin >> b >> c;
            mp.insert(MCI::value_type(b, c));
        
        }else if(a==1){
            cin >> b;
            pair<MCI::iterator, MCI::iterator> p = mp.equal_range(b);
            for(MCI::iterator it = p.first; it!=p.second; ++it){
                if(it->second) cout << it->second << endl;
            }
        }else if(a==2){
            cin >> b;
            pair<MCI::iterator, MCI::iterator> p = mp.equal_range(b);
            for(MCI::iterator it = p.first; it!=p.second; ++it){
                it->second=0;
            }
        }else if(a==3){
            string c;
            cin >> b >> c;
            for(auto it=mp.lower_bound(b); it!=mp.upper_bound(c); ++it){
                if((*it).second) cout << (*it).first << " " << (*it).second << endl;
            }
            
        }
    }
	return 0;
}


Measured memory_bytes: 25004
#include <bits/stdc++.h>
using namespace std;
struct pt {
	long long x, y;
};

bool cmp (pt a, pt b) {
	return a.x < b.x || a.x == b.x && a.y < b.y;
}

bool cw (pt a, pt b, pt c) {
	return a.x*(b.y-c.y)+b.x*(c.y-a.y)+c.x*(a.y-b.y) < 0;
}

bool ccw (pt a, pt b, pt c) {
	return a.x*(b.y-c.y)+b.x*(c.y-a.y)+c.x*(a.y-b.y) > 0;
}
map < pair < long long, long long >, int > q;
void convex_hull (vector<pt> & a) {
	if (a.size() == 1)  return;
	sort (a.begin(), a.end(), &cmp);
	pt p1 = a[0],  p2 = a.back();
	vector<pt> up, down;
	up.push_back (p1);
	down.push_back (p1);
	for (size_t i=1; i<a.size(); ++i) {
		if (i==a.size()-1 || cw (p1, a[i], p2)) {
			while (up.size()>=2 && !cw (up[up.size()-2], up[up.size()-1], a[i]))
				up.pop_back();
			up.push_back (a[i]);
		}
		if (i==a.size()-1 || ccw (p1, a[i], p2)) {
			while (down.size()>=2 && !ccw (down[down.size()-2], down[down.size()-1], a[i]))
				down.pop_back();
			down.push_back (a[i]);
		}
	}
	a.clear();
	for (size_t i=0; i<up.size(); ++i)
		a.push_back (up[i]);
	for (size_t i=down.size()-2; i>0; --i)
		a.push_back (down[i]);
}
long double get_angle(pt a, pt b, pt c) {
    long double dist1 = sqrt(1.0 * (b.x - a.x)* (b.x - a.x) + (b.y - a.y) * (b.y - a.y));
    long double dist2 = sqrt(1.0 * (b.x - c.x) * (b.x - c.x) + (b.y - c.y) * (b.y - c.y));
    long double dist3 = (sqrt(1.0 * (a.x - c.x) * (a.x - c.x) + (a.y - c.y) * (a.y - c.y)));
    return acos((dist1 * dist1 + dist2 * dist2 - dist3 * dist3) / (2 * dist1 * dist2));
}
long double ans[105];
int n;
int main() {
    //freopen("input.txt", "r", stdin);
    cin >> n;
    vector < pt > a;
    for (int i = 1; i <= n; i++) {
        long long x, y;
        cin >> x >> y;
        q[make_pair(x, y)] = i;
        pt t;
        t.x = x;
        t.y = y;
        a.push_back(t);
    }
    convex_hull(a);
    long double pi = acos(-1.0);
    if (a.size() == 2) {
        //cout << "HERE" << endl;
        ans[q[make_pair(a[0].x, a[0].y)]] = 0.5;
        ans[q[make_pair(a[1].x, a[1].y)]] = 0.5;
    }
    else {
        for (int i = 0; i < a.size(); i++) {
            long double y = get_angle(a[i], a[(i + 1) % a.size()], a[(i + 2) % a.size()]);
            ans[q[make_pair(a[(i + 1) % a.size()].x, a[(i + 1) % a.size()].y)]] = ((pi - y) / (2 * pi));
        }
    }
    for (int i = 1; i <= n; i++) cout << fixed << setprecision(15) << ans[i] << endl;
    return 0;
}


Measured memory_bytes: 256
#include<string>
#include<iostream>
#include<algorithm>
#include<set>
#include<math.h>
#include<vector>
#include<sstream>
#include<queue>
#include<functional>
#include<bitset>
#include<cstdio>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include <string.h>
using ll = long long;
 
#define rep(i, n) for(ll i = 0; i < (int)(n); i++)
#define reps(i,x) for(ll i=1;i<=(int)(x);i++)
#define rrep(i,x) for(ll i=((int)(x)-1);i>=0;i--)
#define rreps(i,x) for(ll i=(int)(x);i>0;i--)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))
#define vll vector<ll>
#define vi vector<int>
#define mp make_pair
#define vpll vector<pair<ll,ll>>
#define vpi vector<pair<int,int>>
#define mod 1000000007 
using namespace std;
int a[2][100];
int main() {
	int n;
	cin >> n;
	rep(i,2){
		rep(j,n){
			cin >> a[i][j];
		}	
	}
	int mx = 0;
	rep(i,n){
		int sum = 0;
		int r = 0;
		rep(j,n){
			if(i == j) {
				sum += a[r][j];
				r++;
			}
			sum += a[r][j];
		}	
		mx = max(sum, mx);
	}
	cout << mx << endl;
}


Measured memory_bytes: 256
n=int(input())
a=list(map(int,input().split()))
b=[a[0]]
f=-1
for i in a:
  if b[-1]<i:
    if f==1:b[-1]=i
    else:
      b.append(i)
      f=1
  if b[-1]>i:
    if f==-1:b[-1]=i
    else:
      b.append(i)
      f=-1
if f==-1:del b[-1]
if len(b)==0:exit(print(1000))
now=1000
for i in range(0,len(b),2):
  bb=now//b[i]
  now-=bb*b[i]
  now+=bb*b[i+1]
print(now)

Measured memory_bytes: 9232
import java.util.*;
import java.lang.*;

public class Main {
	
	public static int gcf(int n1, int n2) {
	
		if(n2==0) {
			return n1;
		}else {
			return gcf(n2, n1%n2);
		}
		
		
	}
	
	public static void main(String[] args) {
		
		
		Scanner scan = new Scanner(System.in);
		
		System.out.println(gcf(scan.nextInt(),scan.nextInt()));
		
	}
}


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

int main() {
    string s; cin >> s;
    string prev,now;
    int ans = 0;
    for (auto i: s) {
        if (now.empty() or now == prev) now += i;
        else {
            ans ++;
            prev = now;
            now = i;
        }
    }
    if (prev != now) ans ++;
    cout << ans << endl;
}

Measured memory_bytes: 3764
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
from copy import deepcopy
from string import ascii_lowercase

# If you use recursive call, uncomment this code
sys.setrecursionlimit(10**6)

count = 0

def main(N):
    answer = ""
    while N > 0:
        N -= 1
        t = N % 26
        answer += chr(ord("a")+t)
        N //= 26
    print(answer[::-1])

if __name__ == '__main__':
    N = int(input())
    #for i in range(1,30):
    #    main(i)    
    main(N)


Measured memory_bytes: 10340
import collections

n = int(input())
a = list(map(int, input().split()))
L = [i + ai for i, ai in enumerate(a)]
R = [i - ai for i, ai in enumerate(a)]
t = collections.Counter(L)
u = collections.Counter(R)
ans = 0
for i in t.keys():
    ans += t[i]*u[i]
print(ans)


Measured memory_bytes: 63464
#include<bits/stdc++.h>
 
using namespace std;
 
#define INF 1000000007
#define LINF 1000000000000000007
 
typedef long long i64;
typedef pair<i64,i64> P;


i64 n, m, l, r;
int cnt[101010] = {0};

int main(){
	cin >> n >> m;
	for(int i = 0; i < m; i++){
		cin >> l >> r;
		cnt[l]++;
		cnt[r+1]--;
	}
	
	int ans = 0;
	for(int i = 1; i <= n; i++){
		cnt[i] += cnt[i-1];
		if(cnt[i] == m) ans++;
	}
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <string>

using namespace std;
int H, W;
vector<vector<bool>>ban;
vector<vector<bool>>visited;
vector<long long> dfs(int h, int w, bool iswhite) {
	visited[h][w] = true;
	vector<long long>ret(2); ret[iswhite]++;
	int move[4][2] = { {1,0},{-1,0} , { 0,1 }, { 0,-1 } };
	for (int i = 0; i < 4; i++) {
		int x = h + move[i][0]; int y = w + move[i][1];
		if (0 <= x && x < H && 0 <= y && y < W&&ban[h][w] != ban[x][y] && !visited[x][y]) {
			auto v = dfs(x, y, !iswhite);
			ret[0] += v[0]; ret[1] += v[1];
		}
	}
	return ret;
}
int main() {
	cin >> H >> W;
	ban = vector<vector<bool>>(H, vector<bool>(W));
	visited = vector<vector<bool>>(H, vector<bool>(W));
	for (int i = 0; i < H; i++) {
		string s; cin >> s;
		for (int j = 0; j < W; j++)ban[i][j] = s[j] == '.';
	}
	long long ret = 0;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (!ban[i][j] && !visited[i][j]) {
				auto x = dfs(i, j, false);
				ret += x[0] * x[1];
			}
		}
	}
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 30336