akhauriyash/Code-Regression huggingface dataset:
//
//  main.cpp
//
 
#include <algorithm>
#include <array>
#include <assert.h>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
 
using namespace std;
 
using ll = long long;
using ull = unsigned long long;
 
template<typename T>
vector<T> make_vec_nd(T init, size_t size) {
	return vector<T>(size, init);
}
template<typename T, typename... Args>
auto make_vec_nd(T init, size_t size, Args... rest) {
	auto inner = make_vec_nd(init, rest...);
	return vector<decltype(inner)>(size, inner);
}

int main() {
	ll N, A, B, C;
	cin >> N >> A >> B >> C;
	vector<ll> ls;
	for (ll i = 0; i < N; i++) {
		ll l;
		cin >> l;
		ls.push_back(l);
	}
	ll ans = numeric_limits<ll>::max();
	for (ll flag = 0; flag < (1 << (2 * N)); flag++) {
		ll cost = 0;
		ll lens[3] = {};
		for (ll i = 0; i < N; i++) {
			ll flag_loc = (flag >> (2 * i)) & 0b11;
			if (flag_loc < 3) {
				if (lens[flag_loc] > 0) {
					cost += 10;
				}
				lens[flag_loc] += ls[i];
			}
		}
		if (lens[0] == 0 || lens[1] == 0 || lens[2] == 0) {
			continue;
		}
		cost += abs(A - lens[0]) + abs(B - lens[1]) + abs(C - lens[2]);
		ans = min(ans, cost);
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
#define MAX 110
#define SENTINEL -110

int L[MAX/2], R[MAX/2];


void merge(int A[], int n, int left, int mid, int right){
	int n1 = mid - left;
	int n2 = right - mid;
	for(int i = 0; i < n1; i++) L[i] = A[left + i];
	for(int i = 0; i < n2; i++) R[i] = A[mid + i];
	L[n1] = R[n2] = SENTINEL;
	int i = 0;
	int j = 0;
	for(int k = left; k < right; k++){
		if(L[i] >= R[j]){
			A[k] = L[i++];
		}else{
			A[k] = R[j++];
		}
	}
}

void mergeSort(int A[], int n, int left, int right){
	if( left+1 < right){
		int mid = (left + right) / 2;
		mergeSort(A, n, left, mid);
		mergeSort(A, n, mid, right);
		merge(A, n, left, mid, right);
	}
}



int main(){
	int N, a[110];
	cin >> N;
	for(int i = 0; i < N; i++){
		cin >> a[i];
	}

	//cout << a[0] <<" "<< a[1] <<" "<< a[2] << endl;
	mergeSort(a, N, 0, N);
	int A = 0;
	int B = 0;
	
	//cout << a[0] <<" "<< a[1] <<" "<< a[2] << endl;

	for(int i = 0; i < N; i++){
		if(i % 2 == 0){
			A += a[i];
		}else{
			B += a[i];
		}
	}

	int res = A - B;
	cout << res << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
int main()
{
  int a, b, c;
  std::cin >> a >> b >> c;
  if(a==b && b==c)
  {
    std::cout << "Yes" << std::endl;
  }
  else
  {
    std::cout << "No" << std::endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
          long long int a,c,d=0,e=0,f=0,g=0,i,j;
          string b;
          cin>>a;
          for(i=0;i<a;i++)
          {
                    cin>>b;
                    if(b=="AC")
                              d++;
                    if(b=="WA")
                              e++;
                    if(b=="TLE")
                              f++;
                    if(b=="RE")
                              g++;
          }
          cout<<"AC x "<<d<<endl;
          cout<<"WA x "<<e<<endl;
          cout<<"TLE x "<<f<<endl;
          cout<<"RE x "<<g<<endl;
}


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

bool isConnected(int n, const vector<vector<int>>& pgraph) {
    queue<int> q;
    vector<bool> seen(n, false);
    seen[0] = true;
    q.push(0);
    while (!q.empty()) {
        int v = q.front();
        q.pop();
        for (int nv : pgraph[v]) {
            if (seen[nv]) continue;
            q.push(nv);
            seen[nv] = true;
        }
    }
    for (bool i : seen) if (!i) return false;
    return true;
}

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> a(m);
    vector<int> b(m);
    for (int i = 0; i < m; ++i) {
        int x, y;
        cin >> x >> y;
        --x; --y;
        a[i] = x;
        b[i] = y;
    }
    int ans = 0;
    for (int i = 0; i < m; ++i) {
        int from = a[i];
        int to = b[i];
        vector<vector<int>> ngraph(n, vector<int>(0));
        for (int j = 0; j < m; ++j) {
            if (a[j] == from and b[j] == to) continue;
            ngraph[a[j]].emplace_back(b[j]);
            ngraph[b[j]].emplace_back(a[j]);
        }
        if (!isConnected(n, ngraph)) ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*

fun main(args: Array<String>) {
    val sc = FastScanner(System.`in`)

    var x = sc.nextInt()

    while (true) {
        if (prime(x)) {
            println(x)
            return
        }
        x += 1
    }

}

fun prime(x: Int): Boolean {
    var d = 2
    while (d * d < x) {
        if (x % d == 0) return false
        d += 1
    }
    return true
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}

Measured memory_bytes: 31400
MOD=10**9+7
cnt=0; sum=0; prev=nil; h=Hash.new(0)
def gs() gets.chomp end
def gi() gets.to_i end
def gsmi() gets.chomp.split.map(&:to_i) end

def desc(ar) ar.sort!{|x,y|y<=>x} end
def min(a,b) a<=b ? a : b end
def max(a,b) a>=b ? a : b end

def puts_yesno(can) puts(can ? 'Yes' : 'No') end
def putsend(s) puts s; exit end
def debug(k,v) puts "#{k}:#{v}" end
########### ( ˘ω˘ )ｽﾔｧ… ###########
s=gs.chars
prev = s[0]
can=true
1.upto(s.size-1) do |i|
  can = false if prev==s[i]
  prev=s[i]
end
puts can ? 'Good' : 'Bad'

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

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

    int a = stoi(s.substr(0,2));
    int b = stoi(s.substr(2));

    if ((a <= 12) && (a != 0) ) {
        if ((b <= 12) && (b != 0)) {
            cout << "AMBIGUOUS" << endl;
        } else {
            cout << "MMYY" << endl;
        }
    } else {
        if ((b <= 12) && (b != 0)) {
            cout << "YYMM" << endl;
        } else {
            cout << "NA" << endl;
        }
    }

    return 0;
}

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

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,q,l,r,sum=0;
	string s;
	cin>>n>>q>>s;
	vector<int>v(s.length());
	for(int i=0;i<s.length();i++){
		v.at(i)=sum;
		if(s.substr(i,2)=="AC") sum++;
	}
	for(int i=0;i<q;i++){
		cin>>l>>r;
		cout<<v.at(r-1)-v.at(l-1)<<endl;
	}
	return 0;
}


Measured memory_bytes: 1488
/* Volume0-0001(山の高さ) */

import java.io.*;
import java.util.*;

public class Main {
  public static void main (String[] args) throws java.lang.Exception {
    // 入力された値をゲット
   Scanner sc = new Scanner(System.in);

   Integer[] yama = new Integer[10];
   for(int i=0; i<10; i++) {
     yama[i] = sc.nextInt();
   }
   Arrays.sort(yama, Collections.reverseOrder());
   System.out.println(yama[0]);
   System.out.println(yama[1]);
   System.out.println(yama[2]);
 }
}



Measured memory_bytes: 25964
#include<stdio.h>
int sum[100001];
int main()
{
	int a[100001],i,n,ans=0;
	scanf("%d",&n);
	for(i=0;i<n;i++){
	scanf("%d",&a[i]);
		if(a[i]>100000) ans++;
		else sum[a[i]]++;
	}
	for(i=1;i<=100000;i++){
		if(sum[i]>i) ans+=sum[i]-i;
		else if(sum[i]<i) ans+=sum[i];
	}
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 640
import java.util.*;

public class Main {

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

        int count5 = 0;
        int count7 = 0;

        for (int i = 0; i < 3; i++) {
            switch (sc.nextInt()) {
                case 5:
                    count5++;
                    break;
                case 7:
                    count7++;
                    break;
            }
        }

        if (count5 == 2 && count7 == 1) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}


Measured memory_bytes: 21844
using System;

namespace Ex160424_1{
    public class Program{
        public static void Main(string[] args){
            var input = Console.ReadLine().Split(' ');
            var w = int.Parse(input[0]);
            var h = int.Parse(input[1]);
            var x = int.Parse(input[2]);
            var y = int.Parse(input[3]);
            var r = int.Parse(input[4]);

            if(0 <= x - r && x + r <= w && 0 <= y - r && y + r <= h)
                Console.WriteLine("Yes");
            else
                Console.WriteLine("No");
        }
    }
}

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

using bellman_cost = int;
template<class V, class E>
struct Graph
{
	int sz;
	vector<V> v;
	vector<vector<E>> e;
	Graph(int n) : sz(n), v(n), e(n) {}
	template<class... Args>
	inline void assign_vertex(int pos, Args... args) {
		v[pos] = V(args...);
	}
	template<class... Args>
	inline void add_edge(int pos, Args... args) {
		e[pos].emplace_back(args...);
	}
	inline int size() {
		return sz;
	}
};

template<class T>
struct Vertex_Cost
{
	T cost;
	bool valid = false;
	Vertex_Cost(T v1) : cost(v1) {}
	Vertex_Cost() {}
};
using vertex = Vertex_Cost<bellman_cost>;

template<class T>
struct Edge_Cost
{
	int to;
	T cost;
	Edge_Cost(int t, T c) : to(t), cost(c) {}
	Edge_Cost() {}
};
using edge = Edge_Cost<bellman_cost>;
using graph = Graph<vertex, edge>;

template<class T, class V, class E>
void Bellmanford(Graph<V, E>& G, int s, T INF_COST)
{
	auto &v = G.v;
	auto &e = G.e;
	for (auto& vv : v) vv.cost = INF_COST;
	v[s].cost = 0;
	v[s].valid = true;
	for (int i = 0; i + 1 < (int) v.size(); i++) {
		for (int j = 0; j < (int) v.size(); j++) {
			for (auto& x: e[j]) {
				if (v[j].cost == INF_COST) continue;
				v[x.to].cost = min(v[x.to].cost, v[j].cost + x.cost);
				v[x.to].valid = true;
			}
		}
	}
	auto valid_check = [&](auto f, int pos) {
		if (!v[pos].valid) return;
		v[pos].valid = false;
		for (auto& y: e[pos]) {
			f(f, y.to);
		}
	};
	for (int i = 0; i < (int) v.size(); i++) {
		for (auto& x: e[i]) {
			if (v[i].cost == INF_COST) continue;
			if (v[x.to].cost > v[i].cost + x.cost) {
				valid_check(valid_check, x.to);
			}
		}
	}
}


void solve(long long N, long long M, long long P, std::vector<long long> A, std::vector<long long> B, std::vector<long long> C) {
	graph g(N);
	for (int i = 0; i < M; i++) {
		g.add_edge(A[i]-1, B[i]-1, -(C[i] - P));
	}
	Bellmanford(g, 0, INT_MAX);
	if (!g.v[N-1].valid) cout << -1 << endl;
	else cout << max(-g.v[N-1].cost , 0) << endl;
}

signed main() {
	long long N;
	scanf("%lld",&N);
	long long M;
	scanf("%lld",&M);
	long long P;
	scanf("%lld",&P);
	std::vector<long long> A(M);
	std::vector<long long> B(M);
	std::vector<long long> C(M);
	for(int i = 0 ; i < M ; i++){
		scanf("%lld",&A[i]);
		scanf("%lld",&B[i]);
		scanf("%lld",&C[i]);
	}
	solve(N, M, P, std::move(A), std::move(B), std::move(C));
	return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <string>
using namespace std;
int main(){
    string text , testcase;
    int count = 0 , len;
    cin >> len >> text;
    for (int i = 0 ; i < len ; i++){
        if (text[i] == 'A' && text[i+1] == 'B' && text[i+2] == 'C')
            count++;
    }
    cout << count;
    return 0;
}

Measured memory_bytes: 256
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
using namespace std;
struct node
{
	int x,y;
}a[100010];
int n,m;
int f[200010][2];
bool cmp(node x,node y)
{
	return x.x<y.x;
}
int main()
{
	scanf("%d%d",&n,&m);
	for (int i=1;i<=m;i++)
	{
		scanf("%d%d",&a[i].x,&a[i].y);
	}
	sort(a+1,a+m+1,cmp);
	for (int i=1;i<=m;i++)
	{
		int t=a[i].y;
		f[t][1]=max(f[t+1][1]+1,f[t][1]);
		f[t+1][0]=max(f[t][0]+1,f[t+1][0]);
	}
	printf("%d",f[1][0]+f[1][1]+1);
	for (int i=2;i<=n;i++)
	{
		printf(" %d",f[i][0]+f[i][1]+1);
	}
	printf("\n");
    return 0;
}

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

  cout << fixed << setprecision(20);//結果が20桁で表示される

  int N, M; cin >> N >> M;
  double p=0;

  rep(i,N) {
    double temp = 1.0/N;
    int now = i;
    while (now < M){
      now *= 2;
      temp /= 2;
    }
    p += temp;
  }
  cout << p << endl;
  return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
dic = {i+1:a for i,a in enumerate(A)}
dic2 = sorted(dic.items(), key=lambda x:x[1])
ls = []
for i in range(len(dic2)):
    ls.append(dic2[i][0])

print(*ls, sep=" ")

Measured memory_bytes: 26676
#include<stdio.h>
int main( ){
  int n;
  scanf("%d",&n);
  for(int i=1;i<=n;i++){
    int a=i;
    if(i%3==0){
      printf(" %d",i);
    }else{
      while(a){
	if(a%10==3){
	  printf(" %d",i);
	  break;
	}
	a/=10;
      }
    }
  }
  printf("\n");
  return 0;
}

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

int main(){
        string s,p;
        int s_num = 0;
        int p_num = 0;
        bool discover =false;
        getline(cin,s);
        getline(cin,p);
        string s_search = s+s;
        //cout <<s_search << endl;
        for(int i = 0; i < s_search.length();i++){
                if(s_search[i]==p[0]){
                        for(int j =0; j < p.length();j++){
                                if(s_search[i+j] != p[j]){
                                        break;
                                }else if(j == p.length() -1&&s_search[i+j]== p[j]){
                                        cout << "Yes" << endl;
                                        discover = true;
                                }
                        }

                }
                if(discover == true)break;
        }
        if(discover == false)cout << "No" <<endl;

}


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

using namespace std;

typedef long long ll;

int main() {
    ll n;   cin >> n;
    ll *a = new ll[n];
    ll *l = new ll[n];
    ll *r = new ll[n];

    map<ll, ll> mr;

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

    ll ans = 0;
    for (ll i = 0; i < n; i++) {
        ans += mr[l[i]];
        mr[r[i]]--;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 30928
#include<bits/stdc++.h>
using namespace std;
#define sz(x) (int)x.size()
#define pb push_back
#define mp make_pair
#define ll long long 
#define mod 1000000007 
#define mod2 998244353
void fast(){
  ios_base::sync_with_stdio(false);cin.tie(NULL);
}
long long binpow(long long a, long long b) {
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

int main() {
   fast();
   long long n;
   cin>>n;
   long long sum=0;
   long long t=5;

   long long k=10;
   long long j=1;
   if(n%2==1){
    cout<<0<<"\n";
    return 0;
   }else{
      while(binpow(t,j)<=n){
        sum+=n/binpow(t,j);
        sum-=max(n-binpow(t,j),(ll)0)/(2*binpow(t,j))+1;
        j++;
      }
      cout<<sum<<"\n";
      return 0;
   }

   

}


Measured memory_bytes: 3624
#ifndef ATCODER_DSU_HPP
#define ATCODER_DSU_HPP 1

#include <algorithm>
#include <cassert>
#include <vector>

namespace atcoder {

// Implement (union by size) + (path compression)
// Reference:
// Zvi Galil and Giuseppe F. Italiano,
// Data structures and algorithms for disjoint set union problems
struct dsu {
  public:
    dsu() : _n(0) {}
    dsu(int n) : _n(n), parent_or_size(n, -1) {}

    int merge(int a, int b) {
        assert(0 <= a && a < _n);
        assert(0 <= b && b < _n);
        int x = leader(a), y = leader(b);
        if (x == y) return x;
        if (-parent_or_size[x] < -parent_or_size[y]) std::swap(x, y);
        parent_or_size[x] += parent_or_size[y];
        parent_or_size[y] = x;
        return x;
    }

    bool same(int a, int b) {
        assert(0 <= a && a < _n);
        assert(0 <= b && b < _n);
        return leader(a) == leader(b);
    }

    int leader(int a) {
        assert(0 <= a && a < _n);
        if (parent_or_size[a] < 0) return a;
        return parent_or_size[a] = leader(parent_or_size[a]);
    }

    int size(int a) {
        assert(0 <= a && a < _n);
        return -parent_or_size[leader(a)];
    }

    std::vector<std::vector<int>> groups() {
        std::vector<int> leader_buf(_n), group_size(_n);
        for (int i = 0; i < _n; i++) {
            leader_buf[i] = leader(i);
            group_size[leader_buf[i]]++;
        }
        std::vector<std::vector<int>> result(_n);
        for (int i = 0; i < _n; i++) {
            result[i].reserve(group_size[i]);
        }
        for (int i = 0; i < _n; i++) {
            result[leader_buf[i]].push_back(i);
        }
        result.erase(
            std::remove_if(result.begin(), result.end(),
                           [&](const std::vector<int>& v) { return v.empty(); }),
            result.end());
        return result;
    }

  private:
    int _n;
    // root node: -1 * component size
    // otherwise: parent
    std::vector<int> parent_or_size;
};

}  // namespace atcoder

#endif  // ATCODER_DSU_HPP

#include <cstdio>

using namespace std;
using namespace atcoder;

int main() {
    int n, q;
    scanf("%d %d", &n, &q);
    dsu d(n);
    for (int i = 0; i < q; i++) {
        int t, u, v;
        scanf("%d %d %d", &t, &u, &v);
        if (t == 0) {
            d.merge(u, v);
        } else {
            if (d.same(u, v)) {
                printf("1\n");
            } else {
                printf("0\n");
            }
        }
    }
    return 0;
}

Measured memory_bytes: 3464
from collections import deque
N = int(input())
A = [int(i) for i in input().split()]
A.sort()
A = deque(A)
m = A.popleft()
ans = []
while len(A)>1:
  if A[-2]<=0:
    break
  x = A.pop()
  ans += [(m,x)]
  m = m-x
for i in range(len(A)-1):
  ans += [(A[-1],A[i])]
  A[-1] = A[-1]-A[i]

ans += [(A[-1],m)]
print(A[-1]-m)
for a in ans:
  print(*a)

Measured memory_bytes: 20296
n = int(input())
l = [[0, 0] for _ in range(n)]
for i in range(n):
  x, y = map(int, input().split())
  l[i][0] = x
  l[i][1] = y

import math
if n == 2:
  r = math.sqrt((l[1][0]-l[0][0])**2+(l[1][1]-l[0][1])**2)/2
  print(r)
  exit()

ans = float('inf')
import itertools
combs = list(itertools.combinations(range(n), 3))
for comb in combs:
  x0, y0 = l[comb[0]]
  x1, y1 = l[comb[1]]
  x2, y2 = l[comb[2]]
  
  a = x1 - x0
  b = y1 -y0
  p = (x1**2-x0**2+y1**2-y0**2)/2
  
  c = x2 - x0  
  d = y2 -y0
  q = (x2**2-x0**2+y2**2-y0**2)/2
  
  if a*d - b*c == 0:
    continue
  xc = (p*d-q*b)/(a*d-b*c)
  yc = (-p*c+q*a)/(a*d-b*c)
  r = math.sqrt((x0-xc)**2+(y0-yc)**2)
  for i in range(n):
    x, y = l[i]
    if math.sqrt((x-xc)**2+(y-yc)**2) > r:
      break
  else:
    ans = min(ans, r)

combs = list(itertools.combinations(range(n), 2))
for comb in combs:
  x0, y0 = l[comb[0]]
  x1, y1 = l[comb[1]]
  xc = (x0+x1)/2
  yc = (y0+y1)/2
  r = math.sqrt((x0-xc)**2+(y0-yc)**2)
  for i in range(n):
    x, y = l[i]
    if math.sqrt((x-xc)**2+(y-yc)**2) > r:
      break
  else:
    ans = min(ans, r)
print(ans)

Measured memory_bytes: 4724
fun main(args: Array<String>) {
    val s = readLine()!!
    var right = s.length - 1
    var ans = 0L
    for (i in s.length-1 downTo 0) {
        if (s[i] == 'B') {
            ans += right - i
            right--
        }
    }
    println(ans)
}

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

int main()
{
    string s;
    cin>>s;
    bool b1,b2;
    b1=false;
    b2=false;
    if((s[0]=='1' && ((int)s[1]>=48 && (int)s[1]<=50))|| (s[0]=='0' &&(int)s[1]>=49 &&(int)s[1]<=57)){
        b1=true;
    }
    if((s[2]=='1' && ((int)s[3]>=48 && (int)s[3]<=50))|| (s[2]=='0' &&(int)s[3]>=49 &&(int)s[3]<=57)){
    	b2=true;
    } 
    if(b1&&b2){
    	cout << "AMBIGUOUS" << endl;
        return 0;
    }else if(b1){
    	cout << "MMYY" << endl;
        return 0;
    }else if(b2){
    	cout << "YYMM" << endl;
        return 0;
    }else{
    	cout << "NA" << endl;
        return 0;
    }

}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <queue>
using namespace std;
#define loop(i,N) for(ll (i)=0; (i)<(N);++(i))
struct TEMP_OMAZINAI_ { TEMP_OMAZINAI_() { std::ios::sync_with_stdio(false); std::cin.tie(0); } } TEMP__omazinai_instance__;
#define INF ((1LL<<61) + (1<<29))
#define YesNo(x) {std::cout << ((x)?"Yes":"No") << std::endl;}
#define YESNO(x) {std::cout << ((x)?"YES":"NO") << std::endl;}
#define OddEven(x) {std::cout << ((x)%2?"Odd":"Even") << std::endl;}
#define ODDEVEN(x) {std::cout << ((x)%2?"ODD":"EVEN") << std::endl;}
typedef long long int ll;
ll my_gcd(ll a, ll b) { return b ? my_gcd(b, a%b) : a; };
void TEMP_INPUT_IMPL_() {};
template <class T, class... Args> void TEMP_INPUT_IMPL_(T& dest, Args&... args) { cin >> dest; TEMP_INPUT_IMPL_(args...); }
void TEMP_OUTPUT_IMPL_() {};
template <class T, class... Args> void TEMP_OUTPUT_IMPL_(T dest, Args... args) { cout << dest << (sizeof...(Args) ? " " : ""); TEMP_OUTPUT_IMPL_(args...); }
#define in(type, ...) type __VA_ARGS__; TEMP_INPUT_IMPL_(__VA_ARGS__)
#define in_v(type, name, cnt) vector<type> name(cnt); loop(i, cnt) cin >> name[i];
#define sort_v(v) std::sort(v.begin(), v.end())
#define unique_v(v) v.erase(std::unique(v.begin(), v.end()), v.end()) //必ずソート後に実行
#define out(...) (TEMP_OUTPUT_IMPL_(__VA_ARGS__), std::cout<<std::endl)
#define set_fix(x) ((std::cerr<<std::fixed<<std::setprecision(x)),(std::cout<<std::fixed<<std::setprecision(x)))
//小さい方に寄る
#define space_op(x, y, a, b, c) ([](auto x_, auto y_, auto a_, auto b_, auto c_){if(x_<y_)return a_;if(x_>y_)return c_;return b_;}(x,y,a,b,c))
#define space_out(x, y, a, b, c) out(space_op(x, y, a, b, c))

// ^^^ Template ^^^ //


int main() {
	in(unsigned long long, A, B, C);
	unsigned long long c = 0;
	while (A % 2 == 0 && B % 2 == 0 && C % 2 == 0) {
		unsigned long long
		   A2 = B/2 + C/2
		 , B2 = C/2 + A/2
		 , C2 = A/2 + B/2
		;
		if (A == B && B == C) {
			cout << -1 << endl;
			return 0;
		}
		A = A2;
		B = B2;
		C = C2;
		++c;
	}
	cout << c << endl;
	return 0;
}


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

int ans = 0x3f3f3f3f, a, b, c, l[100];
int n;

inline void dfs(int pos, int A, int B, int C, int res) {
    if (pos > n) {
        if (A == 0 || B == 0 || C == 0) return ;
        ans = min(ans, res + abs(a - A) + abs(B - b) + abs(C - c));
        return ;
    }
    dfs(pos + 1, A + l[pos], B, C, res + (A != 0) * 10);
    dfs(pos + 1, A, B + l[pos], C, res + (B != 0) * 10);
    dfs(pos + 1, A, B, C + l[pos], res + (C != 0) * 10);
    dfs(pos + 1, A, B, C, res);
}

int main() {
    cin >> n >> a >> b >> c;
    for (int i = 1; i <= n; ++i)
        cin >> l[i];
    dfs(1, 0, 0, 0, 0);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define range(i,a,n) for(ll i=(a);i<(n);i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}
template<class S>void tf(bool b,S t,S f){cout<<(b?t:f)<<endl;}
void OUT(bool b){tf(b,"YES","NO");}
void Out(bool b){tf(b,"Yes","No");}
void out(bool b){tf(b,"yes","no");}
template<class T>void puta(T&&t){cout<<t<<endl;}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}

int popcnt(int x){return __builtin_popcount(x);}
int popcnt(ll x){return __builtin_popcountll(x);}
int bsr(int x){return 31 - __builtin_clz(x);}
int bsr(ll x){return 63 - __builtin_clzll(x);}
int bsf(int x){return __builtin_ctz(x);}
int bsf(ll x){return __builtin_ctzll(x);}
template<class T>T chmax(T&a,T b){return a=a>b?a:b;}
template<class T>T chmin(T&a,T b){return a=a<b?a:b;}

/*他のライブラリを入れる場所*/

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,a,b;
	cin>>n>>a>>b;
	vi p(n);
	vi c(3,0);
	rep(i,n){
		cin>>p[i];
		if(p[i]<=a)c[0]++;
		else if(p[i]>b)c[2]++;
		else c[1]++;
	}
	cout<<*min_element(all(c))<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Yes                \
    cout << "Yes" << endl; \
    return 0;
#define No                \
    cout << "No" << endl; \
    return 0;
using namespace std;
using ll = long long;
const int INF = 1001001001;
const int MOD = 1000000007;
typedef long long ll;

template <typename T>
void print(const T &v);

int main()
{
    int a, b, c, k;
    cin >> a >> b >> c >> k;
    if (a >= k)
    {
        cout << k << endl;
        return 0;
    }
    else if (a + b >= k)
    {
        cout << a << endl;
        return 0;
    }
    else
    {
        cout << a - (k - a - b) << endl;
        return 0;
    }
}

// Use For Debug
template <typename T>
void print(T const &v)
{
    for (int i = 0; i < v.size(); i++)
    {
        if (i)
            cout << " ";
        cout << v[i];
    }
    cout << endl;
}


Measured memory_bytes: 3672
w, a, b = map(int, input().split())
if( b >= a):
	wb = b
	wa = a + w
	if(wa >= wb ):
		print (0)
	else:
		print (wb - wa)
else:
	wa = a
	wb = b + w
	if(wb >= wa ):
		print (0)
	else:
		print (wa - wb)


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

#define Fast ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)
#define FO freopen("in.txt", "r", stdin)
#define FC freopen("out.txt", "w", stdout)
#define aise cout<<"aise"<<endl
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define mp make_pair
#define ll long long
#define all(x) x.begin(), x.end()
#define mset(v, a) memset(v, a, sizeof(v))
#define pll pair< ll, ll >
#define pdd pair< double, double >
#define ff first
#define ss second
#define pi acos(-1.0)
#define mxN 2010
#define inf 1e14
#define MOD 1000000007

int main()
{

    ll n;
    cin >> n;
    vector<ll> v;
    for(ll i = 0; i < n; i++)
    {

        ll x;
        cin >> x;
        v.pb(x);
    }
    vector<ll> ans(n);
    ll i = 0, j = n-1;
    ll idx = n-1, st = 1;
    while(1)
    {

        if(idx<0) break;
        if(st%2)
        {

            ans[i]=v[idx];
            i++;
        }
        else
        {

            ans[j]=v[idx];
            j--;
        }
        idx--;
        st++;
    }
    for(ll i = 0; i < n; i++) cout << ans[i] << " ";
}


Measured memory_bytes: 5488
#include <bits/stdc++.h>
#define ll long long

using namespace std;
set < char > st;
int suff[200100];
bool f[200100];
char c[200100];
deque < char > Q;
int main()
{
    string s;  cin >> s;
    int q;  cin >> q;
    for(int i = 0;i<q;i++){
        int t;  cin >> t;
        if(t == 1)  suff[i]++;
        else {
            int x;
            cin >> x >> c[i];
            x == 1 ? f[i] = 1 : f[i] = 0;
        }
    }
    for(int i = q - 2;i>=0;i--)  suff[i]+=suff[i + 1];
    if(suff[0] % 2 != 0){
        for(int i = s.size() - 1;i>=0;i--)  Q.push_back(s[i]);
    }
    else {
        for(int i = 0;i<s.size();i++)  Q.push_back(s[i]);
    }
    for(int i = 0;i<q;i++){
        if(isalpha(c[i])){
            if(suff[i + 1] % 2 != 0){
                f[i] = !f[i];
            }
            if(!f[i])  Q.push_back(c[i]);
            else  Q.push_front(c[i]);
        }
    }
    for(auto it : Q)  cout << it;
    return 0;
}


Measured memory_bytes: 2176
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <math.h> // sqrt
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <iomanip> // setprecision
#include <bitset> // bitset
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vb = vector<bool>;
using vll = vector<long long>;
using pii = pair<int, int>;
using psi = pair<string, int>;

int main() {
    int N;
    cin >> N;
    vector<pair<ll, ll>> data1(N);
    vector<pair<ll, ll>> data2(N);
    for (int i = 0; i < N; i++) {
        ll a, b;
        cin >> a >> b;
        pair<ll, ll> p = make_pair(a + b, a - b);
        data1[i] = p;
        pair<ll, ll> p2 = make_pair(a - b, a + b);
        data2[i] = p2;
    }
    sort(data1.begin(), data1.end());
    sort(data2.begin(), data2.end());
    ll ans = max(data1[N - 1].first - data1[0].first, data2[N - 1].first - data2[0].first);
    cout << ans << endl;
}


Measured memory_bytes: 9584
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

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

    cout << min(a * n, b) << endl;

    return 0;
}

Measured memory_bytes: 764
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		boolean flg = true;
		for(int i=0;i<N;i++) {
			int x = sc.nextInt();
			if(x%2==0) {
				if(x%3!=0&&x%5!=0) {
					flg = false;
				}
			}
		}
		if(flg) {
			System.out.println("APPROVED");
		} else {
			System.out.println("DENIED");
		}

	}
}

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

using namespace std;

#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define sz(s) (int)s.size()

int main() {
    int n, m, x;
    cin >> n >> m >> x;
    vector<int> gate(n + 2, 0);
    rep(i, 0, m) {int a; cin >> a; gate[a]++;}
    int lef = 0;
    for (int i = x; i >= 0; --i) lef += gate[i];
    int rig = 0;
    for (int i = x; i <= n; ++i) rig += gate[i];
    cout << min(lef, rig) << endl;
}

Measured memory_bytes: 256
#include<bits//stdc++.h>
using namespace std;
int main(){
  int a,b,c,d;cin >> a >> b >> c >> d;
  if(max(c,a) - min(d,b) < 0) cout << abs(max(c,a) - min(d,b)) << endl; 
   else cout <<  0 << endl;
}

Measured memory_bytes: 256
# Here your code !
    a, b, c, de, e ,f = gets.chomp.split.map &:to_i
    t = Array.new(30, 0)
    t[0] = 1
    max = 0
    i = 0
    while true
      (li = i + a)
      t[li] = 1 if(li < 30 and t[i] == 1)
      (li = i + b)
      t[li] = 1 if(li< 30 and t[i] == 1)
      i += 1
      break if(i == 30)
    end
    tt = Array.new(3001, 0)
    i = 0
    tt[0] = 1
    while true
      (li = i + c)
      tt[li] = 1 if(li < 3001 and tt[i] == 1)
      (li = i + de)
      tt[li] = 1 if(li < 3001 and tt[i] == 1)
      i += 1
      break if(i == 3001)
    end
    ans = [a*100, 0]
    i = 0
    at = []
    tt.each.with_index do |d, i|
      if(d == 1)
        at.push(i)
      end
    end
    aat = []
    t.each.with_index do |d, i|
      if(d == 1)
        aat.push(i)
      end
    end
    ni = 1
    at.each do |d|
      aat.each do |df|
        if(df*100 + d <= f and d  <= df * e)
          if(max <= d/(df.to_f * 100 + d))
            ans = [df*100 + d, d]
            (max = d/(df * 100 + d).to_f)
          end
        end
      end
    end
    puts "#{ans[0]} #{ans[1]}"


Measured memory_bytes: 1916
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) (x=min(x,y))
#define chmax(x,y) (x=max(x,y))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

int main(){
	ll n;
	cin>>n;
	vector<ll> a(n), b(n);
	rep(i, n) cin>>a[i];
	rep(i, n) cin>>b[i];
	sort(all(a)); sort(all(b));
	ll res = 1;
	rep(i, n){
		ll t;
		if(a[i]<=b[i]){
			t = i-(lower_bound(all(b), a[i])-b.begin())+1;
		} else {
			t = upper_bound(all(b), a[i])-b.begin()-i;
		}
		(res*=t)%=mod;
	}
	cout<<res<<endl;
	return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)
#include <boost/unordered_set.hpp>

int main(){
    int n{},a,c;
    while((c=getchar_unlocked()-'0')>=0) n*=10,n+=c;
    boost::unordered_set<int> mp;
    fr(i,n){
        a=0;
        while((c=getchar_unlocked()-'0')>=0) a*=10,a+=c;
        if(mp.count(a)){
            putchar_unlocked('N');
            putchar_unlocked('O');
            putchar_unlocked('\n');
            return 0;
        }
        mp.insert(a);
    }
    putchar_unlocked('Y');
    putchar_unlocked('E');
    putchar_unlocked('S');
    putchar_unlocked('\n');
}

Measured memory_bytes: 10932
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>

using namespace std;
typedef long long ll;

#define INF (long long)(10e9+7)
#define REP(i,n) for(ll i = 0; i < n; i++)

int H[1100];

int main(void)
{
    int N, T, A;
    cin >> N >> T >> A;
    REP(i, N) cin >> H[i];

    int res;
    double d = INF;

    REP(i, N) {
        double temp = T - H[i] * 0.006;
        if(abs(A - temp) < d) {
            d = abs(A - temp);
            res = i;
        }
    }
    cout << res+1 << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    int[] A = new int[9];
    int N;
    int[] b;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        for (int i=0; i<9; i++) {
        	A[i] = sc.nextInt();
        }
        N = sc.nextInt();
        b = new int[N];
        for (int i=0; i<N; i++) {
        	b[i] = sc.nextInt();
        }
    }
    
    //解答処理
    private boolean solve() {
        boolean judge = false;
        boolean[] mark = new boolean[9];
        
        for (int i=0; i<N; i++) {
        	for (int j=0; j<9; j++) {
        		if (b[i] == A[j]) {
            		mark[j] = true;
            	}
        	}
        }
        
        if (mark[0] && mark[1] && mark[2]) {
        	judge = true;
        } else if (mark[3] && mark[4] && mark[5]) {
        	judge = true;
        } else if (mark[6] && mark[7] && mark[8]) {
        	judge = true;
        } else if (mark[0] && mark[4] && mark[8]) {
        	judge = true;
        } else if (mark[0] && mark[3] && mark[6]) {
        	judge = true;
        } else if (mark[1] && mark[4] && mark[7]) {
        	judge = true;
        } else if (mark[2] && mark[5] && mark[8]) {
        	judge = true;
        } else if (mark[2] && mark[4] && mark[6]) {
        	judge = true;
        }
        
        return judge;
    }
    
    //出力
    public void show(boolean judge) {
        if (judge) {
        	System.out.println("Yes");
        } else {
        	System.out.println("No");
        }
    }

}


Measured memory_bytes: 35636
mod = 10 ** 9 + 7

k,*_ = gets.split.map(&:to_i)
n = 3

a = [1] * (k+1)
b = Array.new(k+1){|i| i }

(k/2).downto(1) do |i|
  cnt = ( k/i ).pow( n, mod )
  (i*2).step(k, i){|j| cnt = ( cnt - a[j] ) % mod }
  a[i] = cnt
  b[i] = i * cnt % mod
end

ans = 0
(1..k).each do |i|
  ans += b[i]
  ans %= mod if ans >= mod
end

puts ans

Measured memory_bytes: 14368
#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
#define all(n)  n.begin(),n.end()
#define rall(n) n.rbegin(),n.rend()
typedef long long ll;
const ll INF = 2147483647;
const ll MOD = 1e9 + 7;
const double EPS = 1e-10;
const double pi = acos(-1);//3.1415926535897932384626433832795028...
const ll SIZE = 1 << 17;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30];
ll fac[200005], finv[200005], inv[200005];
vector<ll>dij;
struct edge { ll to, cost; };
vector<vector<edge> >G;

ll mod_pow(ll a, ll b) {
	ll res = 1, mul = a;
	for (int i = 0; i < 31; ++i) {
		if (b >> i & 1) {
			res *= mul;
			res %= MOD;
		}
		mul = (mul * mul) % MOD;
	}
	return res;
}

void addedge(int from, int to, int cost) {
	G[from].push_back({ to,cost });
	G[to].push_back({ from,cost });
}

template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}

template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T & t, const V & v) { t = v; }

