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


#define base 1000000007LL
#define ll long long
// unsigned long long int t = 10000000000000000003ULL;
#define ulint unsigned long long int
#define ld long double
#define X first
#define Y second
#define pb push_back
#define EPS 1e-15
#define all(a) (a).begin(), (a).end()
#define sz(a) int((a).size())

#define ms(s, n) memset(s, n, sizeof(s))

#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define sqr(a) (a)*(a)

#define foru(i,a,b) for (ll i = (a); i <= (b); i++)
#define ford(i,a,b) for (ll i = (a); i >= (b); i--)
#define cbit(a) __builtin_popcount(a)
#define uni(a) (a).resize(unique(all(a)) - (a).begin())
#define cprint(n) printf("%.6lf + %.6lfi\n", (n).real(), (n).imag())

#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it !=(a).end(); it++)


using namespace std;
typedef pair<ll, ll> II;
typedef pair<int, int> ii;



struct Edge{
    ll u,v,w;
    Edge(ll u=0, ll v=0, ll w=0): u(u),v(v),w(w) {}
    bool operator < (Edge a){return w<a.w;}
};

const int M=1e5+7;
const int MM=4*M;
const ll MOD=base;
const int MAX=1e9;


inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll power(ll n, ll k, ll p = MOD) {ll r = 1; for (; k; k >>= 1LL) {if (k & 1LL) r = r * n % p; n = n * n % p;} return r;}
inline ll inverse(ll n, ll p=MOD){return power(n,p-2);}
ll search(ll a[], ll N, ll x){ ll l = 0, r = N - 1; while (l <= r){ ll mid = (l + r) / 2; if (x == a[mid]){ return 1; } else if (x < a[mid]){ r = mid - 1; } else if (x > a[mid]){ l = mid + 1; } } return -1; }



int main(){
	int x1, y1;
	int x2, y2;
	
	int x3, y3;
	int x4, y4;
    ios::sync_with_stdio(0);
    cin >> x1 >> y1;
    cin >> x2 >> y2;
    
    x3 = x2 - (y2 - y1);
    y3 = y2 + (x2 - x1);
    
	x4 = x3 - (y3 - y2);
    y4 = y3 + (x3 - x2);
        
    cout << x3 << " " << y3 << " " << x4 << " " << y4 << endl;
    return 0;
}





Measured memory_bytes: 256
#include <cstdio>

int main(){

int a, b, c, i, j;

j = 0;

scanf("%d %d %d", &a, &b, &c);

for( i=a; i<=b; i++){
if(c % i == 0)  j += 1;

}

printf("%d\n", j);
    return 0;

}


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

