akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

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

        int N = sc.nextInt();
        char[] cA = sc.next().toCharArray();

        for (int i = 0; i < cA.length; i++) cA[i] = (char) (((N + cA[i]) % 65 % 26 + 65));

        for (char c : cA) System.out.print(c);
    }
}

Measured memory_bytes: 23856
/*
auth - @sportykush
*/

#include <bits/stdc++.h>
using namespace std;
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; 
// using namespace __gnu_pbds;

typedef long long int ll;
typedef long double ld;

//#define mp make_pair
#define bug(v)                    cerr<<#v<<" = "<<(v)<<endl;
#define bug2(v1,v2)               cerr<<#v1<<" = "<<(v1)<< ' ' << #v2<<" = "<<(v2)<<endl;
#define ERASE(x)                  x.erase(unique(x.begin(),x.end()),x.end())
#define pb                        emplace_back
#define vii                       vector<int>
#define vll                       vector<ll>
#define vpll                      vector< pair <ll,ll> >
#define pll                       pair <ll,ll>
#define pii                       pair <int,int>
#define pq                        priority_queue< int >
#define khtm                      "\n"
#define F                         first
#define S                         second
#define fr(i,a,n)                 for(i=a;i<n;i++)
#define mem(arr,l)                memset(arr,l,sizeof arr)
#define ALL(x)                    x.begin(), x.end()
#define frr(i,a,n)                for(i=n-1;i>=a;i--)
#define fast                      ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define testcase                  ll T; cin>>T; while(T--)


const double pi = 3.14159265359;
const int MAX = 1e6 +2;
const ll inf =  1e18;
const int N = 1010;
//const ll mod = 998244353 ;
const ll mod = 1000000007;
inline ll add(ll a,ll b){a+=b;if(a>=mod)a-=mod;return a;}
inline ll mul(ll a,ll b){return (((a+mod)%mod)*(b+mod)%mod)%mod;}
inline ll power(ll a,ll b){ll rt=1;while(b>0){if(b&1)rt=mul(rt,a);a=mul(a,a);b>>=1;}return rt;}
inline ll modInverse(ll n, ll p){ return power(n, p-2)%p; }

/*
important builtin functions
__gcd(value1, value2)
__builtin_ffs(x)
  Number of leading zeroes: __builtin_clz(x)
  Number of trailing zeroes : __builtin_ctz(x)
  Number of set bits: __builtin_popcount(x)
*/
 
void stArt()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
}
void eNd()
{
	#ifndef ONLINE_JUDGE
  	cout<<"\nTime Elapsed : " << 1.0*clock() / CLOCKS_PER_SEC << " s";
  	#endif
}

//////////////////// start /////////////////////////////////
 

ll i,j,k,l,m,r,n;
ll a[MAX],b[MAX];


int main()
{
 
stArt();
fast
//cout << setprecision(15) << fixed;

	cin >> n >> m >> k;
	for(int i=0; i<n; ++i) {
		cin >> a[i+1];
		a[i+1]+=a[i];
	}
	for(int i=0; i<m; ++i) {
		cin >> b[i+1];
		b[i+1]+=b[i];
	}
	int ans=0;
	for(int i=0, j=m; i<=n; ++i) {
		if(a[i]>k)
			break;
		while(a[i]+b[j]>k)
			--j;
		ans=max(i+j, ans);
	}
	cout << ans;

eNd();
  return 0;
 
}


Measured memory_bytes: 6720
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
lis = [a, b, c, d, e]
for i in lis:
    for j in lis:
        dif = abs(i - j)
        if dif > k:
            print(":(")
            break
    else:
        continue
    break
else:
    print("Yay!")


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define ull unsigned long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

int main()
{
    int n;
    cin >> n;
    pair<int, int> a[n];
    REP(i, n){
        cin >> a[i].first;
        a[i].second = i+1;
    }
    SORT(a, n);
    REP(i, n){
        cout << a[i].second << " ";
    }
    cout << endl;
}


Measured memory_bytes: 1536
import math
import itertools

N,M,Q=map(int,input().split())
a=[0]*Q
b=[0]*Q
c=[0]*Q
d=[0]*Q
for i in range(Q):
  a[i],b[i],c[i],d[i] = map(int,input().split())


con=itertools.combinations_with_replacement(list(range(1,M+1)),N)

ls=list(con)

ans =[0]*len(ls)
k=0

for i in ls:
  for j in range(Q):
    if(i[ b[j]-1 ] - i[ a[j]-1 ]   == c[j] ):
      ans[k] += d[j]
  k += 1

print(max(ans))

Measured memory_bytes: 85560
import itertools
from operator import itemgetter
nums={}

while True:
    p,s=map(int,input().split(','))
    if(p==0 and s==0):break
    if not s in nums:
        nums[s]=[]
    nums[s].append(p)

while True:
    try:
        q=int(input())
        ans=len(nums)
        for ns in nums.items():
            if q in ns[1]:
                print(ans)
                break
            ans-=1

            

    except:
        break

Measured memory_bytes: 7568
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int mod=1e9+7;
int pw(int a,int t=mod-2){
	int x=1;
	while(t){
		if(t&1)x=x*a%mod;
		a=a*a%mod,t>>=1;
	}
	return x;
}
int32_t main(){
	if(fopen("input.txt", "r"))
		freopen("input.txt", "r", stdin),
		freopen("output.txt", "w", stdout);
	ios::sync_with_stdio(0),cin.tie(0);
	int n,sum=0;
	cin >> n;
	int a[n],v[n]={0},f=1;
	for(int i=0;i<n;i++)
		cin >> a[i];
	for(int i=1;i<n;i++)
		v[i]=(v[i-1]+pw(i))%mod,
		f=(f*i)%mod;
	for(int i=1;i<n;i++)
		sum=(sum+(v[i]*(a[i]-a[i-1]))%mod)%mod;
	cout << (f*sum)%mod;
}


Measured memory_bytes: 1792
from collections import deque
N = int(input())
table = [[] for i in range(N)]
for i in range(N-1):
  u,v,w = map(int, input().split())
  u -= 1
  v -= 1
  table[u].append((v,w))
  table[v].append((u,w))
dist = [-1]*N
dist[0] = 0
H = deque()
H.append(0)
while H:
  u = H.popleft()
  for v,w in table[u]:
    if dist[v] == -1:
      dist[v] = dist[u] if w%2 == 0 else 1 - dist[u]
      H.append(v)
for i in range(N):
  print(dist[i])

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

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

const int INT_INF = 2147483646;
const ll LL_INF = 9223372036854775807;
const double PI=3.1415926535897932;

bool SecondCompare(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second<b.second;
}
 
bool SecondCompareDes(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second>b.second;
}

ll minll(ll a, ll b){
    if(a >= b)  return b;
    else    return a;
}

ll maxll(ll a, ll b){
    if(a >= b)  return a;
    else    return b;
}

ll a,n;

