akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

int main() {
    std::ios::sync_with_stdio(false); 
    cin.tie(nullptr);
    
    int N, K;
    cin >> N >> K;
    vector<int> a(N);
    for (int i = 0; i < N; ++i) {
        cin >> a[i];
    }
    constexpr int MOD = 1'000'000'007;
    vector<int> dp(K + 1, 0);
    dp[0] = 1;
    for (int i = 0; i < N; ++i) {
        vector<int> nxt(K + 1, 0);
        for (int j = 0; j <= K; ++j) {
            nxt[j] = (nxt[j] + dp[j]) % MOD;
            if (j + a[i] + 1 <= K) {
                nxt[j + a[i] + 1] = (nxt[j + a[i] + 1] - dp[j] + MOD) % MOD;
            }
        }
        for (int j = 1; j <= K; ++j) {
            nxt[j] = (nxt[j] + nxt[j - 1]) % MOD;
        }
        dp = nxt;
    }
    cout << dp[K] << "\n";

    return 0;
}

Measured memory_bytes: 1024
x = [[1, 3, 5, 7, 8, 10, 12], [4, 6, 9, 11], [2]]

a, b = list(map(int, input().split(' ')))

for g in x:
  if a in g:
    if b in g:
      print('Yes')
    else:
      print('No')


Measured memory_bytes: 2940
def resolve():
    N = int(input())
    S = input()
    am = [0]
    ans = 0
    for i in range(N):
        if S[i] == "I":
            ans += 1
        if S[i] == "D":
            ans -= 1
        am.append(ans)
    print(max(am))
resolve()

Measured memory_bytes: 3060
from fractions import gcd
a,b=[int(i) for i in input().split()]
res=set()
x=gcd(a,b)
y=2
while y*y<=x:
  while x%y==0:
    res.add(y)
    x//=y
  y+=1
if x>1:
  res.add(x)
print(len(res)+1)

Measured memory_bytes: 5048
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
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;}

const int INF = 1000000000;

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

int n,k,s;
cin >> n >> k >> s;

vector<int> a(n);
rep(i,n) a[i] = INF;

if(k == 0){
    if(s != INF)rep(i,n) cout << a[i] << ' ';
    else rep(i,n) cout << 1 << ' ';
    return 0;
}

if(k == n){
    rep(i,n) cout << s << ' ';
    return 0;
}

if(s == 1){
    for(int i = 1;i <= k ;i++){
        cout << 1 << ' ';
    }
    for(int i = 1;i <= n-k;i++){
        cout << INF << ' ';
    }
    return 0;
}

if(s == 2){
    for(int i = 1;i <= k+1;i++){
        cout << 1 << ' ';
    }
    rep(i,n-k-1) cout << INF << ' ';


    return 0;
}

if(s == 1000000000){
    for(int i =1;i <= k;i++) cout << INF << ' ';
    rep(i,n-k) cout << 1 << ' ';
    return 0;
}

if(s % 2 == 1){
    for(int i = 0;i <= k;i++){
        if(i % 2 == 0) a[i] = s / 2;
        else a[i] = s / 2 + 1;
    }
}else{
    for(int i = 0;i <= k;i++){
        if(i % 2 == 0) a[i] = s / 2 + 1;
        else a[i] = s / 2 - 1;
    }
}

rep(i,n) cout << a[i] << endl;

return 0;
}