int main() {
  int n,d,x,ans;
  cin >> n >> d >> x;
  ans = x;
  rep(i,n){
    int a,v;
    cin >> a;
    ans++;
    v = a+1;
    while(v <= d){
      v += a;
      ans++;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt(),d=sc.nextInt(),x=sc.nextInt();
		int choco = 0;
		for(int i=0; i<n; i++) {
			int a = sc.nextInt();
			choco++;
			for(int j=1; j<=d; j++) {
				if(a*j+1 <= d) choco++;
			}
		}
		System.out.println(choco+x);
	}
}


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

int main() {
  int n, y;
  cin >> n >> y;
  for(int i = 0; (i <= n && i * 10000 <= y); i++) {
    for(int j = 0; j <= n - i; j++) {
      if(y - 10000 * i - 5000 * j == 1000 * (n - i - j)) {
        cout << i << " " << j << " " << n - i - j << endl;
        return 0;
      }
    }
  }
  cout << "-1 -1 -1" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<stdlib.h>
#include<iomanip>
#include<limits>
#include<queue>
#include<stack>
#include<math.h>
#include<array>
const int INF = 1e9;
const int MOD = 1e9 + 7;
using namespace std;
int main(){
    int N, K;
    cin >> N >> K;
    int p[N];
    for(int i = 0; i< N; i++){
        cin >> p[i];
    }
    sort(p, p+ N);
    int ans = INF;
    for(int i = 0; i<= N - K;i++){
        ans = min(ans, p[i + (K - 1)] - p[i]);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<functional>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
using namespace std;
#define MOD 1000000007
#define f(i,n) for(int i=0;i<int(n);i++)
#define N 200000

map<long long, long long> m;
set<long long>s;

long long sol(long long k){
	long long re;
	if (k == 0)return 1;
	if (k == 1)return 2;
	if (k % 2 == 1){
		k -= 3;
		k = k / 2;
		if (s.count(k + 1) == 1)re += m[k + 1];
		else re += sol(k + 1);
		re = re%MOD;
		re = re * 2;
		re = re%MOD;
		if (s.count(k) == 1)re += m[k];
		else re += sol(k);
		re = re%MOD;
		s.insert(2 * k + 3);
		m[2 * k + 3] = re;
	}
	else{
		k -= 2;
		k = k / 2;
		if (s.count(k) == 1)re += m[k];
		else re += sol(k);
		re = re%MOD;
		re = re * 2;
		re = re%MOD;
		if (s.count(k + 1) == 1)re += m[k + 1];
		else re += sol(k + 1);
		re = re%MOD;
		s.insert(2 * k + 2);
		m[2 * k + 2] = re;
	}
	return re;
}


int main(){
	long long n, ans;
	scanf("%lld", &n);
	ans = sol(n);
	printf("%lld\n", ans);

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 500 + 5;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;

int n, k;

int main() {
    scanf("%d%d", &n, &k);
    if(2*k-1 <= n) puts("YES");
    else puts("NO");
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)

int maxN=40,maxab=10;

int main(){
    int n,ma,mb; cin>>n>>ma>>mb;
    int a[maxN],b[maxN],c[maxN];
    rep(i,n) cin>>a[i]>>b[i]>>c[i];
    int dp[maxN+1][maxN*maxab+1][maxN*maxab+1];

    rep(i,n+1){
        rep(cnta,maxN*maxab+1){
            rep(cntb,maxN*maxab+1){
                dp[i][cnta][cntb] = 1e9;
            }
        }
    }

    dp[0][0][0] = 0;

    rep(i,n){
        rep(cnta,maxN*maxab+1){
            rep(cntb,maxN*maxab+1){
                if(dp[i][cnta][cntb]==1e9) continue;
                chmin(dp[i+1][cnta][cntb],dp[i][cnta][cntb]);
                chmin(dp[i+1][cnta+a[i]][cntb+b[i]], dp[i][cnta][cntb]+c[i]);
            }
        }
    }
    int ans = 1e9;
    for(int cnta=1;cnta<=maxN*maxab;cnta++){
        for(int cntb=1;cntb<=maxN*maxab;cntb++){
            if(cnta*mb==cntb*ma) chmin(ans,dp[n][cnta][cntb]);
        }
    }
    if(ans==1e9) ans=-1;
    cout << ans << endl;
}



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


int main(){
	int n;
	cin >> n;
	double x;
	string u;
	double sum = 0.0;
	for(int i = 0; i < n; i++){
		cin >> x >> u;
		if(u == "JPY"){
			sum += x;
		}
		else{
			sum += x * 380000.0;
		}
	}
	cout << sum << endl;
	return 0;
}

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

using namespace std;

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

int main(){
  long x,y,z,k;
   cin >> x >> y >> z >>k;
  
  vector<long> a(x),b(y),c(z);
  rep(i,x) cin >> a[i];
  rep(i,y) cin >> b[i];
  rep(i,z) cin >> c[i];
  
  sort(a.begin(),a.end(),greater<long>());
  sort(b.begin(),b.end(),greater<long>());
  sort(c.begin(),c.end(),greater<long>());
  
  vector<long> v;
  
  rep(i,x){
   rep(j,y){
    rep(l,z){
      if((i+1)*(j+1)*(l+1)<=k) v.push_back(a[i]+b[j]+c[l]);
      else break;
    }
   }
  }
  
  sort(v.begin(),v.end(),greater<long>());
  
  rep(i,k) cout << v[i] << endl;
  
  
  
}

Measured memory_bytes: 1404
#include <stdio.h>
#include <stdlib.h>
int f[50];
int top=0;
void push(int);
int pop(void);
int main()
{
  int x,a,b;
  char c[10];

  while(scanf("%s",c)!=EOF)
  {
    if(c[0]=='+')
    {
      a=pop();
      b=pop();
      push(a+b);
    }
    else if(c[0]=='-')
    {
      a=pop();
      b=pop();
      push(b-a);
    }
    else if(c[0]=='*')
    {
      a=pop();
      b=pop();
      push(a*b);
    }
    else
    {
      x=atoi(c);
      push(x);
    }
  }
  x=pop();
  printf("%d\n",x);
  return 0;
}

void push(int x)
{
  f[top]=x;
  top++;
}

int pop()
{
  top--;
  return f[top];
}



Measured memory_bytes: 2052
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define fill(x, y) memset(x, y, sizeof(x))
#define clr(x) memset(x, 0, sizeof(x))
#define pb push_back
#define eb emplace_back

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

using ll = long long;
using namespace std;

bool IsBingo(const vector<bool> &m)
{
	if (m[0] && m[1] && m[2])
		return true;
	if (m[3] && m[4] && m[5])
		return true;
	if (m[6] && m[7] && m[8])
		return true;

	if (m[0] && m[3] && m[6])
		return true;
	if (m[1] && m[4] && m[7])
		return true;
	if (m[2] && m[5] && m[8])
		return true;

	if (m[0] && m[4] && m[8])
		return true;
	if (m[2] && m[4] && m[6])
		return true;

	return false;
}

int main()
{
	ll N;
	vector<ll> a, b;
	rep(i, 9)
	{
		ll tmp_a;
		cin >> tmp_a;
		a.eb(tmp_a);
	}
	cin >> N;
	rep(i, N)
	{
		ll tmp_b;
		cin >> tmp_b;
		b.eb(tmp_b);
	}

	vector<bool> match(9);
	rep(i, 9)
	{
		match[i] = (find(all(b), a[i]) != b.end());
	}

	const char *result = IsBingo(match) ? "Yes" : "No";
	cout << result << endl;
	return 0;
}


Measured memory_bytes: 256
import sys

input = sys.stdin.readline


def S():
    return input().rstrip()


def I():
    return int(input())


def MI():
    return map(int, input().split())


x, n = MI()
pl = list(MI())

nums = set(list(range(102))) - set(pl)

dmin = 1000000
for p in nums:
    d = abs(x - p)
    if d < dmin:
        temp = []
        temp.append(p)
        dmin = d
    elif d == dmin:
        temp.append(p)

print(min(temp))


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

using namespace std;

const int maxn = 1e5 + 10;
int dp[maxn], n;

int main(){
	memset(dp, 63, sizeof(dp));
	dp[0] = 0;
	for (int i = 1; i < maxn; ++i) {
		dp[i] = dp[i - 1] + 1;
		for (int j = 6; j <= i; j *= 6)
			dp[i] = min(dp[i], dp[i - j] + 1);
		for (int j = 9; j <= i; j *= 9)
			dp[i] = min(dp[i], dp[i - j] + 1);
	}
	cin >> n;
	cout << dp[n] << '\n';
	return 0;
}


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

int main(){
  char s[3];
  cin >> s;
  if( !strcmp(s,"RRS") || !strcmp(s,"SRR")){
      cout << "2" << endl;
  } 
  else if(!strcmp(s,"RRR")){
      cout << "3" << endl;
  }
  else if(!strcmp(s,"SSS")){
      cout << "0" << endl;
  }
  else if(!strcmp(s,"RSR") || !strcmp(s,"SRS") || !strcmp(s,"SSR") || !strcmp(s,"RSS")){
      cout << "1" << endl;
  }
  return 0;
}

Measured memory_bytes: 3632
# # aアリス　　　ｂボブ
# a, b = map(int, input().split())
# if a == b:
#     print("Draw")
# elif a == 1:
#     print("Alice")
# elif b == 1:
#     print("Bob")
# elif a < b:
#     print("Bob")
# elif b < a:
#     print("Alice")

x, y = map(int, input().split())

L = list(range(2, 14)) + [1]
a = L.index(x)
b = L.index(y)

if a>b:
    print("Alice")
elif b>a:
    print("Bob")
else:
    print("Draw")

Measured memory_bytes: 9184
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <numeric>
#include <queue>
#include <sstream>
#include <unordered_map>
#include <cstring>
#include <iomanip>

using namespace std;

typedef long long ll;

const ll INF=1e9+7;

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

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

int main(){
    int a,b;
    cin>>a>>b;
    string S,num;
    num=to_string(a);
    S+=num;
    num=to_string(b);
    S+=num;
    int AB=stoi(S);
    for(int i=2;i*i<=100200;i++){
        int d=i*i;
        if(AB==d){
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); 
		int[] nums = new int[n];
		for(int i=0;i<n;i++){
			nums[i] = sc.nextInt();
		}
		for(int i=n/2-1;i>=0;i--){
			heapify(nums,n,i);
		}
		printArr(nums);
	}
	public static void heapify(int[] A,int n,int i){
		int largest = i; 
		int l = 2*i+1;
		int r = 2*i+2;
		if(l<n && A[l]>A[largest]){
			largest = l; 
		}
		if(r<n && A[r]>A[largest]){
			largest = r; 
		}
		if(largest!=i){
			swap(A,i,largest);
			heapify(A,n,largest);
		}
	}
	public static void swap(int[] A,int i,int j){
		int t = A[i];
		A[i] = A[j];
		A[j] = t; 
	}
	public static void printArr(int[] A){
		for(int i=0;i<A.length;i++){
			 System.out.print(" "+A[i]);
//			else System.out.print(A[i]);
		}
		System.out.println();
	}
}

Measured memory_bytes: 166636
fun main(args: Array<String>) {
    abd084d()
}

fun abd084d() {
    val q = readLine()!!.toInt()
    val lrList = (1..q).map { readLine()!!.split(" ").map { it.toInt() } }.map { Pair(it[0], it[1]) }

    val primes = genPrime(100000)

    val cumulativeSum = LongArray(100002)
    for (i in 0..100000) cumulativeSum[i + 1] = cumulativeSum[i] +
            if (i.toLong() in primes && (i.toLong() + 1) / 2 in primes) 1 else 0

    val answer = lrList.map {
        val (left, right) = it
        cumulativeSum[right + 1] - cumulativeSum[left]
    }

    println(answer.joinToString(System.lineSeparator()))
}

private fun genPrime(max: Long): LongArray {
    val sqrt = Math.ceil(Math.sqrt(max.toDouble())).toLong()
    val primes = mutableListOf<Long>()

    var target = (2..max).toList()

    while (target.isNotEmpty() && target.first() <= sqrt) {
        val prime = target.first()
        primes.add(prime)
        target = target.filterNot { it % prime == 0L }
    }

    primes.addAll(target)

    return primes.toLongArray()
}


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

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int A, B, C, K;
    cin >> A >> B >> C >> K;
    while (C <= B || B <= A)
    {
        if (C <= B)
        {
            C *= 2;
        }
        else
        {
            B *= 2;
        }
        K--;
    }
    if (K >= 0)
    {
        cout << "Yes";
    }
    else
    {
        cout << "No";
    }
    return 0;
}


Measured memory_bytes: 3648
#![allow(non_snake_case, unused)]
use std::cmp::*;
use std::collections::*;
use std::f64::consts::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        s: chars,
    }
    let alpha: Vec<char> = "abcdefghijklmnopqrstuvwxyz".to_string().chars().collect();
    let mut map = BTreeMap::new();

    for x in alpha {
        *map.entry(x).or_insert(0);
    }

    for c in s {
        *map.entry(c).or_insert(0) += 1;
    }

    for (k, v) in map {
        if v == 0 {
            println!("{}", k);
            return;
        }
    }
    println!("None");
}


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

    ll h,s,c=0,i,j,k=1,m;
    cin>>h;
    if(h==1)cout<<1<<endl;
    else
    {
        c++;
        while(h>1)
        {
            k*=2;
            c+=k;
            h/=2;
        }

        cout<<c<<endl;
    }


    return 0;
}


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

typedef long long ll;

using namespace std;

int main() {
    int N;
    cin >> N;
    cout << (N % 2 == 0 ? N / 2 : N / 2 + 1) << endl;
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cstdint>
#include <vector>
#include <algorithm>
#include <cmath>
#include<iomanip>
using namespace std;
static const long long MOD = 1000000007LL;
typedef long long ll;

int main()
{
	int k,x;
	cin>>k>>x;
	for(int i=x-(k-1);i<=x+(k-1);i++)
	{
		cout<<i<<" ";
	}


	return 0;
}

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

namespace ABC098A2
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, c, d, f;
            var word = Console.ReadLine().Split(' ');
            a = int.Parse(word[0]);
            b = int.Parse(word[1]);
            c = a + b;
            d = a - b;
            f = a * b;
            if (c >= d && c > f)

                Console.WriteLine(c);
            else if (d > c && d > f)
                Console.WriteLine(d);
            else
            {
                Console.WriteLine(f);
            }
            Console.ReadKey();

        }  }
}