int main(){
    cin >> n >> a; 
    
    n -= n/500 * 500;
    if(n <= a){
        cout << "Yes\n";
    }
    else{
        cout << "No\n";
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(x,to) for(int x=0;x<(to);x++)
#define FOR1(x,to) for(int x=1;x<(to);x++)

int bubblesort(int n,int a[]){
    int flag=1,res=0,i=0;
    while(flag){
        flag=0;
        for(int j=n-1;j>i;j--){
            if(a[j]<a[j-1]){
                swap(a[j],a[j-1]);
                flag=1;
                res++;
            }
        }
        i++;
    }
    return res;
}

int main()
{
    int n;cin>>n;
    int a[n];
    FOR(i,n){
        cin>>a[i];
    }
    int res=bubblesort(n,a);
    FOR(i,n){
        if(i>0) cout<<" ";
        cout<<a[i];
    }
    cout<<endl<<res<<endl;

}



Measured memory_bytes: 3076
#include <iostream>

using namespace std;
typedef long long ll;

int main(){
  int N;
  cin >> N;
  ll B[N-1];
  for (int i = 0; i < N - 1; i++){
    cin >> B[i];
  }
  
  ll ans = B[N-2] + B[0];
  for (int i = N - 2; i >= 1; i--){
    ans += min(B[i], B[i-1]);
  }

  printf("%lld\n", ans);
}


Measured memory_bytes: 3764
from collections import deque
import copy

N, K=map(int, input().split())
v =  deque(list(map(int, input().split())))
score = []
k = min(N,K)

for A in range(k + 1):
  for B in range(k - A + 1):
    V = copy.deepcopy(v)
    temochi = []
    #print(A,B)
    
    for _ in range(A):
      temochi.append(V.popleft())
    for _ in range(B):
      temochi.append(V.pop())
    for _ in range(K - A - B):
      if K - A - B == 0:
        break
        
      temochi.sort()
      if len(temochi)==0 or temochi[0] >= 0:
        break
      else:
        del temochi[0]
    #print(temochi)
    score.append(sum(temochi))
print(max(score))
        

Measured memory_bytes: 48876
n,k,q=map(int,input().split())
a=[int(input()) for i in range(q)]
p=[k-q]*n
for i in range(q):
   #q回の正解が出る
    r=a[i]-1
    p[r]=p[r]+1
    #正解したら１点多くなる
for i in range(n):
    if p[i]>0:
        print('Yes')
    else:
        print('No')

Measured memory_bytes: 56536
n = int(input())
A = list(map(int, input().split()))
s = sum(A)
x = n*(n+1)//2
if s%x:
  print("NO")
else:
  k = s // x
  D = [0]*n
  for i in range(n):
    D[i] = A[(i+1)%n] - A[i] - k
    if D[i] > 0 or D[i]%n:
      print("NO")
      break
  else:
    print("YES")

Measured memory_bytes: 14476
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
typedef vector<vector<P>> vvP;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

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

    vl a(n), b(n);
    ll suma = 0;
    rep(i, n) {
        cin >> a[i];
        suma += a[i];
    }
    ll ans = 0;
    vl d(n);
    ll sumb = 0;
    ll u = 0;
    rep(i, n) {
        cin >> b[i];
        sumb += b[i];
        if(a[i] >= b[i]) {
            d[i] = a[i] - b[i];
        }
        else {
            ans++;
            u += b[i] - a[i];
        }
    }
    sort(rall(d));

    if(suma < sumb) {
        out(-1);
        re0;
    }

    rep(i, n) {
        if(u <= 0) {
            break;
        }
        u -= d[i];
        ans++;
    }

    out(min(ans, n));
    re0;
}

Measured memory_bytes: 2560
#!/usr/bin/ruby
# encoding: utf-8

N = gets.to_i
S = gets.chomp
K = gets.to_i

c = S[K-1]
ans = Array.new

(0..N-1).each do |i|
  if S[i] == c then 
    ans[i] = c
  elsif
    ans[i] = '*'
  end
end

puts ans.join


Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b;
  int x;
  
  cin >> a >> b;
  if((a+b)%2 == 1){
    x = (a+b)/2 + 1;
  }else{
    x = (a+b)/2;
  }
  
  cout << x << endl;
}

Measured memory_bytes: 256
from collections import deque
import sys

n = int(input())
result = deque()
func = {'insert':result.appendleft,\
        'delete':result.remove,\
        'deleteFirst':result.popleft,\
        'deleteLast':result.pop}

for line in sys.stdin.readlines():
    c = line.split()
    if len(c) > 1:
        try:
            func[c[0]](int(c[1]))
        except:
            continue
    else:
        func[c[0]]()

print(*result)



Measured memory_bytes: 188508
import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		List<Integer> result = new ArrayList<Integer>();
		
		int T = stdIn.nextInt();
		for(int i = 0; i < T; i++){
			String str = stdIn.next();
			int[] data = new int[10];
			for(int j = 0; j < str.length(); j++){
				data[(int)(str.charAt(j)-'0')]++;
			}
			StringBuilder sb = new StringBuilder();
			for(int j = 9; j >= 0; j--){
				while( data[j]-- > 0 ){
					sb.append(Integer.toString(j));
				}
			}
			int max = Integer.parseInt(sb.toString());
			sb.reverse();	
			int min = Integer.parseInt(sb.toString());
			result.add(max-min);
		}
		for(Integer num : result){
			System.out.println(num);
		}
	}
}

Measured memory_bytes: 12000
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int lld;