template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T & t, const V & v) {
	for (auto& e : t) fill_v(e, v);
}

template<typename T>
void outp(vector<T>v) {
	for (int i = 0; i < v.size(); ++i) {
		cout << v[i];
		if (i != v.size() - 1) { cout << " "; }
	}
}

double add(double a, double b) {
	if (abs(a + b) < EPS * (abs(a) + abs(b))) { return 0; }
	return a + b;
}

double len(int a, int b, int c, int d) {
	return (double)sqrt((a - c) * (a - c) + (b - d) * (b - d));
}

int main() {
	int n;
	string h;
	cin >> n >> h;
	if (n % 2 == 1 || h.substr(0, n / 2) != h.substr(n / 2)) { cout << "No" << endl; }
	else { cout << "Yes" << endl; }
}

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

int main(){
    
    // 1. 入力情報.
    LL A, B, N;
    scanf("%lld %lld %lld", &A, &B, &N);
    
    // 2. 非負整数 x を 計算.
    LL x = (N >= B) ? max(B - 1LL, 1LL) : N;
    
    // 3. 最大値を計算.
    LL ans = A * x / B - A * (x / B);
    
    // 4. 出力.
    printf("%lld\n", ans);
    return 0;
    
}

Measured memory_bytes: 3792
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <map>
#include <set>
#include <sstream>
#include <stdio.h>
#include <cstdio>
#include <cstring>
#include <math.h>