Measured memory_bytes: 13140
//#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;

int dp[100010][15];

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

	string S;
	cin >> S;

	dp[0][0] = 1;
	rep(i, 0, SZ(S))
	{
		if (S[i] != '?')
		{
			rep(j, 0, 13)
			{
				int t = S[i] - '0';
				dp[i + 1][(j*10 + t) % 13] += dp[i][j];
			}
		}
		else
		{
			rep(j, 0, 13)rep(k, 0, 10)
			{
				dp[i + 1][(j*10 + k) % 13] += dp[i][j];
			}
		}
		rep(j, 0, 13)
		{
			dp[i + 1][j] %= MOD;
		}
	}

	cout << dp[SZ(S)][5] << endl;

	return 0;
}

Measured memory_bytes: 12240
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int a = scn.nextInt();
		int b = scn.nextInt();
      	int c = b - a;
      	int x = 0;
      	for(int i=1; i<=c; ++i){
          x = x + i;
        }
      	int ans = x - b;
      	System.out.println(ans);
	}
}

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

#define int long long int
#define ff first
#define ss second
#define pb push_back
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const int mod = 1e9 + 7;
const int cmod = 998244353;
const int N = 1e3 + 5;
const int inf = 1e16 + 2;

int p[100000];
void solve(int Case) {
    for(int i = 1 ; i <= 100 ; i ++) {
        for(int j = 1 ; j <= 100 ; j ++) {
            for(int k = 1 ; k <= 100 ; k ++) {
                int t = i * i + j * j + k * k + i * j + i * k + j * k;
                if(t <= 10010) p[t] ++;
            }
        }
    }
    int n;
    cin >> n;
    for(int i = 1 ; i <= n ; i ++) cout << p[i] << '\n';
}
/*
 */