const lld mod = 1e9+7;
const lld INF = 1e9;
//const lld MAXN = 1e9;

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

    n %= 500;

    if (n <= a)
    {
        cout << "Yes" << endl;
    }else
    {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <iostream>

int main(){
  using namespace std;
  int K,A,B;
  cin >> K >> A >> B;
  
  int c = A / K;
  int behind_A = K * c;
  int beyond_A = K * (c+1);
  bool flag;
    
  if (behind_A == A){
    flag = true;
  }
  else if ((beyond_A >= A) and (beyond_A <= B)){
    flag = true;
  }
  else{
    flag = false;
  }
  
  if (flag){
    cout << "OK" << endl;
  }
  else{
    cout << "NG" << endl;
  }
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define itn int
#define REP(i, n) for (int i = 0; i < n; i++)
#define IREP(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(a, b) for (int i = a; i < b + 1; i++)
#define all(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
typedef long long ll;

const ll INF = 1LL << 60;

int main(){
	int a,b;
    cin >> a >> b;
    if(a<b){
        REP(i,b){
            cout << a;
        }
        cout << endl;
    }
    else{
        REP(i,a){
            cout << b;
        }
        cout << endl;
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<sstream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<complex>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cassert>
using namespace std;

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define fr(i,c) for(__typeof(c.begin()) i=c.begin();i!=c.end();i++)
#define pb push_back
#define mp make_pair
#define all(c) c.begin(),c.end()
#define dbg(x) cerr<<#x<<" = "<<(x)<<endl

typedef vector<int> vi;
typedef pair<int,int> pi;
typedef long long ll;
const int inf=(int)1e9;
const double EPS=1e-9, INF=1e12;

int A,B,k,a[20],b[20],n,pw[20],ans;
void rec(int c,int borrow,int ig,int d){
	if(ig>k)return;
	if(c==n){
		ans=max(ans,d);
		return;
	}
	int k=a[c]-b[c]-borrow;
	rep(it,2){
		rec(c+1,k<0,ig,d+(k<0?k+10:k)*pw[c]);
		if(!borrow)break;
		k++; ig++;
	}
}
int main(){
	cin>>A>>B>>k;
	for(n=0;B;B/=10)b[n++]=B%10;
	for(n=0;A;A/=10)a[n++]=A%10;
	ans=0;
	pw[0]=1;
	rep(i,19)pw[i+1]=pw[i]*10;
	rec(0,0,0,0);
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 0
use rand::Rng;
fn main() {
    let start=std::time::Instant::now();
    proconio::input! {
        d: usize,
        c: [i64;26],
        s: [[i64;26];d],
    }
    let mut t=vec![0;d];
    let mut last=[0;26];
    for (i,t) in t.iter_mut().enumerate() {
        let mut m=std::i64::MIN;
        let mut k=0;
        for j in 0..26 {
            let p=last[j];
            let mut v=0;
            v+=s[i][j];
            last[j]=i+1;
            for (&c,&last) in c.iter().zip(last.iter()) {
                v-=c*(i+1-last)as i64;
            }
            if m<v {
                m=v;
                k=j;
            }
            last[j]=p;
        }
        last[k]=i+1;
        *t=k;
    }
    let mut v=vec![0;d];
    f(&c,&s,&t,0,&mut v);
    let mut rng = rand::thread_rng();
    while start.elapsed().as_secs_f64()<1.9 {
        let r: usize=rng.gen_range(0, d*26);
        let i=r/26;
        let q=r%26;
        let p=t[i];
        t[i]=q;
        let mut w=v.clone();
        f(&c,&s,&t,i,&mut w);
        if w>v {
            v=w;
        }
        else {
            t[i]=p;
        }
    }
    for t in t {
        println!("{}",t+1);
    }
}
fn f(c: &Vec<i64>, s: &Vec<Vec<i64>>, t: &Vec<usize>, b: usize, w: &mut Vec<i64>) -> i64 {
    let mut last=[0;26];
    let mut v=if b>0 {w[b-1]} else {0};
    for (j,(&t,w)) in t[b..].iter().zip(w[b..].iter_mut()).enumerate() {
        let i=j+b;
        v+=s[i][t];
        last[t]=i+1;
        for (&c,&last) in c.iter().zip(last.iter()) {
            v-=c*(i+1-last)as i64;
        }
        *w=v;
    }
    v
}

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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void solve() {
    ll D, T, S;
    cin >> D >> T >> S;
    if (T >= (D + S - 1) / S) {
        cout << "Yes" << '\n';
    } else {
        cout << "No" << '\n';
    }
}

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


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

using namespace std;
using ll = long long;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int c[5] = {0};
  for (int i = 0; i < 6; i++) {
    int a;
    cin >> a;
    c[a]++;
  }
  for (int i = 1; i <= 4; i++) {
    if (c[i] > 2) {
      cout << "NO" << '\n';
      return 0;
    }
  }
  cout << "YES" << '\n';
  return 0;
}


Measured memory_bytes: 256
//abc065_b Trained?


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

namespace
{
bool bFlag[ 100010 ];
int a[ 100010 ];
}

int main()
{
int i;
int N;
int iCnt;

	cin >> N;
	for( i = 1; i <= N; i++ )
	{
		cin >> a[ i ];
	}

	iCnt = 0;
	i = 1;
	while( ! bFlag[ i ] )
	{
		bFlag[ i ] = true;
		if( i == 2 )
		{
			cout << iCnt << endl;

			return 0;
		}

		iCnt++;
		i = a[ i ];
	}

	cout << - 1 << endl;

	return 0;
}






Measured memory_bytes: 768
#include<bits/stdc++.h>
#define MOD (1e9 + 7)
#define fi(i,a,b) for(ll i = a; i < b; i++)
#define fd(i,a,b) for(ll i = a; i >= b; i--)
#define vfi(v,i) for(auto i = v.begin(); i != v.end(); i++)
#define vfd(v,i) for(auto i = v.rbegin(); i != v.rend(); i++)
#define vi vector<int>
#define vll vector<ll>
#define pb push_back 

using namespace std;
typedef long long ll;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	ll n,k;
	cin>>n>>k;
	ll a[n+1];
	fi(i,1,n+1){
		cin>>a[i];
	}

	ll dp[n+1][k+1];

	dp[0][0] = 1;
	// fi(i,0,n+1) {
	// 	dp[i][0] = 0;
	// }

	fi(j,1,k+1) {
		dp[0][j] = 0;
	}

	fi(i,1,n+1) {

		ll sum[k+1];
		sum[0] = dp[i-1][0];
		// cout<<sum[0]<<' ';
		fi(j, 1, k+1) {
			// cout<<dp[i-1][j]<<' ';
			sum[j] = (sum[j-1] + dp[i-1][j]) % (ll)MOD;
		}

		// cout<<'\n';
		fi(j, 0, k+1) {
			ll add = sum[j];
			ll subtract = min(j,a[i]);
			if(subtract != j) {
				add = (add- sum[j-subtract-1] + (ll)MOD ) % (ll)MOD;
			}
			dp[i][j] = add;

		}

	}

	// fi(i,0,n+1) {
	// 	fi(j,0,k+1) {
	// 		cout<<dp[i][j]<<" ";
	// 	}
	// 	cout<<'\n';
	// }

	cout<<dp[n][k]<<'\n';

	return 0;
}


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

int main(){
    ll a,b;cin>>a>>b;
    b++;
    if(b%2==0){
        if((b/2)%2==0) b=0;
        else b=1;
    }
    else{
        if((b/2)%2==0) b--;
    }
    if(a%2==0){
        if((a/2)%2==0) a=0;
        else a=1;
    }
    else{
        if((a/2)%2==0) a--;
    }
    ll c=a^b;
    cout<<c<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n,x,countera,counterb,counter,subcounter,numbercounter,lapcounter;
  subcounter = 0;
  countera = 0;
  counterb = 0;
  lapcounter = 0;
  vector<int> vecx(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    vecx.push_back(x);
  }

  for (int j = 0; j < n; j++) {
    lapcounter++;
    subcounter = 0;
    for (int i = 0; i < n; i++) {
      counter = vecx.at(i);
      if (counter > subcounter) {
        numbercounter = i;
        subcounter = counter;
      }
    }
    if (lapcounter % 2 == 1) {
      countera = countera + subcounter;
    } else {
      counterb = counterb + subcounter;
    }
    vecx.at(numbercounter) = 0;
  }
  cout << countera-counterb;
    
    
    
}

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

using namespace std;

int N;
pair<int, int> A[5000];
long long dp1[5000][2505];
long long dp2[5000][2505];

long long prefix(int pos, int typeA)
{
    if(pos==-1)
        return 0;
    long long& ret=dp1[pos][typeA];
    if(ret!=-1)
        return ret;
    ret=0x3f3f3f3f3f3f3f3fLL;
    int typeB=pos-typeA+1;
    int len=A[pos].first+A[pos].second;
    if(typeA>0)
        ret=min(ret, 1LL*len*(typeA-1)+A[pos].second+prefix(pos-1, typeA-1));
    if(typeB>0)
        ret=min(ret, 1LL*len*(typeB-1)+A[pos].first+prefix(pos-1, typeA));
    return ret;
}

long long suffix1(int pos, int typeA)
{
    if(pos==N)
    {
        if(typeA==(N-1)/2)
            return 0;
        return 0x3f3f3f3f3f3f3f3fLL;
    }
    if(typeA>(N-1)/2)
        return 0x3f3f3f3f3f3f3f3fLL;
    long long& ret=dp2[pos][typeA];
    if(ret!=-1)
        return ret;
    ret=0x3f3f3f3f3f3f3f3fLL;
    int typeB=pos-typeA-1;
    int len=A[pos].first+A[pos].second;
    ret=min(ret, 1LL*len*typeA+A[pos].second+suffix1(pos+1, typeA+1));
    ret=min(ret, 1LL*len*typeB+A[pos].first+suffix1(pos+1, typeA));
    return ret;
}

long long suffix2(int pos, int typeA)
{
    if(pos==N)
    {
        if(typeA==(N-1)/2+1)
            return 0;
        return 0x3f3f3f3f3f3f3f3fLL;
    }
    if(typeA>(N-1)/2+1)
        return 0x3f3f3f3f3f3f3f3fLL;
    long long& ret=dp2[pos][typeA];
    if(ret!=-1)
        return ret;
    ret=0x3f3f3f3f3f3f3f3fLL;
    int typeB=pos-typeA-1;
    int len=A[pos].first+A[pos].second;
    ret=min(ret, 1LL*len*typeA+A[pos].second+suffix2(pos+1, typeA+1));
    ret=min(ret, 1LL*len*typeB+A[pos].first+suffix2(pos+1, typeA));
    return ret;
}

int main()
{
    scanf("%d", &N);
    for(int i=0; i<N; i++)
        scanf("%d%d", &A[i].first, &A[i].second);
    sort(A, A+N, [](const pair<int, int>& a, const pair<int, int>& b) {
        return a.first+a.second>b.first+b.second;
    });
    memset(dp1, -1, sizeof dp1);
    memset(dp2, -1, sizeof dp2);
    long long ans=0x3f3f3f3f3f3f3f3fLL;
    for(int i=0; i<N; i++)
    {
        for(int j=0; j<=min((N-1)/2, i); j++)
            ans=min(ans, 1LL*A[i].first*((N-1)/2)+1LL*A[i].second*(N-1-(N-1)/2)+
                         prefix(i-1, j)+suffix1(i+1, j));
    }
    memset(dp2, -1, sizeof dp2);
    for(int i=0; i<N; i++)
    {
        for(int j=0; j<=min((N-1)/2+1, i); j++)
            ans=min(ans, 1LL*A[i].first*((N-1)/2+1)+1LL*A[i].second*(N-1-((N-1)/2+1))+
                         prefix(i-1, j)+suffix2(i+1, j));
    }
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 196480
#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
short dp[maxn][maxn][maxn][maxn];
short row[maxn][maxn], col[maxn][maxn];
char mp[maxn][maxn];

void cmax(short &a, short b){
	if(a < b) a = b;
}

void __main(){
	int n, m, x, y;
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; i++){
		scanf("%s", mp[i] + 1);
		for(int j = 1; j <= m; j++){
			if(mp[i][j] == 'E'){
				x = i;
				y = j;
			}
		}
	}
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= m; j++){
			row[i][j] = row[i][j - 1] + (mp[i][j] == 'o');
			col[i][j] = col[i - 1][j] + (mp[i][j] == 'o');
		}
	}
	int L = y - 1, R = m - y, U = x - 1, D = n - x;
	memset(dp, -1, sizeof dp);
	dp[0][0][0][0] = 0;
	short ans = 0;
	for(int l = 0; l <= L; l++){
		for(int u = 0; u <= U; u++){
			for(int r = 0; r <= R; r++){
				for(int d = 0; d <= D; d++) if(dp[l][u][r][d] != -1){
					cmax(ans, dp[l][u][r][d]);
					int tx1 = min(u, U - d), tx2 = min(d, D - u);
					int ty1 = min(l, L - r), ty2 = min(r, R - l);
					if(l + 1 <= L && l + r < L){
						cmax(dp[l + 1][u][r][d], dp[l][u][r][d] + col[x + tx2][y - l - 1] - col[x - tx1 - 1][y - l - 1]);
					}
					if(u + 1 <= U && u + d < U){
						cmax(dp[l][u + 1][r][d], dp[l][u][r][d] + row[x - u - 1][y + ty2] - row[x - u - 1][y - ty1 - 1]);
					}
					if(r + 1 <= R && l + r < R){
						cmax(dp[l][u][r + 1][d], dp[l][u][r][d] + col[x + tx2][y + r + 1] - col[x - tx1 - 1][y + r + 1]);
					}
					if(d + 1 <= D && u + d < D){
						cmax(dp[l][u][r][d + 1], dp[l][u][r][d] + row[x + d + 1][y + ty2] - row[x + d + 1][y - ty1 - 1]);
					}
				}
			}
		}
	}
	printf("%d\n", (int)ans);
}

int main(){
    __main();
    return 0;
}
/*
3 4
...o
...o
Eooo


3 3
o.o
.Eo
ooo

2 2
E.
..

3 4
o...
o...
oooE

5 11
ooo.ooo.ooo
o.o.o...o..
ooo.oE..o..
o.o.o.o.o..
o.o.ooo.ooo
*/


Measured memory_bytes: 237824
#include<bits/stdc++.h>
using namespace std;
#define PI 3.14159265359
int main(){
    long long int N; cin>>N;
    long long int ans;
    if(N%2==0){
        ans=(N-2)/2;
    }
    else{
        ans=N/2;
    }
    cout<<ans;
    return 0;
}

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

int f(int x,int y){
	if(y<10)return x*10+y;
	return x*100+y;
}

int main(){
while(1){
	int n,k,c[100],ans=1;
	vector<int> sum;
	scanf("%d%d",&n,&k);
	if(n==0&&k==0)break;
	for(int i=0;i<n;i++)scanf("%d",&c[i]);
	int a=0;
	for(int i=0;i<n;i++){
		int a0=c[i];
		for(int j=0;j<n;j++){
			if(j!=i){
				int a1=f(a0,c[j]);
				if(k==2)sum.push_back(a1);
				else {
					for(int l=0;l<n;l++){
						if(l!=j&&l!=i){
							int a2=f(a1,c[l]);
							if(k==3)sum.push_back(a2);
							else{
								for(int m=0;m<n;m++){
									if(m!=l&&m!=j&&m!=i){
										int a3=f(a2,c[m]);
										sum.push_back(a3);
									}
								}
							}
						}
					}
				}
			}
		}
	}
	sort(sum.begin(),sum.end());
	int s=sum.size();
	for(int i=1;i<s;i++){
		if(sum[i]!=sum[i-1])ans++;
	}
	printf("%d\n",ans);
}
}

Measured memory_bytes: 1252
#include <iostream>
#include <vector>
#include <queue>
#include <cstdlib>
#include <math.h>

typedef long long ll;
using namespace std;

void disp(vector<vector<int>> v,int xsize, int ysize)
{
	for(int i = 0; i < xsize; i++){
		for(int j = 0; j < ysize; j++){
			cout << v.at(i).at(j) << " ";
		}
		cout << endl;
	}
	cout << endl;
}

int main()
{
	string s,t;
	cin >> s ; 
	cin >> t ;

	int slen = s.size();
	int tlen = t.size();

	vector<vector<int>> dp(slen+1,vector<int>(tlen+1,0));
	//disp( dp, slen+1, tlen+1);

	for(int sp = 1; sp <= slen; sp++){
		for(int tp = 1; tp <= tlen; tp++){
			if(s[sp-1] == t[tp-1]){
				dp[sp][tp] = max(dp[sp][tp],dp[sp-1][tp-1]+1);
			}
			dp[sp][tp] = max(dp[sp][tp],dp[sp-1][tp]);
			dp[sp][tp] = max(dp[sp][tp],dp[sp][tp-1]);
		}
	}
	//disp( dp, slen+1, tlen+1);

	int sp = slen;
	int tp = tlen;
	string ans = "";
	while( sp > 0 && tp > 0){
		if( dp[sp][tp] == dp[sp-1][tp] ){
			sp-- ;
		}else if( dp[sp][tp] == dp[sp][tp-1]){
			tp-- ;
		}else if( dp[sp][tp] == dp[sp-1][tp-1]+1){
			ans = s[sp-1] + ans ;
			sp--;
			tp--;
		}
	}
	cout << ans << endl;
}


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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i=0; i<N; i++) {
    cin >> A[i];
  }
  sort(A.begin(), A.end());
  cout << A[N-1]-A[0] << endl;
}