using namespace std;

#define Rep(i,a,b) for(int i = a; i < b; i++)
#define rep(i,b) Rep(i,0,b)
#define rrep(i,a) for(int i = a; i >= 0; i--)
#define allof(a) (a).begin(), (a).end()

typedef long long ll;
const int inf = 1e9 + 7;
const ll infll = 1ll << 60ll;
const ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

/*
// 最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

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


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

	int a, b, t;
	cin >> a >> b >> t;

	int ans = t / a;
	ans *= b;

	cout << ans << endl;

	return 0;
}

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

int main()
{
	int n, t {}, h {};
	std::string a, b;
	std::cin >> n;
	for (int i=0; i!=n; ++i) {
		std::cin >> a >> b;
		a == b ? ++t, ++h : a > b ? t += 3 : h += 3;
	}
	std::cout << t << ' ' << h << '\n';
}

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

int main()
{
  char q;
  cin >> q;
  if(q=='A')
  {
  cout << 'T' << endl;
  }
  if(q=='T')
  {
  cout << 'A' << endl;
  }
  if(q=='C')
  {
  cout << 'G' << endl;
  }
  if(q=='G')
  {
  cout << 'C' << endl;
  }
}

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

class Cube{
public:
  int f[6];
  Cube(){}
  void roll_z(){roll(1,2,4,3);}
  void roll_y(){roll(0,2,5,3);}
  void roll_x(){roll(0,1,5,4);}
  void roll(int i,int j,int k, int l){
      int t=f[i];f[i]=f[j];f[j]=f[k];f[k]=f[l];f[l]=t;
  }
  void move(char ch){
      if(ch=='E')for(int i=0;i<3;i++)roll_y();
      if(ch=='W')roll_y();
      if(ch=='N')roll_x();
      if(ch=='S')for(int i=0;i<3;i++)roll_x();
  }
};

int main(){
    Cube c;
    string com;
    for(int i=0;i<6;i++){
        cin>>c.f[i];
    }
    cin>>com;
    for(int i=0;i<com.size();i++)c.move(com[i]);
    cout<<c.f[0]<<endl;
    return 0;
}


Measured memory_bytes: 3212
#include<bits/stdc++.h>
#define N 200005
using namespace std;
int n,m;
map<int,int>mp;
int a[N],b[N];
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++)scanf("%d",&a[i]),mp[a[i]]++;
    cin>>m;
    for(int i=1;i<=m;i++)
    {
        scanf("%d",&b[i]);
        if(mp[b[i]]<=0)
        {
            puts("NO");
            return 0;
        }
        mp[b[i]]-=1;
    }
    puts("YES");
    return 0;
    sort(a+1,a+n+1);
    sort(b+1,b+m+1);
    if(n<m)
    {
        puts("NO");
    }
    else
    {
        for(int i=n;i>=n-m+1;i--)
        {
            if(b[m-n+i]>a[i])
            {
                puts("NO");
                return 0;
            }
        }
        puts("YES");
    }
    return 0;
}

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

int main()
{
	int a;
	cin >> a;
	int b;
	cin >> b;
	string c;
	cin >> c;
	if (c[b - 1] == 'A') {
		c[b - 1] = 'a';
	}
	if (c[b - 1] == 'B') {
		c[b - 1] = 'b';
	}
	if (c[b - 1] == 'C') {
		c[b - 1] = 'c';
	}
	cout << c << endl;
}

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

int main() {
  // ここにプログラムを追記
  int A, B;
  cin >> A >> B;
  if((A + B) % 2) cout << (A + B + 1) / 2 << endl;
  else cout << (A + B) / 2 << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>

int main(void){
    int n,i;
    double s[1001]={};
    double ave,vari,sd,sum;

    while(scanf("%d", &n) != EOF && n!=0){
        for(i=0,sum=0;i<n;i++){
            scanf("%lf",&s[i]);
            sum += s[i];
        }
        ave = sum / n;
        for(i=0,vari=0;i<n;i++) vari += (s[i] - ave)*(s[i] - ave);
        sd = sqrt(vari / n);
        printf("%lf\n", sd);
        }
    return(0);
}

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

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

long lcm(long a, long b) { return a / gcd(a, b) * b; }

int main() {
  int n;

  cin >> n;

  vector<long> t(n);

  cin >> t[0];

  for (int i = 1; i < n; i++) {
    cin >> t[i];
    t[i] = lcm(t[i - 1], t[i]);
  }

  cout << t[n - 1];

  return 0;
}

Measured memory_bytes: 256
using System;
namespace ABC143A
{
    public class EmptyClass
    {
        public static void Main(string[] args)
        {
            int[] inp = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            int x = inp[1] * 2;
            Console.WriteLine(x >= inp[0] ? 0 : inp[0] - x);
        }
    }
}


Measured memory_bytes: 13140
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define All(V) V.begin(), V.end()
typedef long long int ll;
typedef pair<int, int> P;
const ll MOD = 1e9+7, INF = 1e9;

int main()
{
  int a, b, c, d; cin >> a >> b >> c >> d;
  int cnt = 0;
  while(a > 0 && c > 0){
    if(cnt % 2 == 0){
      c -= b;
    }
    else a -= d;
    cnt++;
  }
  if(a <= 0){
    cout << "No" << endl;
  }
  else cout << "Yes" << endl;
  system("pause");
}

Measured memory_bytes: 3700
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author champon
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for(ll i=0; i<n; i++)
#define repr(i, s, e) for(ll i=s; i>=e; i--)
#define reps(i, s, e) for(ll i=s; i<=e; i++)
#define inf 1e18
#define all(v) v.begin(),v.end()
#define ceill(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
#define sp << " " <<
void ans(bool b){ cout << (b ? "Yes" : "No") << endl; }
void ans2(bool b){ cout << (b ? "YES" : "NO") << endl; }
template<typename T> inline bool chmax(T &a, T b){ if(a<b) a=b; return a<b; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a) a=b; return b<a; }
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    fill((T*)array, (T*)(array+N), val);
}
template<typename T> void vdeb(T v){
    cout << "#vector set debug" << endl;
    for(auto vv : v) cout << vv << " ";
    cout << endl;
}
template<typename T1, typename T2> void adeb(T1 arr[], T2 n){
    cout << "#adebug" << endl;
    for(int i=0; i<=n; i++) cout << arr[i] << " ";
    cout << endl;
}
template<typename T1> void mdeb(T1 mp){
    cout << "#map pair debug" << endl;
    for(auto const& m : mp) cout << m.first sp m.second << endl;
}
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};


class ANextAlphabet {
public:
	void solve(std::istream& in, std::ostream& out) {
        char c;
        in >> c;
        out << char(c + 1) << endl;
	}
};


int main() {
	ANextAlphabet solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <list>
#include <math.h>
#include <algorithm>
#include <functional>
#include <string>
#include <iomanip>
#include <queue>
#include <map>
#include <unordered_map>
typedef long long ll;
using namespace std;

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


	if(a >= 3200){
		std::cout << s << std::endl;
	}else{
		std::cout << "red" << std::endl;
	}


}

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

def main():
    ans = 0
    for i in range(1, N + 1):
        if i % 2 == 0: continue
        divs = list(filter(lambda x: i % x == 0, range(1, i + 1)))
        if len(divs) == 8:
            ans += 1
    print(ans)

if __name__ == "__main__":
    main()

Measured memory_bytes: 3060