int32_t main()
{
    fastio
    int testcase = 1;
    //cin >> testcase;
    int Case = 1;
    while(testcase --) {
        solve(Case ++);
    }
    return 0;
}
 



Measured memory_bytes: 3608
let h()=Scanf.scanf"%d %d %d %d "(fun a b c d->[a;b;c;d]);;let rec f()=let a,b=h(),h()in let n=List.fold_left2(fun z x y->if x=y then z+1else z)0a b in f(Printf.printf"%d %d
"n((List.fold_left(fun z e->if List.mem e b then z+1else z)0a)-n));;try f()with _->()

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

int main() {
  string s ;
  int ans = 0;

  cin >> s;

  if(s.compare("SUN")==0) {ans = 7;}
  else if(s.compare("MON")==0) {ans = 6;}
  else if(s.compare("TUE")==0) {ans = 5;}
  else if(s.compare("WED")==0) {ans = 4;}
  else if(s.compare("THU")==0) {ans = 3;}
  else if(s.compare("FRI")==0) {ans = 2;}
  else if(s.compare("SAT")==0) {ans = 1;}

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
n = int(input())

c = (0, 0, 0)
check = True
for i in range(n):
    ct, cx, cy = c
    t, x, y = [int(i) for i in input().strip().split(' ')]
    dt = t - ct
    d = abs(cx - x) + abs(cy - y)
    if dt < d or (dt - d) % 2 != 0:
        check = False

print("Yes" if check else "No")


Measured memory_bytes: 3316
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

#define fix(n)          cout<<fixed<<setprecision(n)
#define rep(i,n)        for (int i = 0; i < (n); ++i)
#define sort(a)         sort((a).begin(), (a).end())
#define uniq(a)         SORT(a);(a).erase(unique((a).begin(), (a).end()), (a).end())
#define reverse(a)      reverse((a).begin(), (a).end())
#define ctos(c)         string(1, (c))
#define out(d)          cout << (d)
#define outl(d)         std::cout<<(d)<<"\n"
#define Yes()           printf("Yes\n")
#define No()            printf("No\n")
#define YES()           printf("YES\n")
#define NO()            printf("NO\n")
#define ceil(x, y)      ((x + y - 1) / (y))
#define debug(x)        cerr << #x << ": " << (x) << '\n'
#define debug2(x, y)    cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v)          for (size_t _ = 0; _ < v.size(); ++_){ cerr << #v << "[" << _ << "] : " << v[_] << '\n'; }

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

const ll MOD = 1000000007; // 10^9 + 7

void solve() {
  int m; cin >> m;
  outl(24 + (24 - m));
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  fix(12);

  solve();
}


Measured memory_bytes: 504
#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 equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const ll INF = 1e18;
const long double EPS = 1e-10;

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

  int n = s.size();
  for (int i = 0; i < n; i += 2) cout << s[i];
  cout << endl;


  
  return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stdlib.h>
#include <cmath>
#include <numeric>
#include <functional>
#include <stack>
#include <iomanip>
#include <map>
#include <cstdio>

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

	scanf("%ld %ld.%ld", &a, &b, &c);

	std::cout << a * (b * 100 + c) / 100 << std::endl;


	return 0;
}


Measured memory_bytes: 3692
#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cctype>
#include <string>

using namespace std;

int main(){
  string s;
  cin >> s;
  int ans = 0;

  for (int i = 0; i < 3; i++){
    if(s[i] == '1'){
      ans++;
    }
  }

  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <sstream>
#include <cmath>
using namespace std;

int main(){
    int N,K;
    cin >> N >> K;

    int A[N];

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

    int res = 0;
    int split = 0;
    while(split<N-1){
        split = split + (K-1);
        res++;
    }
    cout << res << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define ll long long
#define all(a) (a).begin(), (a).end()
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define sz() size()
#define fr first
#define sc second
#define pb push_back
#define er erase
#define in insert
#define pi pair<int,int>
#define pii pair<pair<int,int>,int>
#define mp make_pair
#define int long long
#define rc(s) return cout<<s,0
#define rcc(s) cout<<s,exit(0)
using namespace std;

const int mod=1e9+7;
const int modx=998244353;
const int per=666013;

struct mat{
    int rows,cols;
    int arr[55][55];
    mat operator*(mat &cappa){
        mat sah;
        sah.cols = cappa.cols;
        sah.rows = rows;
        for(int i = 1 ; i <= rows ; i++)
        for(int j = 1 ; j <= cappa.cols; j++)sah.arr[i][j] = 0;
        for(int i = 1 ; i <= rows ; i++){
            for(int j = 1 ; j <= cappa.cols; j++){
                for(int k = 1 ; k <= cols ; k++){
                    sah.arr[i][j] += arr[i][k]*cappa.arr[k][j];
                    sah.arr[i][j]%=mod;
                }
            }
        }
        return sah;
    }
};

int n,k;

int32_t main(){
    ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
    srand(chrono::steady_clock::now().time_since_epoch().count());
    cin >> n >> k;
    mat tab;
    tab.rows=n;
    tab.cols=n;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            cin >> tab.arr[i][j];
        }
    }
    mat tz=tab;
    --k;
    for(int i=0LL;(1LL<<i)<=k;i++){
        if(k&(1LL<<i)) tab=tab*tz;
        tz=tz*tz;
    }
    int rez=0LL;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            rez+=tab.arr[i][j];
            rez%=mod;
        }
    }
    cout << rez;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<int, int>;