Measured memory_bytes: 3632
#include <stdio.h>
#include <string.h>

int main() {
    char s[100001];
    scanf("%s", s);
    long l = strlen(s);
    while(1) {
        if (strcmp((s+l-5), "dream") == 0) {
            s[l-5] = '\0';
            l -= 5;
        } else if (strcmp((s+l-7), "dreamer") == 0) {
            s[l-7] = '\0';
            l -= 7;
        } else if (strcmp((s+l-5), "erase") == 0) {
            s[l-5] = '\0';
            l -= 5;
        } else if (strcmp((s+l-6), "eraser") == 0) {
            s[l-6] = '\0';
            l -= 6;
        } else 
            break;
    }
    if (l)
        puts("NO");
    else 
        puts("YES");
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>

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

using namespace std;

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

int n,B[8][8];
bool dfs(int y,int x,bool vis[8][8],int sum,int type){
	if(type==0){
		vis[y][x]=true;
		if(dfs(y,x,vis,B[y][x],1)) return true;
		vis[y][x]=false;
		return false;
	}
	else{
		if(sum>0) return false;
		if(sum==0){
			int yy=-1,xx;
			bool end=true;
			rep(i,n) rep(j,n) {
				if(!vis[i][j]) end=false;
				if(!vis[i][j] && B[i][j]<0){
					if(yy==-1 || B[i][j]<B[yy][xx]) yy=i, xx=j;
				}
			}
			if(end) return true;
			return dfs(yy,xx,vis,0,0);
		}
		rep(k,4){
			int yy=y+dy[k],xx=x+dx[k];
			if(0<=yy && yy<n && 0<=xx && xx<n && !vis[yy][xx] && B[yy][xx]>0){
				vis[yy][xx]=true;
				if(dfs(yy,xx,vis,sum+B[yy][xx],1)) return true;
				vis[yy][xx]=false;
			}
		}
		return false;
	}
}

int main(){
	for(;scanf("%d",&n),n;){
		int sy=-1,sx;
		rep(i,n) rep(j,n) {
			scanf("%d",B[i]+j);
			if(B[i][j]<0){
				if(sy==-1 || B[i][j]<B[sy][sx]) sy=i, sx=j;
			}
		}

		bool vis[8][8]={};
		puts(dfs(sy,sx,vis,0,0)?"YES":"NO");
	}

	return 0;
}

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

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = std::int64_t;
using P = std::tuple<int,int>;

constexpr ll MOD = 998244353;
int N, D[100100];

template <typename T>
T mod_expt(T a, std::int64_t n, T mod){
    T power {1};
    while(n > 0){
        if(n & 1){power = power * a % mod;}
        a = a * a % mod;
        n >>= 1;
    }
    return power;
}

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

  std::cin >> N;

  for(int i=0;i<N;++i){
      std::cin >> D[i];
  }

  if(D[0] != 0){
      std::cout << 0 << std::endl;
      return 0;      
  }

  std::sort(D, D + N);

  if(N >= 2 && D[1] == 0){
      std::cout << 0 << std::endl;
      return 0;
  }

  int mx = D[N-1];
  for(int i=0;i<=mx;++i){
      unless(std::binary_search(D, D + N, i)){
          std::cout << 0 << std::endl;
          return 0;
      }
  }

  ll res = 1, n = 1;

  for(int i=0,j=0;i<N;i=j){
      while(j < N && D[j] == D[i]){
          j += 1;
      }

      ll m = j - i;
      res = res * mod_expt<ll>(n, m, MOD) % MOD;

      n = m;
  }

  std::cout << res << std::endl;
}