Measured memory_bytes: 1792
N = int(input())
A = list(map(int, input().split()))
A.sort()                  #エラトステネスの篩にかけるためソート
Amax = A[-1]
dp = [1]*(Amax+1)         #Aの最大値までのエラトステネスの篩を作る。
ans = 0
for i in range(len(A)-1):
  p = A[i]
  if dp[p] == 1:          #A[i]がA[j]の倍数でないかをエラトステネスの篩でチェック
    for q in range(Amax//p+1):
      dp[p*q] = 0         #A[i]の倍数をすべて0にする
    if A[i] != A[i+1]: 
      ans += 1            #A[i]が重複していなければカウント
if dp[Amax] == 1:         #重複チェック時にレンジオーバーするためAmaxだけ別で判定 
  ans += 1
print(ans)

Measured memory_bytes: 106192
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<algorithm>
using namespace std;
int main()
{
    int a,b,c,d,min1,min2;
    while(scanf("%d%d%d%d",&a,&b,&c,&d)==4)
    {
        min1=a>b?b:a;
        min2=c>d?d:c;
        printf("%d\n",min1+min2);
    }
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
  using namespace std;
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define set0(k,n) for(int nn=0;nn<(n);nn++){ (k).push_back(0); }
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsl(s) vector<pair<ll,ll>> (s);
#define pairss(s) vector<pair<string,string>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairspl(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsps(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsREV(s) (s).push_back(make_pair(bb,aa));
#define pairslREV(s) (s).push_back(make_pair(bb,aa));
#define pairssREV(s) (s).push_back(make_pair(bb,aa));
#define MOD 1000000007

int gcd(int x,int y){
	
	if(x%y==0){
		return y;
	}else{
		return gcd(y,x%y);
	}
	
}


int main() {

string S;
cin>>S;

int month=atoi(S.substr(5,2).c_str());
int day=atoi(S.substr(8,2).c_str());

if(month>=5){
	ce("TBD")
}else{
	ce("Heisei")
}

}

Measured memory_bytes: 256
/*双方向連結リスト*/
#include <stdio.h>
#include <stdlib.h>

struct node{
  unsigned int key;
  struct node *next;
  struct node *prev;
};

typedef struct node * NodePointer;

NodePointer nil;

void init(void);
void printList(void);
void deleteNode(NodePointer);
void deleteFirst(void);
void deleteLast(void);
void delete(int);
void insert(int);

void init(){
  nil = malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;
}

void printList(){
  NodePointer cur = nil->next;
  int isf = 1;
  while(1){
    if ( cur == nil ) break;
    if ( isf == 0)  printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
    isf = 0;
  }
  printf("\n");
}

void deleteNode(NodePointer t){
  t->next->prev = t->prev;
  t->prev->next = t->next;
}


void deleteFirst(){
  NodePointer t = nil->next;
  if ( t != nil ){
    deleteNode(t);
  }
}

void deleteLast(){
  NodePointer t = nil->prev;
  if ( t != nil ){
    deleteNode(t);
  }
}

void delete(int key){
  NodePointer del = nil->next;
  while(1){
    if (del->key == key){
      deleteNode(del);
      break;
    }
    del = del->next;
    if (del == nil->next) return;
  }
}


void insert(int key){
  NodePointer x;
  x = malloc(sizeof(struct node));
  x->key = key;
  
  x->prev = nil;
  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
}

int main(){
  int n, i, key;
  char com[20];
  scanf("%d", &n);
  init();
  for ( i = 0; i < n; i++ ){
    scanf("%s", com);

    if (com[0] == 'i'){
      scanf("%d", &key);
      insert(key);
    }
    else if (com[0] == 'd'){
      if (com[6] == 'F')
	deleteFirst();
      else if(com[6] == 'L')
	deleteLast();
      else{
	scanf("%d", &key);
	delete(key);
      }
    }
  }

  printList();
  return 0;
}



Measured memory_bytes: 36092
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  int N, H;
  cin >> N >> H;
  int a, b;
  vector< pair<int,int> > V;
  for(int i = 0; i < N; ++i){
    cin >> a >> b;
    V.push_back(make_pair(a,0));
    V.push_back(make_pair(b,1));
  }
  sort(V.begin(), V.end(), greater< pair<int,int> >());
  int ans = 0;
  for(int i = 0; i < 2*N; ++i){
    if(H <= 0) break;
    int d = V[i].first, t = V[i].second;
    if(t){
      ++ans;
      H -= d;
    }else{
      ans += (H + d - 1)/d;
      H = 0;
    }
  }
  cout << ans << endl;
  return 0;
}


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

int descending_compare(const void *a, const void *b){
    return (int)(*(char*)b - *(char*)a);
}

int ascending_compare(const void *a, const void *b){
    return (int)*(char*)a - *(char*)b;
}




int main(void){
    char s[101];
    char t[101];
    int i;

    scanf("%s %s", s, t);

    qsort(s, strlen(s), sizeof(char), ascending_compare);
    qsort(t, strlen(t), sizeof(char), descending_compare);

    for (i = 0; i < strlen(s); i++){
        if (s[i] < t[i]){
            printf("Yes\n");
            return 0;
        }else if (s[i] > t[i]){
            printf("No\n");
            return 0;
        }
    }

    if (strlen(s) == strlen(t)){
        printf("No\n");
        }else{printf("Yes\n");}
    
    
    
    
    
    return 0;
}


Measured memory_bytes: 128
#include <stdio.h>

int main() {
	int a;
	long long int list[1000000],max = 1e18, result = 1, flag = 0, zero = 0;
	scanf("%lld", &a);
	for(int i = 0; i < a; i++){
		scanf("%lld", &list[i]);
		flag = (list[i] > max) ? 1 : flag;
		result *= list[i];
		(list[i]) ? max /= list[i] : zero = 1;
	}
	
	(zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", result)); 
	
	return 0;
}


Measured memory_bytes: 3896
#include "bits/stdc++.h"
using namespace std;
const int N = 1e5 + 5;
const int mod = 1e9 + 7;
int n;
int arr;
int ans;
int fact;
int cur;
int main(){
    scanf("%d" , &n);
    cur = 0;
    fact = 1;
    ans = 1;
    while(n--){
        scanf("%d" , &arr);
        ++cur;
        if(arr < 2 * cur - 1){
            ans = (1LL * ans * cur) % mod;
            --cur;
        }
    }
    while(cur--){
        ans = (1LL * ans * (cur + 1LL)) % mod;
    }
    printf("%d\n" , ans);
}

Measured memory_bytes: 256
from sys import stdin, stdout
from collections import deque, defaultdict
from heapq import heappush, heappop, heapify

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

def main():
	G = defaultdict(lambda: [])
	n, m = rli()
	for _ in range(m):
		u, v = rli()
		G[u].append(v)
		G[v].append(u)
	Q = deque([])
	seen = defaultdict(lambda: False)
	Q.appendleft((1, -1)) #curr node, prev node
	posts = [-1 for _ in range(n + 1)]
	while Q:
		for _ in range(len(Q)):
			curr, prev = Q.pop()
			if seen[curr]: continue
			seen[curr] = True
			posts[curr] = prev
			for nbhr in G[curr]:
				if seen[nbhr]: continue
				Q.appendleft((nbhr, curr))
	print("Yes")
	for i in range(2, n+1):
		print(posts[i])
	stdout.close()

if __name__ == "__main__":
	main()

Measured memory_bytes: 116868
import java.io.*;
import java.util.*;

public class Main {

	final static long MOD = 1000000007;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static void main(String[] args) throws Exception {
		solution(args);
		if(in!=null){
			in.close();
		}
	}

	public static void solution(String[] args) throws Exception{

		int A = nextInt();
		int B = nextInt();
		int C = nextInt();


		System.out.println(Math.min(C, B/A));

	}
	public static String[] toStringArray(String s) {
		String[] tmp = new String[s.length()];
		char[] c = s.toCharArray();
		for (int i = 0; i < tmp.length; i++) {
			tmp[i] = String.valueOf(c[i]);
		}
		return tmp;
	}

	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


}


Measured memory_bytes: 21076
#include<stdio.h>
int main()
{
    int n;
    scanf("%d",&n);
    if(n==111){
        printf("999\n");

    }
    else if(n==191){
        printf("919\n");

    }
    else if(n==199){
        printf("911\n");
    }
    else if(n==911){
        printf("199\n");
    }
    else if(n==919){
        printf("191\n");
    }
    else if(n==999){
        printf("111\n");
    }
    else if(n==119){
        printf("991\n");
    }
    else if(n==991){
        printf("119\n");
    }
    else{
        printf("\n");
    }
    return 0;


}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <iomanip>

using namespace std;
#define For(i, a, b) for(long long i = (a); i < (b); ++i)
#define rep(i, n) for(long long i = 0; i < (n); ++i)

#define PI 3.141592653589793

int main()
{
	long double a, b, x;

	cin >> a >> b >> x;

	long double h = x / pow(a, 2.0);

	long double ans;

	if (h <= (b / 2)) {
		ans = 90 - (atan(((2 * x) / (a * b)) / b) * 180.0 / PI);
	}
	else {
		long double empx = (pow(a, 2.0) * b) - x;

		ans = atan(((2 * empx) / pow(a, 2.0)) / a) * 180.0 / PI;
	}

	cout << fixed << setprecision(10) << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
/*---define tricks---*/
#define ALL(v) v.begin(),v.end()
#define UN(v) sort(ALL(v)),v.erase(unique(ALL(v)),v.end())
#define FILL(x,y) memset(x,y,sizeof(x))
#define EACH(v,it) for(__typeof(v.begin()) it=v.begin();it!=v.end();it++)
#define FIO ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define revsort(b,e) sort(b,e),reverse(b,e)
/*---define types---*/
typedef long long ll;
typedef unsigned int uint;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<pii> vii;
/*---define variables---*/
int n,m;
int s[15][15],k[15];
int perm[15];
int sum[15],need[15];
int ans;
vi E[15];
/*---define function---*/

void DFS(int x)
{
	if(x>n)
	{
		++ans;
		return ;
	}
	perm[x]=1;
	EACH(E[x],it)
	{
		sum[*it]++;
	}
	bool f=0;
	for(int i=1;i<=m;++i)
	{
		if(s[i][k[i]]==x)
		{
			if(sum[i]%2!=need[i])
			{
				f=1;
				break;
			}
		}
	}
	if(!f)
	{
		DFS(x+1);
	}
	perm[x]=0;
	EACH(E[x],it)
	{
		sum[*it]--;
	}
	f=0;
	for(int i=1;i<=m;++i)
	{
		if(s[i][k[i]]==x)
		{
			if(sum[i]%2!=need[i])
			{
				f=1;
				break;
			}
		}
	}
	if(!f)
	{
		DFS(x+1);
	}
}

/*---main code---*/
int main()
{
	FIO;
	cin>>n>>m;
	for(int i=1;i<=m;++i)
	{
		cin>>k[i];
		for(int j=1;j<=k[i];++j)
		{
			cin>>s[i][j];
			E[s[i][j]].push_back(i);
		}
		sort(s[i]+1,s[i]+1+k[i]);
	}
	for(int i=1;i<=m;++i)
	{
		cin>>need[i];
	}
	DFS(1);
	cout<<ans<<'\n';
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep_inv(i, n, m) for(int i = (int)(n); i > (int)(m); i--)
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vc = vector<char>;
using vvl = vector<vl>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;

int main(){
  ll N;
  cin >> N;
  vl A(N);
  rep(i, N) cin >> A[i];

  ll left = 0, right = 0;
  ll ans = 1;
  ll calc = A[0];

  while(right < N - 1){
    if((calc ^ A[right + 1]) == (calc + A[right + 1])){
      right++;
      calc += A[right];
      ans += right - left + 1;
    } else{
      calc -= A[left];
      left++;

      if(left > right){
	right = left;
	calc = A[left];
	ans++;
      }
    }
  }
  
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

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

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}
int sgn(const double&r){return (r>EPS)-(r<-EPS);} // a>0  : sgn(a)>0
int sgn(const double&a,const double&b){return sgn(a-b);} // b<=c : sgn(b,c)<=0

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll a,b;
	string s,t,u;
	cin>>s>>t>>a>>b>>u;
	puta(a-(s==u),b-(t==u));
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long 
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define F first
#define S second
int const M=2e5+10,mod=1e9+7,inf=1e9+10;
int a[M];
main()
{
	int x,y;
	cin>>x>>y;
	int ans=0;
	while(x<=y)
	{
		ans++;
		x*=2;
	}
	cout<<ans;
}

Measured memory_bytes: 764
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <climits>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <numeric>
#include <sstream>
#include <string>
using namespace std;
//const int maxn = 22;
int r,c;
// int des[4][2] = {{0,1},{0,-1},{1,0},{-1,0}};
/*
bool ok[maxn][maxn]; 
bool al[maxn][maxn];
void next(int &i,int &j){
	int x = i;
	int y = j;
	if(y < c){
	  j = j+1;
	}
	else
	{ if(i < r) i = i+1;
	  }}
bool bfs(int i,int j)
{
	if(j < c && !ok[i][j+1]){
		ok[i][j+1] = true;
		al[i][j] = true;
		if(bfs(i,j+1)){
		  al[]return true;
		else ok[i][j+1] = false;
	}
	if(j > 1 && !ok[i][j-1]){
		ok[i][j-1] = true;
		if(bfs(i,j-1))
		  return true;
		else ok[i][j-1] = false;
	}
	if(i > 1 && !ok[i-1][j]){
		ok[i-1][j] = true;
		if(bfs(i-1,j))
		  return true;
		else ok[i-1][j] = false;
	}
	if(i < r && !ok[i+1][j]){
		ok[i+1][j] = true;
		if(bfs(i+1,j))
		  return true;
		else ok[i][j] = false;
	}
	return false;
}
*/
int main()
{
	while(cin>>r>>c,r,c){
		//memset(ok,false,sizeof(ok));
		//memset(al,false,sizeof(al));
		//bool flag;
		//flag = bfs(1,1);
		if(r*c%2 == 0) printf("yes\n");
		else printf("no\n");
	}
	return 0;
}

Measured memory_bytes: 0
import bisect,collections,copy,itertools,math,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())
##################################################
K,N = LI()
A = LI()
ans = float('INF')
_A = []
for x in A:
    _A.append(x-K)
allA = _A+A
for i in range(N*2-(N-1)):
    ans = min(ans,allA[i+N-1]-allA[i])
print(ans)


Measured memory_bytes: 26856
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define debug(x) cerr << #x << " " << x << '\n'
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
const int INF = 0x3f3f3f3f, N = 2e5 + 5;
const ll LINF = 1e18 + 5;
int n, a[N], b[N];
int main()
{
 	ios::sync_with_stdio(false);
 	cin.tie(0);
 	cin >> n;
 	for(int i=1; i<=n; i++) cin >> a[i];
 	for(int i=n; i>=1; i--)
 	{
 		int tmp = 0;
 		for(int j=i+i; j<=n; j+=i) tmp += b[j];
 		if(tmp%2==a[i]) b[i] = 0;
 		else b[i] = 1;
 	}
	vector <int> p;
	for(int i=1; i<=n; i++) if(b[i]) p.pb(i);
	cout << sz(p) << '\n';
	for(int x : p) cout << x << ' ';
	return 0;
}


Measured memory_bytes: 3192
#include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>

using ll = long long;
#define rep(inc, bgn, end) for (int inc = bgn; inc < end; ++inc)
#define repe(inc, bgn, end) for (int inc = bgn; inc <= end; ++inc)

using namespace std;
int main() {
    string str;
    cin >> str;

    vector<int> idx;
    // O:n
    rep(i, 0, str.size() - 1) {
        if (str[i] == 'R' && str[i + 1] == 'L') {
            idx.push_back(i);
        }
    }

    idx.push_back(10001000);

    //
    int nextidx = 0;
    int previdx = -1;
    vector<int> pos(str.size(), 0);
    rep(i, 0, str.size()) {
        // update idx
        if (i > idx[nextidx]) {
            nextidx++;
            previdx++;
        }

        int _idx = -1;
        if (str[i] == 'R') {
            _idx = idx[nextidx];
        } else {
            _idx = idx[previdx];
        }
        pos[_idx + (abs(_idx - i) % 2)]++;
    }

    // print result
    rep(i, 0, pos.size()) {
        cout << pos[i];
        if (i < pos.size() - 1) {
            cout << " ";
        } else {
            cout << endl;
        }
    }

    return 0;
}


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

int main(){
#ifdef _DEBUG
	freopen("in" , "r", stdin );
	freopen("out", "w", stdout);
#endif
	ios::sync_with_stdio(0); cin.tie(0);
	set<int> s;
	for(int i = 0; i < 3; i++){
		int t; cin >> t;
		s.insert(t);
	}
	cout << s.size() << '\n';
}


Measured memory_bytes: 256
#include <stdio.h>
 
int main(void){
  int i,j,n,taro_p=0,hana_p=0;
  char taro[101], hana[101];
 
  scanf("%d", &n);
 
  for(i=0;i<n;i++){
    scanf("%s %s", taro, hana);
 
    for(j=0;;j++){
      if(taro[j] > hana[j]){
        taro_p += 3;
        break;
      }else if(taro[j] < hana[j]){
        hana_p += 3;
        break;
      }else if(taro[j] + hana[j] == 0){
        hana_p++;
        taro_p++;
        break;
      }
    }
  }
 
  printf("%d %d\n", taro_p , hana_p);
  return 0;
}


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

const ll maxs = 1e6+5;
const ll lmaxs = 20;
ll mod = 1e9+7;
ll oo = 1e15;

#define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define I insert
#define endl '\n'

void pre(){

}

void solve(){
    
   ll n;
   cin>>n;
   ll sum=0;
   for(ll i=1;i<=n;i++){
       if(i%3 and i%5){
           sum += i;
       }
   }
   cout << sum;
    
}

int main(){
    IOS;
    pre();
    ll T = 1;
    //cin>>T;
    while(T--){
        solve();   
    }
    return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
#define rep(i,n) for(int i=0;i<n;++i)
#define Sort(a) sort(a.begin(),a.end())
const int INF = 1e9+7;

int main(){
  string S;
  bool n=0,e=0,w=0,s=0;
  cin >> S;
  rep(i,S.size()){
    if(S.at(i)=='N'){
      n = 1;
    }else if(S.at(i)=='E'){
      e = 1;
    }else if(S.at(i)=='W'){
      w = 1;
    }else if(S.at(i)=='S'){
      s = 1;
    }
  }
  if(n&&e&&w&&s||n&&s&&!e&&!w||e&&w&&!n&&!s){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl; 
  }
}

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

typedef long long ll;
typedef pair<int,int> P;

#define p_ary(ary,a,b) do { cout << "["; for (int count = (a);count < (b);++count) cout << ary[count] << ((b)-1 == count ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)

int main() {
    int n;
    cin >> n;
    vector<vector<ll>> a(10,vector<ll>(10,0));
    for (int i = 1;i < n+1;++i) {
        int j = i,k = i%10;
        while (j > 9) j /= 10;
        a[j][k]++;
    }
    ll ans = 0;
    for (int i = 0;i < 10;++i) for (int j = 0;j < 10;++j) ans += a[i][j]*a[j][i];
    cout << ans << endl;
}

Measured memory_bytes: 384
import itertools

N,X,Y = map(int,input().split())
n = list(range(1,N+1))
l = [0]*N
for v in itertools.combinations(n,2):
  l[min(abs(Y-v[1]) + abs(X-v[0]) + 1,v[1] - v[0])] += 1
for k in range(1,N):
  print(l[k])

Measured memory_bytes: 3572
from sys import stdin, setrecursionlimit
input = stdin.buffer.readline
setrecursionlimit(10 ** 7)

from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter
from itertools import combinations, permutations, combinations_with_replacement
from itertools import accumulate
from math import ceil, sqrt, pi, radians, sin, cos

MOD = 10 ** 9 + 7
INF = 10 ** 18

N = int(input())
A = list(map(int, input().split()))
Q = int(input())
BC = [list(map(int, input().split())) for _ in range(Q)]

cnt = [0] * (10 ** 5 + 1)
for a in A:
    cnt[a] += 1
    
answer = sum(A)
for b, c in BC:
    answer += c * cnt[b] - b * cnt[b]
    cnt[c] += cnt[b]
    cnt[b] = 0
    print(answer)

 

Measured memory_bytes: 90992
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int maxn=1e5+5;
typedef long long ll;
int n,m;
struct Node{
	int x,y;
}edge[maxn];
vector<ll>ans;
int f[maxn];
ll size[maxn];
ll tmp;
inline int find(int x){
	if(f[x]==x) return x;
	else return f[x]=find(f[x]);
}
inline void unionn(int x,int y){
	x=find(x);
	y=find(y);
	if(x!=y){
		f[y]=x;
		tmp+=size[x]*(size[x]-1)/2+size[y]*(size[y]-1)/2;
		size[x]+=size[y];
		size[y]=0;
		tmp-=size[x]*(size[x]-1)/2;
	}
}
signed main(){
	scanf("%lld%lld",&n,&m);
	for(int i=1;i<=n;i++) f[i]=i,size[i]=1;
	for(int i=1;i<=m;i++) scanf("%lld%lld",&edge[i].x,&edge[i].y);
	reverse(edge+1,edge+1+m);
	tmp=n*(n-1)/2;
	ans.push_back(tmp);
	for(int i=1;i<=m-1;i++){
		int x=edge[i].x;
		int y=edge[i].y;
		unionn(x,y);
		ans.push_back(tmp);
	}
	reverse(ans.begin(),ans.end());
	for(int i=0;i<ans.size();i++)
		printf("%lld\n",ans[i]);
	return 0;
}

Measured memory_bytes: 5364
#include <iostream>
#include <string>
using namespace std;
int main(void){
    // Your code here!
    int a;
    cin >> a;
    string b;
    int c = 0;
    int d = 0;
    int e = 0;
    int f = 0;
    for (int i = 0; i < a; i++) {
        cin >> b;
        if(b=="AC")c++;
        if(b=="WA")d++;
        if(b=="TLE")e++;
        if(b=="RE")f++;
    }
    cout << "AC x " << c << endl;
    cout << "WA x " << d << endl;
    cout << "TLE x " << e << endl;
    cout << "RE x " << f << endl;
    return 0;
}


Measured memory_bytes: 3628
A, B, C, D = list(map(int, input().split()))

a = A // D
b = C // B
N = max(a, b) + 1
for i in range(N):
    if C > 0:
        C -= B
        if C <= 0:
            break
    if A > 0:
        A -= D
        if A <= 0:
            break

ans = "No"
if A > C:
    ans = "Yes"

print(ans)

Measured memory_bytes: 9192
import numpy as np
from numba import njit,i8

@njit(i8[:](i8[:]),cache = True)
def calc(A):
    B = np.zeros_like(A)
    for i in range(len(A)):
        B[max(0,i - A[i])] += 1
        if i + A[i] + 1 < len(A):
            B[i + A[i] + 1] -= 1
    B = np.cumsum(B)
    return B
  
import sys
readline=sys.stdin.readline
  
N,K = map(int,readline().split())
A = np.array(list(map(int,readline().split())))

for i in range(K):
  A = calc(A)
  if A[0] == N and len(set(A)) == 1:
    break
print(*A)


Measured memory_bytes: 129712
S = input()
zenhan0 = 0
zenhan1 = 0
kouhan0 = 0
kouhan1 = 0
for i in range(len(S)//2):
  if S[i] == '0':
    zenhan0 += 1
  else:
    zenhan1 += 1 
for j in range(len(S)//2,len(S)):
  if S[j] == '0':
    kouhan0 += 1
  else:
    kouhan1 += 1
print(len(S)-abs(zenhan0-kouhan1)-abs(zenhan1-kouhan0))

Measured memory_bytes: 3188
#include <bits/stdc++.h>
typedef long long ll;
#define  rep(i,a,b)for(long long i=a;i<b;++i)
#define  rrep(i,a,b)for(int i=a;i>=b;--i)
#define  yesno(flag)if(flag)cout<<"Yes"<<endl; else cout<<"No"<<endl;
using namespace std;
const ll INF=1000000000000LL;
const ll r197=1000000007;
typedef pair<ll,ll>P;
typedef pair<int,P>Pa;
bool Inframe(int a,int b,int c,int d,int h,int w){
	if(a+b>=0&&a+b<h&&c+d>=0&&c+d<w)return true;
	return false;
}
ll n,m;
vector<P> v[100001];
P g[100001];
int main() {
	cin>>n>>m;
	ll p,y;
	rep(i,0,m){
		cin>>p>>y;
		v[p-1].push_back(P(y,i));
	}
	rep(i,0,n){
		sort(v[i].begin(),v[i].end());
		for(int j=0;j<v[i].size();++j){
			g[v[i][j].second]=P(i+1,j+1);
		}
	}
	string str;
	rep(i,0,m){
		str="";
		int h=100000;
		while(h){
			if(g[i].first/h==0)str+="0";
			h/=10;
		}
		cout<<str<<g[i].first;
		str="";
		h=100000;
		while(h){
			if(g[i].second/h==0)str+="0";
			h/=10;
		}
		cout<<str<<g[i].second<<endl;;
	}
	return 0;
}


Measured memory_bytes: 8576
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
const bool debug = false;

int main(){
    int n,m;
    cin >> n >> m;
    vector<vector<int>> gr(n+1);
    vector<int> st_hist(n+1); // 入次数
    rep(i,m){
        int x,y;
        cin >> x >> y;
        gr.at(x).push_back(y);
        st_hist.at(y)++;
    }
    if(debug){
        cout << "input ok" << endl;
        rep(i,n){
            cout << i+1 << " : ";
            for(int x:gr.at(i+1)) {
                cout << x << " ";
            }
            cout << endl;
        }
    }

    vector<int> tsorted;
    stack<int> st;
    for(int i=1;i<=n;i++){
        if(st_hist[i] == 0){
            st.push(i);
        }
    }
    while(!st.empty()){
        int cr = st.top();
        st.pop();
        tsorted.push_back(cr);
        for(int x : gr[cr]) {
            st_hist[x]--;
            if(st_hist[x] == 0){
                st.push(x);
            }
        }
    }

    if(debug){
        rep(i,tsorted.size()){
            cout << tsorted[i] << " ";
        }
        cout << endl;
    }

    vector<int> dp(n+1);
    for(int i : tsorted){
        for(int x : gr[i]){
            dp[x] = max(dp[x], dp[i] + 1);
        }
        if(debug){
            rep(j,n){
                cout << dp[j+1] << " ";
            }
            cout << endl;
        }
    }

    int res = 0;
    rep(i,dp.size()){
        res = max(res,dp.at(i));
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 7032
#include <cstdio>
#include <math.h>

using namespace std;

int main(void)
{
  int i, sum, dig;
  int a, b;

  while (scanf("%d %d", &a, &b) != EOF) {
    sum = a + b;
    dig = 1;
    for (i = 1; i < 7; i++) {
      if (sum - pow(10, i) < 0) break;
      dig++;
    }
    printf("%d\n", dig);
  }

  return 0;
}

Measured memory_bytes: 1072
import java.util.*;

class Main {
    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        final long A = Long.parseLong(sc.next());
        final long B = Long.parseLong(sc.next());
        final long K = Long.parseLong(sc.next());
        sc.close();

        long a = A;
        long b = B;
        long k = K;
        if (a>=k) {
            a -= k;
            k = 0;
        } else {
            k -= a;
            a = 0;
        }
        if (b>=k) {
            b -= k;
            k = 0;
        } else {
            k -= b;
            b = 0;
        }

        System.out.println(a + " " + b);
    }
}

Measured memory_bytes: 22740
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main(){
    int N;
    cin >> N;
    vector<int> ans(N + 1);
    int n = sqrt(N);
    for (int x = 1; x < n; x++){
        for (int y = 1; y < n; y++){
            for (int z = 1; z < n; z++){
                int a = (x + y + z)*(x + y + z) - (x*y + y*z + z*x);
                if(a >= 1 && a <= N) ans[a]++;
            }
        }
    }

    for (int i = 1; i <= N; i++){
        cout << ans[i] << endl;
    }
}

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

void main_()
{
    ll H, W, K;
    cin >> H >> W >> K;
    vector<ll> x;
    vector<ll> y;
    for (ll i = 0; i < H; i++) {
        string s;
        cin >> s;
        for (ll j = 0; j < W; j++) {
            if (s[j] == '#') {
                x.push_back(j + 1);
                y.push_back(i + 1);
            }
        }
    }

    vector<vector<ll>> cake(H + 2, vector<ll>(W + 2));
    for (ll i = 1; i <= H; ++i) {
        fill_n(begin(cake[i]) + 1, W, 1);
    }

    vector<vector<ll>> ichigo(H + 2, vector<ll>(W + 2));
    ichigo[y[0]][x[0]] = 1;

    auto ichigo_exists = [&ichigo](int y, int l, int r) {
        do {
            if (ichigo[y][l]) {
                return true;
            }
        } while (l++ < r);
        return false;
    };
    for (ll i = 1; i < K; ++i) {
        auto l = x[i];
        auto r = x[i];
        auto n = cake[y[i]][x[i]];
        while (cake[y[i]][l - 1] == n && !ichigo[y[i]][l - 1]) {
            l--;
        }
        while (cake[y[i]][r + 1] == n && !ichigo[y[i]][r + 1]) {
            r++;
        }
        auto u = y[i];
        auto d = y[i];
        while (cake[u - 1][x[i]] == n && !ichigo_exists(u - 1, l, r)) {
            u--;
        }
        while (cake[d + 1][x[i]] == n && !ichigo_exists(d + 1, l, r)) {
            d++;
        }
        for (ll yy = u; yy <= d; yy++) {
            for (ll xx = l; xx <= r; xx++) {
                cake[yy][xx] = i + 1;
            }
        }
        ichigo[y[i]][x[i]] = 1;
    }

    for (ll i = 1; i <= H; ++i) {
        for (ll j = 1; j <= W; ++j) {
            cout << cake[i][j] << " ";
        }
        cout << "\n";
    }
}
int main()
{
    cin.tie(nullptr);
    cout.tie(nullptr);
    ios_base::sync_with_stdio(false);
    main_();
    return 0;
}


Measured memory_bytes: 3692
#include<stdio.h>
int main()
{
  int d, n, i, m;
  scanf("%d %d", &d, &n);
  for(m = 1, i = 0; i < d; i++){
    m *= 100;
  }
  m *= (n<100 ? n : n+1);
  printf("%d\n", m);
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef vector<ll> vi;
typedef long double td;
typedef vector<td> vd;
typedef pair<ll,ll> ii;
typedef vector<ii> vii; typedef vector<bool> vb;
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define forr(i, a, b) for(ll i = ll(a); i < (ll)(b); i++)
#define forn(i, n) forr(i, 0, n)
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define DBG(x) cerr << #x << " = " << (x) << endl
#define show(v,n) cerr << #v << " = "; forn(i,n) cerr << v[i] << " "; cerr << endl;
#define esta(x,c) ((c).find(x) != (c).end())
#define RAYA cerr << "===============================" << endl
int MAXN = 500005;
int INF = (int)(1e9+7);
ll m = (ll)(1000000007);

ll dp[10005][105][2];
string pal;

ll funcion(int pos, int resto, int caso, int modu)
{	
	if(pos==-1 && resto == 0) return 1;
	else if(pos==-1) return 0;
	
	//DBG(pos); DBG(resto); DBG(caso); DBG(modu);
	
	if(dp[pos][resto][caso]!=-1) return dp[pos][resto][caso];
	
	dp[pos][resto][caso]=0;	
	int cota = (int)(pal[pos]-'0');
	
	//DBG(cota); RAYA;
	
	if(caso == 0)
	{
		// caso = 0 significa imponer limites
		forn(i,cota)
		{
			dp[pos][resto][caso]+=funcion(pos-1,(resto+modu-i%modu)%modu,1,modu);
			//DBG(pos-1); DBG((resto+modu-i)%modu); RAYA;
			dp[pos][resto][caso]%=m;
		}
		dp[pos][resto][caso]+=funcion(pos-1,(resto+modu-cota%modu)%modu,0,modu);
		dp[pos][resto][caso]%=m;
	}
	else
	{
		forn(i,10)
		{
			dp[pos][resto][caso]+=funcion(pos-1,(resto+modu-i%modu)%modu,1,modu);
			dp[pos][resto][caso]%=m;
		}
	}
	
	return dp[pos][resto][caso];
	
}
 
int main()
{ 	
	FIN;
	#ifdef input
		//freopen("T1.txt", "r", stdin);
	#endif
	
	int k;
	cin >> pal >> k;
	reverse(all(pal));
	forn(i,10005) forn(j,105) forn(t,2) dp[i][j][t]=-1;
	ll ans = funcion((int)(pal.size()-1),0,0,k); 
	ans+=m-1;
	cout << ans%m << "\n";
	
    return 0;
}



Measured memory_bytes: 21144
#include<bits/stdc++.h>
#define N 100010
using namespace std;
int n, m;
int a[N];
int f[N];
inline int Get(int u)
{
	return u == f[u] ? u : f[u] = Get(f[u]);
}
int main()
{
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; ++ i)
		scanf("%d", &a[i]);
	for(int i = 1; i <= n; ++ i)
		f[i] = i;
	while(m --){
		int u, v;
		scanf("%d%d", &u, &v);
		int fu = Get(u), fv = Get(v);
		if(fu != fv)
			f[fu] = fv;
	}
	int cnt = 0;
	for(int i = 1; i <= n; ++ i){
		int fu = Get(a[i]);
		int fv = Get(i);
		cnt += (fu == fv);
	}
	printf("%d", cnt);
	return 0;
}

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

void solve() {
	int k;
	int a, b;
	cin >> k >> a >> b;
	
	printf("%s\n", b / k - (a - 1) / k > 0 ? "OK" : "NG");
	
	
}

int main()
{
	int T = 1;
	//scanf("%d", &T);
	
	while(T--) {
		solve();
	}
}

Measured memory_bytes: 3636
// Sky's the limit :)
#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    
    int T = 1; 
    // cin >> T; 
    while (T--) {
        int n;
        cin >> n;
        int sum = 0;
        unordered_map<int, int> mp;
        for(int i = 0; i < n; i++) {
            int x;
            cin >> x;
            mp[x]++;
            sum += x;
        }

        int q;
        cin >> q;
        while(q--) {    
            int x, y;
            cin >> x >> y;

            sum += mp[x] * (y - x);
            mp[y] += mp[x];
            mp[x] = 0;
            cout << sum << '\n';
        }
        
    }
    
    return 0;
}



Measured memory_bytes: 6964
#include<bits/stdc++.h>
using namespace std;
int main()
{
  string S,T;
  cin>>S>>T;
  for(int i=0;i<S.length();i++)
    if(S[i]!=T[i])
    {
      puts("No");
      return 0;
    }
  puts("Yes");
  return 0;
}

Measured memory_bytes: 3624
#include<iostream>
#include<vector>

using namespace std;

int main()
{
	int N;
	scanf("%d", &N);
	int digital = N % 10;
	if(digital == 2 || digital == 4 || digital == 5 || digital == 7 || digital == 9)
		printf("hon\n");
	else if(digital == 0 || digital == 1 || digital == 6 || digital == 8)
		printf("pon\n");
	else if(digital == 3)
		printf("bon\n");
	return 0;
}

Measured memory_bytes: 3764
#!python3

LI = lambda: list(map(int, input().split()))

# input
S = input()

MOD = 10 ** 9 + 7


def main():
    n = len(S)
    m = 5
    w = []
    p = 1
    for i in range(n):
        s = S[-1 - i]
        if s == "?":
            w.append(p)
        else:
            m = (m - int(s) * p) % 13
        p = p * 10 % 13

    n = len(w)
    l1 = [0] * 13
    l1[0] = 1
    for i in range(1, n + 1):
        l2 = [0] * 13
        for j in range(10):
            x = w[i - 1] * j % 13
            for k in range(13):
                t = (x + k) % 13
                l2[t] += l1[k]
        l1 = [y % MOD for y in l2]
    
    ans = l1[m]
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 45552
// header {{{
using namespace std;

// C++
#include <algorithm>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>

#pragma GCC optimization_level 3

// util {{{
#define print(x)	        cout << (x)
#define printvec(x,y)       for(int i = 0;i < (y);i++)cout << (x).at(i) << " ";cout << endl
#define println(x)	        cout << (x) << endl
#define printn		        cout << endl
#define read(x)	            cin >> (x)
#define readvec(x,y)        for(int i = 0; i < (y);i++)cin >> (x).at(i)

#define rep(i, n)	        for(int i = 0; i < (int)(n); i++)
#define rep_1(i, n) 	    for(int i = 1; i <=(int)(n); i++)

#define all(x) 		        (x).begin(),(x).end()
#define vint                vector<int>
#define outif(x,y,z)        if(x) cout<<(y)<<endl; else cout<<(z)<<endl
#define loop 		        while(true)

// }}}

// init {{{
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;
// }}}

//--------------------------------------------------------------------

void solve() {
    int a,b,c;
    read(a);
    read(b);
    read(c);
    outif(a < b && b < c,"Yes","No");
}

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


Measured memory_bytes: 3136
#include<bits/stdc++.h>
using namespace std;
 
int main() {
  int n,a;
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> a;
    if(a%2!=0)	continue;
    else{
      if(a%3==0)	continue;
      else if(a%5==0)	continue;
      else{
        cout << "DENIED";
        return 0;
      }
    }
  }
  cout << "APPROVED";
  return 0;
}


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

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

signed main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int A, B;
	cin >> A >> B;

	if (A <= 5)
	{
		cout << 0 << endl;
	}
	else if (A <= 12)
	{
		cout << B / 2 << endl;
	}
	else
	{
		cout << B << endl;
	}

	return 0;
}

Measured memory_bytes: 256
void main()
{
    long h1, m1, h2, m2, k;
    rdVals(h1, m1, h2, m2, k);

    long t1 = 60 * h1 + m1, t2 = 60 * h2 + m2;

    max(0, t2-t1-k).writeln;
}

enum long mod = 10L^^9 + 7;
enum long inf = 1L << 60;
enum double eps = 1.0e-9;

T rdElem(T = long)()
if (!is(T == struct))
{
    return readln.chomp.to!T;
}

alias rdStr = rdElem!string;
alias rdDchar = rdElem!(dchar[]);

T rdElem(T)()
if (is(T == struct))
{
    T result;
    string[] input = rdRow!string;
    assert(T.tupleof.length == input.length);
    foreach (i, ref x; result.tupleof)
    {
        x = input[i].to!(typeof(x));
    }
    return result;
}

T[] rdRow(T = long)()
{
    return readln.split.to!(T[]);
}

T[] rdCol(T = long)(long col)
{
    return iota(col).map!(x => rdElem!T).array;
}

T[][] rdMat(T = long)(long col)
{
    return iota(col).map!(x => rdRow!T).array;
}

void rdVals(T...)(ref T data)
{
    string[] input = rdRow!string;
    assert(data.length == input.length);
    foreach (i, ref x; data)
    {
        x = input[i].to!(typeof(x));
    }
}

void wrMat(T = long)(T[][] mat)
{
    foreach (row; mat)
    {
        foreach (j, compo; row)
        {
            compo.write;
            if (j == row.length - 1) writeln;
            else " ".write;
        }
    }
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.mathspecial;
import std.traits;
import std.container;
import std.functional;
import std.typecons;
import std.ascii;
import std.uni;
import core.bitop;

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

//.define
// #define FILE_IN_OUT
#define RET(_x)                       return cout << (_x) << '\n', 0;
#define all(_obj)                     std::begin(_obj), std::end(_obj)
#define loop(_n)                      for (int i = 0; i < (_n); ++i)
#define ceilDiv(_dividend, _divider)  (((_dividend) - 1LL + (_divider)) / (_divider))
#define has(_obj, _val)               ((_obj).find(_val) != (_obj).end())
#define sz(_obj)                      static_cast<int>((_obj).size())
#ifdef SHJ_LOCAL
#define debug(_x)                     std::cerr << (#_x) << " = " << (_x) << '\n' << std::flush;
#else
#define debug(_x)                     {}
#endif
#define endl "\n"
template<typename Tp>
inline void outarr(Tp _begin, Tp _end, const char* _delim = " ") {
    for (Tp current = _begin; current != _end; ++current) {
        std::cout << *current << _delim;
    }
    std::cout << '\n';
}

//.constant
using ll  = long long;
using pii = std::pair<int, int>;
constexpr int INF = 0x3f3f3f3f;
constexpr int MOD = static_cast<const int>(1e9 + 7);

//.data
int arr[100000];
int dp[100005];

//.code
int main() {
#ifdef FILE_IN_OUT
    std::ifstream cin ("input.txt",  std::ios::in);
    std::ofstream cout("output.txt", std::ios::out);
#else
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
#endif

    int n;
    cin >> n;
    loop(n) {
        cin >> arr[i];
    }
    memset(dp, INF, sizeof(dp));
    dp[0] = 0;
    for (int i = 0; i < n; ++i) {
        dp[i + 1] = min(dp[i + 1], dp[i] + abs(arr[i + 1] - arr[i]));
        dp[i + 2] = min(dp[i + 2], dp[i] + abs(arr[i + 2] - arr[i]));
    }
    cout << dp[n - 1] << endl;

#ifdef FILE_IN_OUT
    cin.close();
    cout.close();
#endif
    return 0;
}


Measured memory_bytes: 1024
#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(){
  ll d, n;
  in2(d, n);
  if(d == 0)
    d = 1;
  else if(d == 1)
    d = 100;
  else
    d = 10000;
  if(n == 100)
    n++;
  out(d * n);
  memi;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;

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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##_end;++i)
#define eprintf(s...)  fprintf(stderr, s)

template<class T> inline void amin(T &x, const T &y) { if (y<x) x=y; }
template<class T> inline void amax(T &x, const T &y) { if (x<y) x=y; }

const char IMP[] = "Impossible";

int N, M, A[111];
VI O, E;

int main() {

    scanf("%d%d", &N, &M);
    REP (i, M) {
	scanf("%d", A+i);
	if (A[i] & 1) O.push_back(A[i]);
	else E.push_back(A[i]);
    }
    if (N < M) {
	puts(IMP);
	return 0;
    }

    VI a, b;

    if (O.size() == 0) {
	a = E;
	b = E;
	b[0]--;
	b.push_back(1);
    } else if (O.size() == 1u) {
	if (O[0] == 1) {
	    a = O; a.insert(a.end(), E.begin(), E.end());
	    b = E; b.push_back(O[0]);
	} else {
	    a = O; a.insert(a.end(), E.begin(), E.end());
	    b.push_back(O[0]-1);
	    b.insert(b.end(), E.begin(), E.end());
	    b.push_back(1);
	}
    } else if (O.size() == 2u) {
	a.push_back(O[0]);
	a.insert(a.end(), E.begin(), E.end());
	a.push_back(O[1]);
	b.push_back(O[0]+1);
	b.insert(b.end(), E.begin(), E.end());
	if (O[1] == 1) ;
	else b.push_back(O[1] - 1);
    } else {
	puts(IMP);
	return 0;
    }


    REP (i, a.size()) printf("%d%c", a[i], i==(int)a.size()-1? '\n': ' ');
    printf("%d\n", (int)b.size());
    REP (i, b.size()) printf("%d%c", b[i], i==(int)b.size()-1? '\n': ' ');


    return 0;
}



Measured memory_bytes: 256
import collections

n = int(input())
s=[]
for i in range(n):
    s.append(input())

c=collections.Counter(s)
r=c.most_common()

mx=r[0][1]
re=[]
for x, y in r:
    if y == mx:
        re.append(x)
    else:
        break
ans=sorted(re)
for a in ans:
    print(a)

Measured memory_bytes: 51520