#define INF 1001001001
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repX(i, n ,x) for (int i = x; i < (int)(n); i++)
#define repBack(i, n) for (int i = n; i >= 0; i--)
#define dup(x,y) (((x)+(y)-1)/(y))

int main() {
    int N;
    cin >> N;
    vector<string> S(N);
    rep(i,N)cin >> S[i];
    sort(S.begin(),S.end());
    S.erase(std::unique(S.begin(), S.end()), S.end());
    cout << S.size() << endl;

    return 0;
}

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

int main(){
    string s,t,u;
    int a,b;
    cin >> s >> t >> a >> b >> u;
    if(s==u) cout << a-1 << " " << b << endl;
    else  cout << a << " "<< b-1 << endl;
}


Measured memory_bytes: 256
N = int(input())
ans = 0
ANS = {}
for i in range(N):
  si = input()
  new_str_list = sorted(si)
  s = "".join(new_str_list)
  if s not in ANS.keys():
    ANS[s] = 1
  else:
    ANS[s] += 1
  ans += ANS[s]
      
print(ans-N)

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

using namespace std;

long long mod = 1e9+7;
long long N;
string s;

int main(){
    cin >> N;
    cin >> s;
    long long p = 1;
    long long n = 0;
    for(int i=0;i<N*2;i++){
        if(n == 0){
            if(s[i] == 'W'){
                cout << 0 << endl;
                return 0;
            }
            n++;
            continue;
        }
        if(s[i] == 'W'){
            if(n % 2==0){
                p *= n;
                n--;
                p %= mod;
            }else{
                n++;
                n %= mod;
            }
        }else{
            if(n % 2==1){
                p *= n;
                n--;
                p %= mod;
            }else{
                n++;
                n %= mod;
            }
        }
    }
    if(n != 0){
        cout << 0 << endl;
        return 0;
    }
    for(long long i=2;i<=N;i++){
        p *= i;
        p %= mod;
    }
    cout << p << endl;
    return 0;
}

Measured memory_bytes: 640
// ABC137B.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

//#include "pch.h"
#include <iostream>
using namespace std;
int main()
{
	int K, X;
	cin >> K >> X;

	int left = X - K + 1;
	int right = X + K - 1;

	for (int i = left; i < right; i++)
	{
		cout << i << " "; // 答えをスペース区切りで表示
	}
	cout << right << endl; // 最後の答えはスペースを付けない
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); ++i)