Measured memory_bytes: 640
#ifndef DEBUG 
	#pragma GCC optimize ("Ofast")
#endif
#include <bits/stdc++.h>
using namespace std;

#define hfor(var, s, e) for(int var=s; int(s)<=var && var<int(e); ++var)//half-opened range
#define hfori(var, s, e) for(int var=e-1; int(s)<=var && var<int(e); --var)//inversion
#define hforo(var, s, e) int var=s; for(; int(s)<=var && var<int(e); ++var)//out declaration
#define hforoi(var, s, e) int var=e-1; for(; int(s)<=var && var<int(e); --var)
#define cfor(var, s, e) hfor(var, s, (e)+1)//closed range
#define cfori(var, s, e) hfori(var, s, (e)+1)
#define cforo(var, s, e) hforo(var, s, (e)+1)
#define cforoi(var, s, e) hforoi(var, s, (e)+1)
#define rep(x) hfor(repi,0,x)
#define all(x) x.begin(),x.end()
#define sum_in(s,e) accumulate(s,e,0ll)
#define mri(it) make_reverse_iterator(it)//*mri(it) == *prev(it)
#define gcd __gcd
template<typename C, typename RI> RI rerase(C& c, RI ri){return next(mri(c.erase(prev(ri.base()))));}
template<typename T> constexpr T inf() { return numeric_limits<T>::max() / 2; }
using f64 = double;using i64=long long;using u64=unsigned long long;
const f64 pi=acos(-1), eps=1e-12;
const int prime=998244353;//1073741783 int(2e9+11) int(1e9+9)
const int dirs[4][2]={{0,1},{1,0},{0,-1},{-1,0}};//r, cw
const int mod=int(1e9+7);