int main(){
    ll A,B;
    cin >> A >> B;
    if((A+B)/2.0 == (A+B)/2){
        cout << (A+B)/2 << endl;;
    }else{
        cout << "IMPOSSIBLE" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
a = gets.chomp
b = gets.chomp

if a.size == b.size then
  a.size.times{|i|
    if a[i].to_i > b[i].to_i then
      puts 'GREATER'
      exit
    elsif a[i].to_i < b[i].to_i then
      puts 'LESS'
      exit
    end
  }
  puts 'EQUAL'
elsif a.size > b.size then
  puts 'GREATER'
else
  puts 'LESS'
end

Measured memory_bytes: 3836
import sys
N = int(input())

if N>81:
    print("No") # if N>81=9*9 then don't even bother trying to factorize it
else:
    for A in range(1, 10):
        if N % A == 0:
            B = N//A
            if B <= 9:
                print("Yes")
                sys.exit()
    print("No")


Measured memory_bytes: 2940
import sys
n=int(input())
s=list(map(int,[input() for i in range(n)]))
a=sum(s)
if a%10!=0:
  print(a)
else:
  s.sort()
  for i in s:
    if i%10!=0:
      a-=i
      print(a)
      sys.exit()
  print(0)

Measured memory_bytes: 3060
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>
#include <string.h>
#include <set>

using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> void printvec(const vector<T>& v) {
  for (auto x : v) { cout << x << " "; }
  cout << endl;
}
template<class T> void printtree(const vector< vector<T> >& tree) {
  for (long long i = 0; i < tree.size(); ++i) {
    cout << i + 1 << ": "; printvec(tree[i]);
  }
}
template<class T, class U> void printmap(const map<T, U>& mp) {
  for (auto x : mp) { cout << x.first << "=>" << x.second << endl; }
}

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

#define rep(i, n) for(ll i = 0; i < n; ++i)
#define all(s) s.begin(), s.end()
#define fr first
#define sc second
#define mp make_pair
#define pb push_back

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> triple;
typedef double D;

const ll INF = 1e9;
const ll MOD = 1000000007;  // 1e9 + 7

int main(int argc, char** argv) {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  //cout << setprecision(10) << fixed;

  ll x, y, a, b, c;
  cin >> x >> y >> a >> b >> c;
  vector<ll> p(a);
  vector<ll> q(b);
  vector<ll> r(c);
  vector<P> alls; // the pair of (value, type). type is (0, 1, 2).
  rep(i, a) {
    cin >> p[i];
    alls.emplace_back(p[i], 0);
  }
  rep(i, b) {
    cin >> q[i];
    alls.emplace_back(q[i], 1);
  }
  rep(i, c) {
    cin >> r[i];
    alls.emplace_back(r[i], 2);
  }

  sort(all(alls));
  reverse(all(alls)); // decreasing order


  ll tot = x + y;
  ll ans = 0;
  // scan alls

  rep(i, a + b + c) {
    ll v = alls[i].first;
    ll type = alls[i].second;
    if (tot == 0) { break; } // reached to last

    if (type == 0) { // red
      if (x > 0) {
        ans += v;
        --x;
        --tot;
      }
    } else if (type == 1) { // green
      if (y > 0) {
        ans += v;
        --y;
        --tot;
      }
    } else { // transp
      if (tot > 0) {
        ans += v;
        --tot;
      }
    }
  }

  // Here, calculated
  cout << ans << endl;
}


Measured memory_bytes: 12780
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const int inf = 1001001001;
vector<P> to[100005];
bool ok = true;
vector<int> node(100005, -inf);
void solve(int cur, int prev=-1) {
    for(auto next : to[cur]) {
        int v = next.first;
        int d = next.second;
        if(v == prev) continue;
        if(node[v] == -inf) {
            node[v] = node[cur] + d;
            solve(v, cur);
        }else{
            if(node[v] != node[cur]+d) ok = false;
        }
    }
}
int main() {
    int n, m; cin >> n >> m;
    int mi = inf, mx = -inf;
    rep(i, m) {
        int L, R, D; cin >> L >> R >> D;
        L--, R--;
        to[L].push_back(P{R,D});
        to[R].push_back(P{L,-D});
    }
    rep(i, n) {
        if(node[i] != -inf) continue;
        node[i] = 0;
        solve(i);
    }
    if(ok) cout << "Yes";
    else cout << "No";
}


Measured memory_bytes: 12032
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i < (n+1); ++i)
const double PI  =3.141592653589793238463;
using namespace std;
using ll = long long;
const ll INF = +10010010000;
typedef pair<int,int> P;
const int mod = 1e9+7;

struct mint{
    ll x;
    mint(ll x=0):x((x%mod+mod)%mod){}
    mint& operator+=(const mint a){
        (x+=a.x)%=mod;
        return *this;
    }
    mint& operator-=(const mint a){
        (x-=mod-a.x)%=mod;
        return *this;
    }
    mint& operator*=(const mint a){
        (x *= a.x)%= mod;
        return *this;
    }
    mint operator+(const mint a)const{
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint a)const{
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint a)const{
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
      if(!t)return 1;
      mint a = pow(t>>1);
      a*=a;
      if(t%1)a*=*this;
      return a;
    }

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

struct combination{
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1){
    fact[0] = 1;
    for(int i = 1; i<n;++i)fact[i] = fact[i-1] * i;
    ifact[n] = fact[n].inv();
    for(int i = n; i>=1;--i) ifact[i-1] = ifact[i] * i;
  }
  mint operator()(int n, int k){
    if(k<0 || k>n)return 0;
    return fact[n] * ifact[k] + ifact[n-k]; 
  }
};

int main(){
    int n;
    cin >> n;
	ll ans = 0;
	vector<int>a(n);
	vector<ll>D(1e5+1,0);
	rep(i,n)cin>>a[i];
	rep(i,n){
		ans+=a[i];
		D[a[i]]++;
	}
	int q;
	cin >> q;
	rep(i,q){
		int b,c;
		cin >> b >> c;
		ll rn = D[b]; D[b] = 0;
		D[c]+=rn;
		ans += (ll)(c-b)*rn;
		cout << ans<<endl;
	}
	return 0;

}

Measured memory_bytes: 4592
#include <stdio.h>
#define LEN 100005

typedef struct{
  char name[10];
  int t;
} pr;

pr a[LEN];
int head,tail,n;

void enqueue(pr);
pr dequeue();
int min(int a, int b){return a < b ? a : b;} //最小値を返す

int main(){
  int elaps = 0, c;
  int i, q;
  pr b;

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

  for(i=1;i<=n;i++){
  scanf("%s",a[i].name);
  scanf("%d",&a[i].t);
  }
  head = 1;
  tail = n + 1;

  while(head!=tail){
    b = dequeue();
    c = min(q,b.t);
    b.t -= c;
    elaps += c;
    if(b.t>0) {
    enqueue(b);
  } else {
    printf("%s %d\n",b.name,elaps);
  }
}


  return 0;
}

void enqueue(pr b){
  a[tail] = b;
  tail=(tail+1)%LEN;
}

pr dequeue(){
  pr x = a[head];
  head=(head+1)%LEN;
  return x;
}


Measured memory_bytes: 3276
import java.util.Scanner

object Main extends App  {
  val sc = new Scanner(System.in)

  val s = sc.next

  val s1 = s.substring(0,2).toInt
  val s2 = s.substring(2).toInt

  val res = (isYYMM(s1, s2), isMMYY(s1,s2)) match{
    case (true, true) => "AMBIGUOUS"
    case (true, false) => "YYMM"
    case (false, true) => "MMYY"
    case (false, false) => "NA"
  }


  println(res)

  def isMonth(mm:Int):Boolean={
    1 <= mm && mm <= 12
  }

  def isYear(yy: Int): Boolean={
    0 <= yy && yy <= 99
  }

  def isYYMM(s1: Int, s2: Int) :Boolean ={
    isYear(s1) && isMonth(s2)
  }

  def isMMYY(s1: Int, s2: Int) :Boolean ={
    isMonth(s1) && isYear(s2)
  }

}


Measured memory_bytes: 27328
#include <bits/stdc++.h>
#define ll long long
const int mod=1e9+7;
using namespace std;
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    ll i,j,k,m,n;
    ll ans=9999999999,cnt,x,y,z;
    ll a,b;
    ll minn,maxn;
    cin>>m>>n;
    a=m,b=n;
    if(m%3==0||n%3==0)
    {
        cout<<0<<endl;
        return 0;
    }
    for(i=0; i<2; i++)
    {
        m=a;
        n=b;
        if(i==0&&m!=1)
        {
            x=(m+1)/3*n;
            m-=(m+1)/3;
        }
        else if(i==1&&n!=1)
        {
            x=((n+1)/3)*m;
            n-=(n+1)/3;
        }
        for(j=0; j<2; j++)
        {
            if(j==0&&n!=1)
            {
                y=m*(n/2);
                z=m*(n-n/2);
            }
            else if(j==1&&m!=1)
            {
                y=n*(m/2);
                z=n*(m-m/2);
            }
            maxn=max(x,max(y,z));
            minn=min(x,min(y,z));
            ans=min(ans,maxn-minn);
        }
    }
    cout<<ans<<endl;
    return 0;
}


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

/*
  REMEMBER:
  1.Think TWICE, code ONCE!
  Are there any counterexamples to your algo?
	
  2.Be careful about the BOUNDARIES in your algo!
  N=1? P=1? Is P a prime? Something about 0?
	
  3.Never make STUPID MISTAKES!
  Integer overflow? Array size? Time complexity? Memory usage? Precition error?
*/

#define ll long long
const int _ = 1e5 + 7; ll arr[_] , sum[_] , tms[_]; int N , Q;

void add(ll len , ll v){
	int t = upper_bound(arr , arr + Q + 1 , len) - arr - 1;
	if(t < 0){sum[len] += v; return;}
	tms[t] += len / arr[t] * v; add(len % arr[t] , v);
}

int main(){
	cin >> arr[0] >> Q; N = arr[0];
	for(int i = 1 ; i <= Q ; ++i){cin >> arr[i]; while(i && arr[i] <= arr[i - 1]){arr[i - 1] = arr[i]; --i; --Q;}}
	tms[Q] = 1; for(int i = Q ; i ; --i){tms[i - 1] += arr[i] / arr[i - 1] * tms[i]; add(arr[i] % arr[i - 1] , tms[i]);}
	sum[arr[0]] += tms[0]; for(int i = N ; i ; --i) sum[i] += sum[i + 1];
	for(int i = 1 ; i <= N ; ++i) cout << sum[i] << '\n';
	return 0;
}


Measured memory_bytes: 4096
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<ll,ll>;
const ll mod = 1e9+7;
#define ALL(x) (x).begin(),(x).end()
#define pow(x,y) modpow(x,y)
#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)

template <class T = int>T in(){
    T x;
    cin >> x;
    return (x);
}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    int A = in(),B = in();
    int eight = (A*100 + 8 - 1)/8;
    int ten = (B*100 + 10 - 1)/10;
    int eightl = ((A+1)*100 + 8 - 1)/8 - 1;
    int tenl = ((B+1)*100 + 10 - 1)/10 - 1;
    int answer = max(ten,eight);
    if(answer > eightl || answer > tenl)answer = -1;
    cout << answer << "\n";
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){

  char s[1001]={0};
  int i;

  scanf("%s",s);

  for(i=0;s[i]!='\0';i++){
    if(s[i]<68){
      s[i]+=26;
    }

    s[i]-=3;
  }

  printf("%s\n",s);

  return 0;

}
    

  

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

using namespace std;
const int maxn = 3e3 + 5;
string s, t;
int n, m, f[maxn][maxn];

int dp(int i, int j)
{
    if (i > n || j > m) return 0;
    int &res = f[i][j];
    if (res != -1) return res;
    res = max(dp(i + 1, j), dp(i, j + 1));
    if (s[i] == t[j]) res = max(dp(i + 1, j + 1) + 1, res);
    return res;
}
void trace(int i, int j)
{
    if (i > n || j > m) return;
    if (s[i] == t[j]) {
        cout << s[i];
        trace(i + 1, j + 1);
    } else if (dp(i + 1, j) > dp(i, j + 1)) trace(i + 1, j);
    else trace(i, j + 1);
}

int main()
{
    #ifdef NTMA 
        freopen("abc.inp", "r", stdin);
    #endif
    memset(f, 255, sizeof(f));
    cin >> s >> t;
    n = s.size(); m = t.size();
    s = ' ' + s; t = ' ' + t;
    trace(1, 1);
}

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