auto _dummy=(ios::sync_with_stdio(0), cin.tie(0), cout.tie(0),
(cout<<fixed<<setprecision(11)), srand((int)time(0)), 0);
#define endl '\n'//not interactive?
//#define int i64//overflow?

struct Q{
	int s, e, i;
};

const int N=5e5;

signed main(){
	int n,m;
	cin>>n>>m;
	int a[N];
	hfor(i,0,n)
		cin>>a[i];
	
	int bsz=1000;	
	
	vector<Q> v[1000];
	hfor(i,0,m){
		int s,e;
		cin>>s>>e;
		s--;
		v[s/bsz].push_back({s,e,i});
	}
	hfor(i,0,1000)
		sort(all(v[i]), [](auto a, auto b){return a.e<b.e;});
	vector<pair<int,int>> ans;
	hfor(i,0,1000){
		if(v[i].empty())
			continue;
		int buf[N+1]={0,};
		int cnt=0;
		int normalized_s=v[i].front().s/bsz*bsz;
		int j=normalized_s;
		for(auto k:v[i]){
			while(j<k.e)
				cnt+=!buf[a[j++]]++;
			hfor(l, normalized_s, k.s)
				cnt-=!--buf[a[l]];
			ans.push_back({k.i, cnt});
			hfor(l, normalized_s, k.s)
				cnt+=!buf[a[l]]++;
		}
	}
	sort(all(ans));
	for(auto i:ans)
		cout<<i.second<<endl;
	
	return 0;
}


Measured memory_bytes: 19988
/* [Template].cpp 
Example code to use when starting new code. This particular problem was problem 
977A_Wrong_Subtraction from CodeForces

Compile: g++  -o B.exe B.cpp 
Execute: ./B
*/ 

#include <cstdio>
#include <iostream>
#include <cmath> 
#include <limits> 
#include <iomanip>
#include <cstring> 
#include <bits/stdc++.h>
#include <string>  
using namespace std;

int main() { 	
	int n, a, result = 0; 
	
	cin >> n; 
	for(int i = 1; i <= n; i++) {
		cin >> a; 
		if(i % 2 == 1 && a % 2 == 1)
			result++; 
	}
	
	cout << result << endl; 
	
	return 0; 
} 


Measured memory_bytes: 3588
import sys


def judge(s):
    if s[:6] == t4:
        s2 = s[6:]
    elif s[:5] == t1 or s[:5] == t3:
        s2 = s[5:]
    elif s[:7] == t2:
        s2 = s[7:]
    else:
        s2 = "AAAAA"
    return s2


s = input()
s = s[::-1]

t1 = "maerd"
t2 = "remaerd"
t3 = "esare"
t4 = "resare"

for i in range(100000):
    length = len(s)
    if length == 5 or length == 6 or length == 7:
        if s == t1 or s == t2 or s == t3 or s == t4:
            print("YES")
            sys.exit()
        else:
            print("NO")
            sys.exit()

    ss = judge(s)
    if 0 == len(ss):
        print("YES")
        sys.exit()
    s = ss


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

#define fi first
#define se second
#define all(x) x.begin(), x.end()
using namespace std;
using ull = unsigned long long;
using ll = long long;
constexpr int I_INF = INT_MAX;
constexpr ll LL_INF = LLONG_MAX;
const long double PI = (acos(-1));
const ull MOD = 1000000007;


struct __INIT {
    __INIT() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
    }
} __init;

int main(){
    int N, M;
    cin >> N >> M;
    map<int, int> ship_go;
    map<int, int> ship_back;
    for(int i = 0; i < M; i++){
        int a, b;
        cin >> a >> b;
        if(a == 1) ship_go[b] = 1;
        if(b == N) ship_back[a] = N;
    }
    bool exist = false;
    for(auto p : ship_go){
        if(ship_go[p.fi] == 1 and ship_back[p.fi] == N){
            exist = true;
            break;
        }
    }
    if(exist) puts("POSSIBLE");
    else puts("IMPOSSIBLE");
}

Measured memory_bytes: 14336
#include <iostream>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
long long n;
vector<vector<long long>> BIT(30, vector<long long>(500050));
void add(long long c,long long i, long long x) {
	while (i <= n) {
		BIT[c][i] += x;
		i += i & -i;
	}
}
long long csum(long long c,long long i) {
	long long count = 0;
	while (i > 0) {
		count += BIT[c][i];
		i -= i & -i;
	}
	return count;
}
long long sum(long long c,long long l, long long r) {
	return csum(c,r) - csum(c,l - 1);
}
int main() {
	cin >> n;
	string s;
	cin >> s;
	for (int i = 0; i < n; i++) {
		long long c = int(s[i] - 'a');
		add(c, i + 1, 1);
	}
	long long q;
	cin >> q;
	for (int i = 0; i < q; i++) {
		int b;
		cin >> b;
		if (b == 1) {
			long long I;
			char h;
			cin >> I >> h;
			long long c = int(s[I - 1] - 'a');
			add(c, I, -1);
			c = int(h - 'a');
			add(c, I, 1);
			s[I - 1] = h;
		}
		else {
			long long l, r;
			cin >> l >> r;
			long long ans = 0;
			for (int i = 0; i < 26; i++) {
				long long co = sum(i, l, r);
				if (co != 0) {
					ans++;
				}
			}
			cout << ans << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 124212
#include <iostream>  
#include <cstdio>  
#include <cstring>  
#include <algorithm>  
#include <cmath>
#include <cstdlib>
#include <map>

using namespace std;  
typedef long long ll;
int main()
{
	int a, b, c, d;
	while(~scanf("%d %d %d %d", &a, &b, &c,&d))
	{
		int x = (a + b),y = (c + d);
		if(x > y)
			printf("Left\n");
		else if(x < y)
			printf("Right\n");
		else
			printf("Balanced\n");
	}
}
	

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

int main() {
	long long N;cin>>N;
	long long ar [N];
	for(int i=0;i<N;i++)
	cin>>ar[i];
	long long dp[N]={0};
	dp[0]=0;
	dp[1]=abs(ar[0]-ar[1]) ;
	if(N==2)
	{cout<< dp[1]<<endl;return 0;}
	for(int i=2;i<N;i++)
	{
		dp[i]=min(dp[i-1]+abs(ar[i]-ar[i-1]),dp[i-2]+abs(ar[i]-ar[i-2]));
	
	}
	cout<<dp[N-1]<<endl;
	
	return 0;
}

Measured memory_bytes: 1792
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using db = double;
using ld = long double;
template<typename T> using V = vector<T>;
template<typename T> using VV = vector<vector<T>>;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,a,n) for(ll i=a;i<(ll)(n);++i)
#define repr(i,a,n) for(ll i=n-1;(ll)a<=i;--i)
#define ENDL '\n'
typedef pair<int,int> Pi;
typedef pair<ll,ll> PL;
constexpr ll mod = 1000000007; // 998244353;
constexpr ll INF = 1000000099;
constexpr ll LINF = (ll)(1e18 +99);
const ld PI = acos((ld)-1);
const vector<ll> dx={-1,1,0,0},dy={0,0,-1,1};
template<typename T,typename U> inline bool chmin(T& t, const U& u){if(t>u){t=u;return 1;}return 0;}
template<typename T,typename U> inline bool chmax(T& t, const U& u){if(t<u){t=u;return 1;}return 0;}
template<typename T> inline T gcd(T a,T b){return b?gcd(b,a%b):a;}

template<typename T,typename Y> inline T mpow(T a, Y n) {
  T res = 1;
  for(;n;n>>=1) {
    if (n & 1) res = res * a;
    a = a * a;
  }
  return res;
}

template<typename T,typename Y>
ostream& operator<<(ostream& os,const pair<T,Y>& p){
  return os<<"{"<<p.fs<<","<<p.sc<<"}";
}
template<typename T> ostream& operator<<(ostream& os,const V<T>& v){
  os<<"{";
  for(auto e:v)os<<e<<",";
  return os<<"}";
}
template<typename ...Args>
void debug(Args&... args){
  for(auto const& x:{args...}){
    cerr<<x<<' ';
  }
  cerr<<ENDL;
}



signed main(){
  cin.tie(0);cerr.tie(0);ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);
  //string s,t;cin>>s>>t;

  ll d,t,s;cin>>d>>t>>s;

  if(d<=s*t)cout<<"Yes"<<ENDL;
  else cout<<"No"<<ENDL;


}
//! ( . _ . ) ! 
//CHECK overflow,vector_size,what to output?

Measured memory_bytes: 3636
#include <iostream>
#include <algorithm>
using namespace std;
const int maxn = 1e6+5;
long long arr[maxn];
bool com(int a,int b){
    return a>b;
}
int main(){
    int a,b,c,i,n;
    cin>>n;
    long long s;
    for(i = 0;i < n;i++){
        cin>>arr[i];
    }
    sort(arr,arr+n,com);
    int j=-1,k=-1;
    for(i = 0;i < n-1;i++){
        if(j!=-1&&arr[i]==arr[i+1]){
            k = i;
        }
        if(arr[i]==arr[i+1]&&k==-1){
            j = i;
            i++;
        }
        if(j!=-1&&k!=-1){
            break;
        }
    }
    if(j==-1||k==-1){
        cout<<0;
    }
    else{
        s = arr[j]*arr[k];
        cout<<s;
    }
}


Measured memory_bytes: 1024
#include <algorithm>
#include <vector>
#include <string>
#include <ctype.h>
#include <set>
#include <map>
#include<cstdio>
#include<queue>
#include<cstdlib>
#include<time.h>
#include<string>
#include<stack>
#include<cmath>
#include<iostream>
#include<cstring>
#include<complex>
#include<bitset>
#include<tr1/unordered_set>
#include<tr1/unordered_map>


#define FOR(i,j,k) for(int i=j;i<k;i++)
#define FORD(i,j,k) for(int i=j;i>=k;i--)
#define ll long long
//Make sure no overflow problems
//#define int long long
#define pii  pair<int, int>
#define vi vector<int >
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define VAR(i,n) __typeof(n) i = (n)
#define FOREACH(i,c) for(VAR(i,(c).begin());i!=(c).end();i++)
#define FORDEACH(i,c) for( VAR(i,(c).rbegin()),i!=(c).rend();i++)
#define REP(i,n) FOR(i,0,n)
#define ld long double
const int INF = 1e9+7;
const long long INFLL = (ll)INF * (ll)INF;
const ld EPS = 10e-9;

using namespace std;

#pragma GCC optimize ("Ofast")
static auto _ = [] { std::ios::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0); std::cerr.tie(0); return 0; } ();

class TrieNode{
    public:
    bool isword;
    char c;
    map<char,TrieNode*> m;
    string word;
    public:
    TrieNode(){}
    TrieNode(char ch){
        c=ch;
        isword=false;
    }
};

void insert(TrieNode* root,string word){
    TrieNode* temp=root;
    for(char c:word){
        if(temp->m.find(c)==temp->m.end())
            temp->m[c]=new TrieNode(c);
        temp=temp->m[c];
    }
    temp->isword=true;
    temp->word=word;
}



int main() {
    long long n,k;
    cin>>n>>k;
    long long x,y;
    int count=0;
    for(int i=0;i<n;i++){
        cin>>x>>y;
        if((x*x+y*y)<=k*k)
            count++;
    }
    cout<<count;
    return 0;
}




Measured memory_bytes: 3652
using System;

class main
{
    public static int n = 1000001;
    static void Main()
    {
        string s;
        int c, q;
        bool[] p = new bool[n];
        p[0] = p[1] = false;
        for (int i = 2; i < n; ++i)
            p[i] = true;
        for (int i = 2; i < n; ++i)
            if (p[i])
                for (int j = i * 2; j < n; j += i)
                    p[j] = false;
        while ((s = Console.ReadLine()) != null){
                c = int.Parse(s);
                q = 0;
                for (int i = 2; i <= c; ++i)
                    if (p[i]) ++q;
                Console.WriteLine("{0}", q);
        }    
    }
}