int main(){
  string S;
  
  cin >> S;
  
  int count = 0, max = 0, i;
  for (i = 0; i < S.size(); i++){
    if(S.at(i) == 'A' || S.at(i) == 'C' || S.at(i) == 'G' || S.at(i) == 'T'){
      count ++;
    } else {
      count = 0;
    }
    if(count > max){
      max = count;
    }
  }
  
  cout << max << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define repk(i,k, n) for (int i = k; i < (int)(n); ++i)
#define MAX 500010
typedef long long int ll;

using namespace std;

ll N, ans, cnt;
ll a[MAX];
string s;

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


void func(int start) {
	a[start] = 0;
	a[start + 1] = maxll(a[start + 1],1);
	a[start - 1] = maxll(a[start - 1], 1);

	// 右側
	int i = 0;
	while (1) { //s[start]==mi
		if (s[start + i] == s[start + i + 1]) {
			a[start + i + 2] = maxll(a[start + i + 2], i + 2);
			i++;
		}
		else break;
	}

	// 左側
	i = 0;
	while (1) { //s[start-1]==ma
		if (i > start - 2) break;
		if (s[start - i - 1] == s[start - i - 2]) {
			a[start - i - 2] = maxll(a[start - i - 2] , i + 2);
			i++;
		}
		else break;
	}
}


int main() {
	char mi = '<';
	char ma = '>';
	cin >> s;
	N = s.length();

	
	if (s[0] == mi) {
		a[0] = 0;
		a[1] = maxll(a[1],1);
		int i = 0;
		while (1) { // s[0]==mi
			if (s[i] == s[i + 1]) {
				a[i + 2] = maxll(a[i + 2], i + 2);
				i++;
			}
			else break;
		}
	}

	if (s[N - 1] == ma) {
		a[N] = 0;
		a[N - 1] = maxll(a[N - 1], 1);
		int i = 0;
		while (1) { //s[N-1]==ma
			if (i > N - 2) break;
			if (s[N - i - 1] == s[N - i - 2]) {
				a[N - i - 2] = maxll(a[N - i - 2], i + 2);
				i++;
			}
			else break;
		}
	}
	rep(i, N) {
		if (s[i] == ma && s[i + 1] == mi) { // ><の場合
			func(i + 1);
		}
	}

	rep(i, N + 1) {
		ans += a[i];
	}
	
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 4740
// Problem : A - Don't be late
// Contest : AtCoder - AtCoder Beginner Contest 177
// URL : https://atcoder.jp/contests/abc177/tasks/abc177_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

//Macros

#define ll long long
#define db long double
#define pb push_back
#define eb emplace_back
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define mi map<int,int>
#define mii map<pii,int>
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mod 1000000007
#define EPS 1e-9
#define io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define inf 1e10
#define PI acos(-1.0)
#define int long long
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define N 100005

//Solution

void solve(){
    int d,t,s;
    cin>>d>>t>>s;
    if(s*t >= d) cout<<"Yes\n";
    else cout<<"No\n";
}

signed main(){
    io;
    //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    int tests;
    //cin>>tests;
    tests = 1;
    for(int test=1;test<=tests;test++){
        //cout<<"Case #"<<test<<": ";
        solve();
    }
    return 0;
}

Measured memory_bytes: 3612
// B

#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll mod=1e9+7;
#define pa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};

int main(){
  int N;
  cin>>N;
  vector<pair<ll,ll>> x(N);
  for (int i(0);i<N;i++){
    ll a,b;
    cin>>a>>b;
    x[i].second= a - b; 
    x[i].first= a + b; 
  }
  sort(x.begin(),x.end());
  int ans(1);
  int now(x[0].first);
  for (int i(1);i<N;i++){
    if (x[i].second >= now){
      ans++;
      now = x[i].first;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <string>
#include <math.h>
#include <algorithm>
#include <numeric>
#include <queue>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)

int main() {
    string s;
    cin >> s;
    
    int max = 0;
    int cnt = 0;
    if (s[0] == 'R') cnt++;
    else {
        if (cnt > max) max = cnt;
        cnt = 0;
    }
    if (s[1] == 'R') cnt++;
    else {
        if (cnt > max) max = cnt;
        cnt = 0;
    }
    if (s[2] == 'R') cnt++;
    else {
        if (cnt > max) max = cnt;
        cnt = 0;
    }
    if (cnt > max) max = cnt;

    cout << max << endl;
}

Measured memory_bytes: 3604
n,m=map(int,raw_input().split())
cnt=[0]*n
for i in xrange(m):
    a,b=map(int,raw_input().split())
    a-=1;b-=1
    cnt[a]+=1
    cnt[b]+=1
for i in xrange(n):
    if cnt[i]%2==1:
        print "NO"
        exit()
print "YES"


Measured memory_bytes: 3460
import sys
input = sys.stdin.readline
N,K=map(int,input().split())
P=list(map(int,input().split()))
kouho=0
def saikorokitaiti(A):
    return ((P[A]*(1+P[A])/2)/P[A])
kari=[]
hako=[]
kitaiti=0
if K==1:
    print(saikorokitaiti(P.index(max(P))))
    exit()
for i in range(K):
    hako.append(saikorokitaiti(i))
    kitaiti+=saikorokitaiti(i)
    kouho=kitaiti
b=0
for j in range(N-K+1):
    if j==0:
        continue
    elif j+K-1<N:
        hako.append(saikorokitaiti(j+K-1))
        kitaiti+=saikorokitaiti(j+K-1)
        kitaiti-=hako[b]
        b+=1
        kouho=max(kouho,kitaiti)
#print(kouho)
print(kouho)

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

int main(){
  int X,A,B,C,a,count;
  cin >> A >> B >> C >> X ;
  for(int i=0;i<=A;i++){
    for(int j=0;j<=B;j++){
      for(int k=0;k<=C;k++){
        a = 500*i + 100*j + 50*k;
        if(a == X){
          count++;
        }
      }
    }
  }
  cout << count << endl;
}


Measured memory_bytes: 256
#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 a[200020];
int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(a, a + n);
    priority_queue<long long> que;
    que.push(a[n - 1]);
    long long ans = 0;
    for (int i = n - 2; i >= 0; i--) {
        ans += que.top();
        que.pop();
        que.push(a[i]);
        que.push(a[i]);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 6904