Measured memory_bytes: 6604
#include<bits/stdc++.h>
using namespace std;
const int MOD = (int) 1e9 + 7;
const int INF = (int) 1e9+21;
const long long LINF = (long long) 1e18;
const long double PI = 2 * acos((long double)0);
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
#define Mahmud main()
#define endl "\n"
#define MAX(a,b) a = max(a,b)
#define MIN(a,b) a = min(a,b)
#define SQR(x) ((LL)(x) * (x))
#define RESET(a,b) memset(a,b,sizeof(a))
#define alla(arr,n) arr,arr+n
#define sz(x) ((int)(x).size())
#define all(x) x.begin(),x.end()
#define pb push_back
///Debug
#define dbg1(x) std::cerr<<#x<<"="<<(x)<<endl;
#define dbg2(x,y) std::cerr<<#x<<"="<<(x)<<','<<#y<<"="<<(y)<<endl;
#define dbg3(x,y,z) std::cerr<<#x<<"="<<(x)<<','<<#y<<"="<<(y)<<','<<#z<<"="<<(z)<<endl;
#define dbgArr(arr,n) cerr<<#arr<<"=["; printArray(arr,n,0,93); cerr<<endl;
///traversing
#define rep(n) for(int i=0;i<n;++i)
#define trv(i,t) for(__typeof(t.begin()) i=t.begin();i!=t.end();++i)
///necessary functions
inline ll Int()
{
    ll _x=0,_tmp=1;
    char _tc=getchar();
    while( (_tc<'0'||_tc>'9')&&_tc!='-' ) _tc=getchar();
    if( _tc == '-' ) _tc=getchar(), _tmp = -1;
    while(_tc>='0'&&_tc<='9') _x*=10,_x+=(_tc-'0'),_tc=getchar();
    return _x*_tmp;
}
inline long double Double()
{
    long double d;
    scanf("%Lf",&d);
    return d;
}
ll lcm(ll a,ll b)
{
    return a/__gcd(a,b)*b;
}
int ton(string x)
{
    int y;
    std::istringstream ss(x);
    ss >> y;
    return y;
}
template<typename T>
string tostring(T x)
{
    ostringstream ss;
    ss << x ;
    return ss.str();
}

///Current Code vars
#define N 100010
long long n,k,c,d;
int arr[N+1],brr[N+1];
///Current Code functions

string s;

void solve()
{
    c = Int();
    d = Int();
    ll x = c;
    ll ans = 0;
    while(x<=d)
    {
        x *= 2;
        ans++;
    }
    cout<<ans<<endl;
}

int Mahmud
{
    // ios_base::sync_with_stdio(0); //cin.tie(0);
  //#ifdef _LOCAL_
    //freopen("in", "r", stdin);
    // freopen("out", "w", stdout);
  //while(1)
    solve();
  //#ifdef _LOCAL_
    //printf("\nTime elapsed: %dms", 1000 * clock() / CLOCKS_PER_SEC);
  //#endif
    return 0;
}


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

#define step(i, s, n, d) for(int i=s; i<n; i+=d)
#define FOR(i,s,n) step(i,s,n,1)
#define rep(i,n) FOR(i,0,n)
#define gets(x) x; cin >> x;
#define puts(x) x; cout << x << endl;
#define list_input(x, n) x[n]; rep(i,n){ gets(x[i]);}
#define ll long long
typedef pair<int, int> P;

int main(){
  int r;
  cin >> r;
  if (1200 > r) {
    cout << "ABC" << endl;
  }else if (r >= 2800) {
    cout << "AGC" << endl;
  }else{
    cout << "ARC" << endl;
  }
}


Measured memory_bytes: 256
# でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..)
from typing import Iterable
import sys
def main():
    input = sys.stdin.readline
    N, Q = map(int, input().split())
    uf = UnionFindTree(N)
    for _ in range(Q):
        t, u, v = map(int, input().split())
        if t == 0:
            uf.union(u, v)
        else:
            print(1 if uf.same(u, v) else 0)

class UnionFindTree:
    def __init__(self, n: int) -> None:
        self.parent = [-1] * n

    def find(self, x: int) -> int:
        p = self.parent
        while p[x] >= 0: x, p[x] = p[x], p[p[x]]
        return x

    def union(self, x: int, y: int) -> bool:
        x, y, p = self.find(x), self.find(y), self.parent
        if x == y: return False
        if p[x] > p[y]: x, y = y, x
        p[x], p[y] = p[x] + p[y], x
        return True

    def same(self, x: int, y: int) -> bool:
        return self.find(x) == self.find(y)

    def size(self, x: int) -> int:
        return -self.parent[self.find(x)]

    def same_all(self, indices: Iterable[int]) -> bool:
        f, v = self.find, self.find(indices[0])
        return all(f(i) == v for i in indices)

if __name__ == '__main__':
    main()


Measured memory_bytes: 76656
#include<bits/stdc++.h>
using namespace std;
#define ll long long
bool check(string &s)
{
   string p="keyence";	
   if(s.length()!=p.length())
   return false;
   ll j=0;
   	 for( j=0;j<p.length();j++)
   	 {
   	 	if(s[j]!=p[j])
   	 	break;
   	 }
   	 if(j==p.length())
   	 return true;
   return false;
}
 
int main()
{
  string s;
  cin>>s;
  ll i=0;
 
  vector< ll > dp(s.length(),0);
  for(ll i=0;i<s.length();i++)
  {
  	for(ll j=i;j<=s.length();j++)
  	{
  		string h=s.substr(0,i)+s.substr(j,s.length()-j);
  		if(check(h))
  		{
  			cout<<"YES"<<endl;
  			return 0;
  		}
  	//	cout<<h<<endl;
  	}
  }
  cout<<"NO"<<endl;
  return 0;
}

Measured memory_bytes: 256
N = int(input())
A = [int(a) for a in input().split()]

total = sum(A)//2
x0 = 0
for i in range(len(A)):
  p = (-1)**i
  x0 += (A[i]*p)/2

x0 = int(x0)
ans = [x0*2]
xp = x0
for a in A[:-1]:
  ans += [(a-xp)*2]
  xp = a-xp
result = [str(a) for a in ans]
print(' '.join(result))


Measured memory_bytes: 21320
#include<iostream>
using namespace std;
int main(){
	double w;
	while(cin >> w){
		if(w <= 48.00) 
			cout << "light fly" << endl;
		else if(w <= 51.00) 
			cout << "fly" << endl;
		else if(w <= 54.00) 
			cout << "bantam" << endl;
		else if(w <= 57.00) 
			cout << "feather" << endl;
		else if(w <= 60.00) 
			cout << "light" << endl;
		else if(w <= 64.00) 
			cout << "light welter" << endl;
		else if(w <= 69.00) 
			cout << "welter" << endl;
		else if(w <= 75.00) 
			cout << "light middle" << endl;
		else if(w <= 81.00) 
			cout << "middle" << endl;
		else if(w <= 91.00) 
			cout << "light heavy" << endl;
		else 
			cout << "heavy" << endl;
	}
}

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

using namespace std;

int getInt(double x)
{
    double y = x * 100;
    int rez = (int)y / 100;

    return rez;
}

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

    int rez = getInt(n / 1.08D);
    int r2 = getInt(rez * 1.08D);


    if(r2 == n)
        cout << rez << "\n";

    else
    {
        int rez = getInt((n + 1) / 1.08D);
        int r2 = getInt(rez * 1.08D);

        if(r2 == n)
            cout << rez << "\n";

        else
            cout << ":(\n";
    }

    return 0;
}


Measured memory_bytes: 256