akhauriyash/Code-Regression huggingface dataset:
#include <unordered_map>
#include <functional>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <tuple>
#include <set>
#include <map>

#define FOR0(var, max) for (ul (var) = 0; (var) < (max); ++(var))
#define FORi(var, min, max) for (ul (var) = (min); (var) < (max); ++(var))
#define FORi_INV(var, min, max) for (ul (var) = (max) - 1; (var) + 1 > (min); --(var))
#define FORITER(var, iter) for (auto (iter) = (var).begin(); (iter) != (var).end(); (iter)++)
#define FORITER_INV(var, iter) for (auto (iter) = (var).rbegin(); (iter) != (var).rend(); (iter)++)

#define LTLT(a, b, c) (((a) < (b)) && ((b) < (c)))
#define LELT(a, b, c) (((a) <= (b)) && ((b) < (c)))
#define LTLE(a, b, c) (((a) < (b)) && ((b) <= (c)))
#define LELE(a, b, c) (((a) <= (b)) && ((b) <= (c)))

using namespace std;

using uc = unsigned char;
using ui = unsigned int;
using ul = unsigned long long int;

using sc = signed char;
using si = signed int;
using sl = signed long long int;

const static ul NMAX = 1000000000000ULL;

static ul N;

std::set<ul> divisors(const ul& n) {
  std::set<ul> div;
  for (ul i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      div.insert(i);
      if (n / i != i) {
        div.insert(n / i);
      }
    }
  }
  if (n == 1) {
    div.insert(1);
  }
  return div;
}

void solve(void) {
  set<ul> divs = divisors(N);
  ul min_count = NMAX;
  FORITER(divs, it) {
    ul coord_x = *it;
    ul coord_y = N / (*it);
    min_count = min(min_count, coord_x + coord_y - 2);
    // cout << coord_x << ", " << coord_y << endl;
  }
  cout << min_count << endl;
}

int main(void) {
  cin >> N;
  solve();
  return 0;
}

Measured memory_bytes: 512
import math
while True:
    a, x, b = input().split()
    a=int(a)
    b=int(b)
    if x == '?':
        break
    
    if x == '+':
        print(a+b)
        
    elif x == '-':
        print(a-b)
    
    elif x == '*':
        print(a*b)
    else:
        print(math.floor(a/b))


Measured memory_bytes: 5664
#include <iostream> 
#include <vector>
using namespace std;
void remove(vector<int> &circle,int d_p){
  vector<int>::iterator tmp = circle.begin();
  tmp = tmp + d_p;
  circle.erase(tmp);
}
int solve(vector<int> &circle){
  return circle[0];
}
void init(vector<int> &vec){
  for(int i = 0;i < vec.size();i++){
    vec[i] = i;
  }
}
int main(){
  /*  vector<int> a(3,0);
  a[0] = 1;a[1] = 4;
  vector<int>::iterator tmp =a.begin();
  tmp = tmp + 2;
  a.erase(tmp);
  cout << a.size() << a[0] << a[1]<<endl;
  return 0;*/
  while(1){
    int n,k,m;
    cin >> n >> k >> m;
    if(n == 0 && k == 0 && m == 0)break;
    vector<int> circle(n);
    init(circle);
    int cnt = 0;
    int current = m-1;
    //    circle[current] = -1;
    //cnt++;
    remove(circle,current);
    cnt++;
    while(1){
      if(n-1 == cnt)break;
      current = (k + current - 1)%circle.size();
      remove(circle,current);
      cnt++;
    }
    cout << solve(circle)+1 << endl;
  }
  return 0;
  
}

Measured memory_bytes: 1252
#include <iostream>
#include <unordered_map>

void add_value(std::unordered_map<int, int> &map, int value)
{
    if(!map.count(value))
    {
        map.insert(std::make_pair(value, 1));
    }else{
        map[value]++;
    }
}

int main()
{
    int size, i, n, max = -10000000;
    std::cin >> size;
    std::unordered_map<int, int> map;
    for(i = 0;i < size;++i)
    {
        std::cin >> n;
        add_value(map, n + 1);
        add_value(map, n - 1);
        add_value(map, n);
    }

    for(std::pair<int, int> value : map)
    {
        if(max < value.second)
        {
            max = value.second;
            n = value.first;
        }
    }

    std::cout << map[n] << std::endl;

    return 0;

}

Measured memory_bytes: 4260
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int n,a[1<<18],ans,c[1<<20],b[1<<20];
basic_string<int> v[1<<20];
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",a+i),c[a[i]]++;
	for(int i=1;i<(1<<20);i++)for(int j=i;j<(1<<20);j+=i)b[j]+=c[i];
	for(int i=1;i<=n;i++)if(b[a[i]]==1)ans++;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 45188
#include<bits/stdc++.h>
using namespace std;
int a[305][305];
int vis[305][305];
int n,m,k;
void dfs(int i,int j,int val)
{
    vis[i][j]=1;
    a[i][j]=val;
    if(i+1<n&&a[i+1][j]==0)
        dfs(i+1,j,val);
    if(i-1>=0&&a[i-1][j]==0)
        dfs(i-1,j,val);
}
int main()
{
    cin>>n>>m>>k;
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<m; j++)
        {
            char ch;
            cin>>ch;
            if(ch=='#')
                a[i][j]=k--;
        }
    }
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<m; j++)
        {
            if(a[i][j]!=0&&vis[i][j]==0)
                dfs(i,j,a[i][j]);
        }
    }
    for(int j=0; j<m; j++)
    {
        if(a[0][j]==0)
        {
            for(int i=0; i<n; i++)
            {
                if(j==0)
                    a[i][j]=a[i][j+1];
                else
                    a[i][j]=a[i][j-1];
            }
        }
    }
    for(int j=m-1; j>=0; j--)
    {
        if(a[0][j]==0)
        {
            for(int i=0; i<n; i++)
            {
                if(j==m-1)
                    a[i][j]=a[i][j-1];
                else
                    a[i][j]=a[i][j+1];
            }
        }
    }
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<m; j++)
        {
            cout<<a[i][j]<<' ';
        }
        cout<<endl;
    }
    return 0;
}


Measured memory_bytes: 1536
#include<iostream>
#include<cstdio>

using namespace std;

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

int main() {
  int n;
  cin >> n;
  while (n--) {
    long long bit;
    cin >> hex >> bit;
    if (bit & 1LL << 31) cout << "-";
    bit &= (1LL << 31) - 1;
    bit *= 78125;
    cout << bit / 10000000;
    bit %= 10000000;
    if (bit == 0) {
      cout << ".0" << endl;
      continue;
    }
    int k = 7;
    while (bit % 10 == 0) {
      bit /= 10;
      --k;
    }
    printf(".%0*lld\n", k, bit);
  }
  return 0;
}

Measured memory_bytes: 1208
#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 <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#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 <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <iomanip>
using namespace std;
#define int long long

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

    int n; cin >> n;
    vector<int> d1(n),d2(n);
    for(int i = 0;i < n;i ++){
        cin >> d1.at(i) >> d2.at(i);
    }

    int hantei = 0;
    for(int i = 2;i < n;i ++){
        if(d1.at(i-2) == d2.at(i-2) && d1.at(i-1) == d2.at(i-1) && d1.at(i) == d2.at(i)){
            hantei = 1;
        }
    }

    if(hantei == 1) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long int n,k;
  cin>>n>>k;
  string s;
  cin>>s;
  for(int i=0;i<n;i++)
  {
    if(i==k-1)
    {
      s[i]=s[i]+32;
    }
  }
  cout<<s;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;pair<string,int> a[100];int main(){int t=0,g,i;while(cin>>a[t].first>>a[t].second)t++;sort(a,a+t);string f,b=a[0].first;cout<<b<<endl<<a[0].second;for(i=1;i<t;i++){bool n=0;f=a[i].first,g=a[i].second;if(f==b)n=1;if(n)cout<<" "<<g;else cout<<endl<<f<<endl<<g;b=f;}cout<<endl;return 0;}

Measured memory_bytes: 1228
#include <iostream>

using namespace std;

int main()
{
   int x;
   cin >> x;
   if (x<=599) cout << 8;
   else if (x<=799) cout << 7;
   else if (x<=999) cout << 6;
   else if (x<=1199) cout << 5;
   else if (x<=1399) cout << 4;
   else if (x<=1599) cout << 3;
   else if (x<=1799) cout << 2;
   else if (x<=1999) cout << 1;
   
   return 0;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
#include <atcoder/all>

using namespace std;
using namespace atcoder;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define FILL(a,n,x) REP(i,(n)){ (a)[i]=(x); }
#define CINA(a,n) REP(i,(n)){ cin >> (a)[i]; }
#define FILL2(a,n,m,x) REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m) REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define Liny "Yes\n"
#define Linn "No\n"
#define LINY "YES\n"
#define LINN "NO\n"

//cout << setfill('0') << right << setw`(4) << 12; // "0012"
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
int __stoi(string s){ return atoi(s.c_str()); }
ll sum(ll a[],ll N){ return accumulate(a,a+N,0LL);}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a/gcd(a,b)*b;}
template<class T> void chmax(T& a, T b){ if(a<b){a=b;} }
template<class T> void chmin(T& a, T b){ if(a>b){a=b;} }
template<class T> bool isIn(T a,vector<T> v){ for(T x:v){ if(a==x){return true;}} return false;}
string strReplace(string s,string target, string replacement){
    if (!target.empty()) {
      std::string::size_type pos = 0;
      while ((pos = s.find(target, pos)) != std::string::npos) {
        s.replace(pos, target.length(), replacement);
        pos += replacement.length();
      }
    }
    return s;
}
const ll MOD = 1e9+7;
using mint = static_modint<MOD>;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MP make_pair

int op(int a,int b){ return max(a,b);}
int e() {return -1;}
int target;
bool f(int v){ return v<target;}

bool DEBUG = 0;
template<class T> void dprint(T s){
  if(DEBUG){ cout << s << "\n"; }
}

void solve(){
  int K; cin>>K;
  REP(i,K){
    cout << "ACL";
  }
  cout << "\n";
}

int main(int argc, char *argv[]){
  if(argc>1 && argv[1][0]=='D'){ DEBUG = 1;}
  solve();
  return 0;
}


Measured memory_bytes: 3628
//4-D
import java.util.Random;
import java.util.Scanner;

class Main{
  public static void main(String[] args) {
    
      Scanner sc = new Scanner(System.in);
      Random ran = new Random();
      
      int n = sc.nextInt();
      
      long sum = 0;
      
      int num [] = new int [n];
      
      	/*for(int i = 0 ; i < num.length ; i++ ){
	   	 num [i] = ran.nextInt(1000000);
	   	 //System.out.println(num[i]);
	   	 
	   	 sum = sum + num[i];
	   	 
	   }*/
      
	   for(int i = 0 ; i < num.length ; i++ ){
      		num[i] = sc.nextInt();
      		
      		sum = sum + num[i];

      	}
	   
  		int max = num[0];
  		int min = num[0];
	
		for(int i=0; i < num.length; i++ ){
			
			if (max < num[i]){	
				
				max = num[i];
				
				}
			
			if (min > num[i]){	
				
				min = num[i];
				
				}
		}
	
      System.out.println(min + " " + max + " " + sum);
	
  }
}

Measured memory_bytes: 41652
from collections import defaultdict


n = int(input())
A = list(map(int, input().split()))

plusA = A.copy()
minusA = A.copy()

for i in range(n):
    plusA[i] += i
    minusA[i] -= i

pldic = defaultdict(int)
midic = defaultdict(int)

for a, b in zip(plusA, minusA):
    pldic[a] += 1
    midic[b] += 1

ans = 0
keys = list(pldic.keys())
for key in keys:
    count = pldic[key]

    pair = midic[-key]
    ans += count * pair
print(ans)


Measured memory_bytes: 80396
#include<iostream>
#include<vector>
#include<utility>
#include<map>
#include<algorithm>

using namespace std;
using ll = long long;

string s[110], t[110];

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

	for (int i = 0; i < N; i++)cin >> s[i];

	int M;
	cin >> M;

	for (int i = 0; i < M; i++)cin >> t[i];

	int ans = 0;

	for (int i = 0; i < N; i++) {
		int score = 0;

		for (int j = 0; j < N; j++)if (s[j] == s[i])score++;
		for (int j = 0; j < M; j++)if (t[j] == s[i])score--;

		ans = max(score, ans);
	}

	cout << ans << endl;

}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
//#include<ext/rope>
//using namespace __gnu_cxx
//#include<ext/pb_ds/priority_queue.hpp>
//using namespace __gnu_pbds;
#define lowbit(x) (x&-x)
#define pb push_back
#define empb emplace_back
#define all(x) (x).begin(),(x).end()
#define clr(a,b) memset(a,b,sizeof(a))
#define caze(T) for(cin>>T;T;T--)
#define inf (1<<29)
#define Endl ('\n')
#define fi first
#define se second
#define db double
#define ldb long double
#define ll long long
#define pii pair<int,int>
#define pil pair<int,ll>
#define pli pair<ll,int>
#define pll pair<ll,ll>
#define ull unsigned long long
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
inline char nc() {
	#define SZ 1000000
	static char buf[SZ], *p1, *p2;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,SZ,stdin),p1==p2)?EOF:*p1++;
}
template<typename T>
inline int scan(T &x) {
	char c, sign=1; 
	while(!isdigit(c=nc())&&c!=EOF)if(c=='-')sign*=-1;
	if(c==EOF) return EOF;
	for(x = 0; isdigit(c); c = nc())
		x = (x<<1) + (x<<3) + (c&15);
	return x *= sign, 1;
}
template<typename T, typename...Args>
inline int scan(T &x, Args&...args) {
	return scan(x), scan(args...);
}
int main()
{
	vector<int>v;
	for(int i=1;i<10;++i)
		v.pb(111*i);
	int n;cin>>n;
	for(int i=0;i<9;++i)
		if(v[i]>=n)
			return cout<<v[i]<<Endl,0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

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

    int N; cin>>N;
    string s; cin>>s;
    int ans=0;
    for(int i=0;i<N;){
        int i0=i;
        while(i<N and s[i]==s[i0]) i++;
        ans++;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 512
//In the name of GOD
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

const ll maxn = 3e3 + 100;
const ll mod = 998244353;
const ll inf = 1e18;

#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_io freopen("input.txt" , "r+" , stdin) ; freopen("output.txt" , "w+" , stdout);
#define pb push_back
#define Mp make_pair
#define pll pair<ll, ll>
#define F first
#define S second

ll n, a, s, dp[maxn][maxn], p2;

int main(){
	fast_io;
	
	p2 = (mod + 1) / 2;
	cin >> n >> s;
	dp[0][0] = 1;
	for(ll i = 1; i <= n; i++){
		cin >> a;
		for(ll j = 0; j < maxn; j++){
			dp[i][j] = dp[i - 1][j];
			if(j >= a) dp[i][j] = (dp[i][j] + dp[i - 1][j - a] * p2) % mod;
		}
	}
	s = dp[n][s];
	for(ll i = 0; i < n; i++){
		s = (s * 2) % mod;
	}
	cout << s;
	
	return 0;
}


Measured memory_bytes: 76260
#include <bits/stdc++.h>
    using namespace std;
     
    int frog1(int* s, int n){
      int dp[100006];
      dp[0]=dp[1] = 0;
      for(int i=2;i<=n;i++){
        int op1 = abs(s[i]-s[i-1]) + dp[i-1];
        int op2 = (i==2)?INT_MAX:abs(s[i]-s[i-2]) + dp[i-2];
        dp[i] = min(op1, op2);
      }
     
      return dp[n];
    }
     
    int main() {
      int a[100005];
      int n;	cin>>n;
      for(int i=1;i<=n;i++){
        cin>>a[i];
      }
      cout<<frog1(a,n);
      return 0;
    }

Measured memory_bytes: 4388
#include<stdio.h>
int main(){
int a,b,c,d,e,f,g;
scanf("%d\n%d\n%d\n%d\n%d",&a,&b,&c,&d,&e);
if(b%d==0){
f=b/d;
}
else{
f=b/d+1;
}
if(c%e==0){
g=c/e;
}
else{
g=c/e+1;
}
if(f>g){
printf("%d\n",a-f);
}
else{
printf("%d\n",a-g);
}
return 0;
}




Measured memory_bytes: 2108
#include <iostream>
#include <functional>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <queue>
#include <map>
#include <iomanip>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;++i)
#define repi(i,n) for(ll i=n-1;i>=0;--i)
#define sll(n) scanf("%lld", &n);
#define slf(n) scanf("%lf", &n);
typedef long long ll;
typedef double lf;
static const ll max_n = 100010;
static const ll mod = 1000000007;
static const ll max_value = 100000000000100;
// vector<vector<vector<ll>>> dp(max_n, vector<vector<ll>>(max_n, vector<ll>(max_n*max_n, 0)));



void Main(){
    // bool is_ok = true;
    // printf("------------- V=%lld---------\n", V);
    ll A, B, C, K;
    sll(A);
    sll(B);
    sll(C);
    sll(K);
    
    ll left = K;
    ll value = 0;
    if(left<=A){
        value = left;
        left = 0;
        printf("%lld\n", value);
    }else{
        // printf("left:%lld, value = %lld\n", left, value);
        if(left>A){
            value += A;
            left -= A;
        }
        // printf("A left:%lld, value = %lld\n", left, value);

        if(left <= B){
            left = 0;
            printf("%lld\n", value);
        }else{
            // printf("B else left:%lld, value = %lld\n", left, value);

            if(left > B){
                left -= B;
            }
            // printf("B else > left:%lld, value = %lld\n", left, value);

            if(left <= C){
                value -= left;
                left = 0;
                printf("%lld\n", value);
            }else{
                value -= C;
                printf("%lld\n", value);
            }
        }
    }



    // cout<<fixed<<setprecision(10)<<num<<endl;
    // cout << num << endl;

}

int main(){
    Main();

    return 0;

}

Measured memory_bytes: 3832
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int mem[200000]={0};
int main(){
    int N,K,Q;
    cin>>N>>K>>Q;
    for(int i=0;i<Q;i++){
        int a;
        cin>>a;
        mem[a]++;
    }
    for(int i=1;i<=N;i++){
        if(Q-mem[i]<K)cout<<"Yes";
        else cout<<"No";
        cout<<endl;
    }
    return 0;
}


Measured memory_bytes: 1024
/*
─────────────────────
───────────████████──
──────────███▄███████
──────────███████████
──────────███████████
──────────██████─────
──────────█████████──
█───────███████──────
██────████████████───
███──██████████──█───
███████████████──────
███████████████──────
─█████████████───────
──███████████────────
────████████─────────
─────███──██─────────
─────██────█─────────
─────█─────█─────────
─────██────██────────
─────────────────────
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

#define int long long
#define read(a) int a; cin >> a;
#define readb(a, b) int a, b; cin >> a >> b;
#define readc(a, b, c) int a, b, c; cin >> a >> b >> c;
#define reads(s) string s; cin >> s;
#define readarr(a, n) int a[(n) + 1] = {}; fori (i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; fori (i, 1, n) {fori (j, 1, m) cin >> a[i][j];}

#define print(a) cout << a << endl;
#define printarr(a, n) fori (i, 1, n) cout << a[i] << " "; cout << endl;
#define printv(v) for (int i: v) cout << i << " "; cout << endl;
#define printmat(a, n, m) fori (i, 1, n) {fori (j, 1, m) cout << a[i][j] << " "; cout << endl;}
#define all(v) v.begin(), v.end()
#define sz(s) (int)(s.size())
#define pb push_back
#define fi first
#define se second
#define rz resize
#define fori(i, a, b) for (int i = (a); i <= (b); i++)
#define ford(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
#define setprec(x) cout << fixed << setprecision(x);
 
using namespace std;
using namespace __gnu_pbds; 
 
typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair <int, int>> vpi;
typedef vector < vector <int> > vvi;
 
const int INF = 4e18;
const int mod = 1e9+7; 

vi vec; int n;

void rawr()
{  
    while (n % 2 == 0)  
    {  
        vec.pb(2);
        n = n/2;  
    }  
 
    for (int i = 3; i* i <= n; i = i + 2)  
    {  
        while (n % i == 0)  
        {  
            vec.pb(i);
            n = n/i;  
        }  
    }  
  
    if (n > 2) vec.pb(n); 
}  
     
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    //start from here

    cin >> n; if(n == 1) {cout << 0; return 0;}
    rawr();

    int ans = 0;

    fori (i, 0, sz(vec) - 1)
    {
    	int cnt = 0, x = vec[i];

    	fori (j, i, sz(vec) - 1)
    		if(vec[j] == x) cnt++, i++;
    		else break;
    	i--;

    	for (int j = 1;; j++)
    	{
    		if(cnt / j >= 1) ans++, cnt -= j;
    		else break;
    	}
    }

    print(ans)

    return 0;
}


Measured memory_bytes: 3648
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;

const ll INF = 1e9;

int main() {
    ll N, W;
    cin >> N >> W;
    vector<ll> w(N), v(N);
    for (int i = 0; i < N; i++) {
        cin >> w[i] >> v[i];
    }
    vector<vector<ll>> DP(N + 1, vector<ll>(W + 1, 0));
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < W; j++) {
            DP[i + 1][j] = max(DP[i + 1][j], DP[i][j]);
            if (j + w[i] <= W) {
                DP[i + 1][j + w[i]] = max(DP[i + 1][j + w[i]],DP[i][j] + v[i]);
            }
        }
    }
    cout << *max_element(DP[N].begin(), DP[N].end()) << endl;
}


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

#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,n) for (int i = 0; i < n; i++)
#define forr(i,a,b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb(x) push_back(x)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;

const int MX = 1e6;
int n;
ll a[MX], acu[MX], mn = 1e18;
stack<ii> st;

int main () {
	ios_base::sync_with_stdio(0); cin.tie(0);
	
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> a[i];

	// Positivos
	for (int i = n - 1; i >= 0; i--) {
		acu[i] = acu[i+1];

		if (i == n - 1) {
			st.emplace(1e9, 1);
		} else {
			if (a[i] <= a[i+1]) {
				ll x = a[i], r = 0;

				while (x * 4 <= a[i+1])
					x *= 4, r++;

				if (!r) st.top().se++;
				else st.emplace(r, 1);
			} else {
				ll x = a[i+1];

				while (a[i] > x) {
					x *= 4;
					acu[i] += 2ll * st.top().se;
					st.top().fi--;

					if (!st.top().fi) {
						ii aux = st.top();
						st.pop();
						st.top().se += aux.se;
					}
				}

				st.top().se++;
			}
		}
	}

	while (st.size())
		st.pop();

	// Negativos
	ll s = 0;

	for (int i = 0; i < n; i++) {
		if (!i) {
			st.emplace(1e9, 1);
		} else {
			if (a[i] <= a[i-1]) {
				ll x = a[i], r = 0;

				while (x * 4 <= a[i-1])
					x *= 4, r++;

				if (!r) st.top().se++;
				else st.emplace(r, 1);
			} else {
				ll x = a[i-1];

				while (a[i] > x) {
					x *= 4;
					s += 2ll * st.top().se;
					st.top().fi--;

					if (!st.top().fi) {
						ii aux = st.top();
						st.pop();
						st.top().se += aux.se;
					}
				}

				st.top().se++;
			}
		}

		acu[i+1] += s + i + 1;
	}

	for (int i = 0; i <= n; i++){
		mn = min(mn, acu[i]);
	}

	cout << mn << endl;

	return 0;
}

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

using ll = long long;

const int INF = 1001001001;
const ll INF_LL = 1001001001001001001LL;

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

  rep(i,s.size()){
    if((ll)i==k-1){
      cout << s[i] << endl;
      return 0;
    }
    if(s[i]!='1'){
      cout << s[i] << endl;
      return 0;
    }
  }

  cout << s[0] << endl;
  
  return 0;
}


Measured memory_bytes: 3612
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	sc.Split(bufio.ScanWords)
	a, b := nextInt(), nextInt()
	if a > 0 {
		puts("Positive")
	} else if b < 0 {
		if (b-a)&1 == 0 {
			puts("Negative")
		} else {
			puts("Positive")
		}
	} else {
		puts("Zero")
	}
	wt.Flush()
}

var (
	sc  = bufio.NewScanner(os.Stdin)
	rdr = bufio.NewReaderSize(os.Stdin, 1000000)
	wt  = bufio.NewWriter(os.Stdout)
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(next())
	return i
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func nextFloat64s(n int) []float64 {
	slice := make([]float64, n)
	for i := 0; i < n; i++ {
		slice[i] = nextFloat64()
	}
	return slice
}

func nextMega() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, _ := rdr.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func putf(format string, a ...interface{}) {
	fmt.Fprintf(wt, format, a...)
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(int)(n);i++)
int main(){
  string S,T;
  int ans=0;
  cin>>S>>T;
  REP(i,S.size()){
    if (S.at(i)!=T.at(i))
      ans++;
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 3920
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#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>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif


using namespace std;
using ll = long long;

const ll MOD = 1000000007;
const ll INF = 1e18;
const double pi = acos(-1);
const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1,1,0,-1,-1,-1,0,1};
const int dy8[8] = {0,1,1,1,0,-1,-1,-1};


#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()


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





void solve(){
    
    // remove the bottom 3 lines when you submit this code.
    std::ifstream in("sample.txt");
    std::cin.rdbuf(in.rdbuf());

    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll n,k,q; cin >> n >> k >> q;
    vector<ll> A(q);
    vector<ll> P(n);
    
    rep(i,q) cin >> A[i];
    rep(i,q) P[A[i]-1]++;
    rep(i,n) cout << ((k-q+P[i]>0)?"Yes":"No") << endl;
    
    
    
}



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



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

const int MOD = (int)1e9+7;

int main(){
	int N;
	string S;
	cin >> N >> S;

	if(N%2!=0){
		cout << "No" << endl;
		return 0;
	}
	for(int i=0;i<N/2;i++){
		if(S.at(i)!=S.at(i+N/2)){
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<P,int> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
/*
ll Pow(ll n,ll p){
	ll r=1;
	for(;p>0;p>>=1){
		if(p&1) r=(r*n)%mod;
		n=(n*n)%mod;
	}
	return r;
}

const int M=2000005;
ll F[M];

void Init(){
	F[0]=1;
	for(int i=1;i<M;i++) F[i]=F[i-1]*i%mod;
}

ll Div(ll n,ll m){
	return n*Pow(m,mod-2)%mod;
}

ll nCk(ll n,ll k){
	return Div(F[n],F[n-k]*F[k]%mod);
}

ll nPk(ll n,ll k){
	return nCk(n,k)*F[k]%mod;
}*/

ll a,b,v,w,t;

int main(){
	cin>>a>>v>>b>>w>>t;
	cout<<(v>w&&abs(b-a)<=t*(v-w)?"YES":"NO")<<endl;
}

Measured memory_bytes: 3600
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)

//0-index 抽象化半開区間遅延セグツリー
template<typename T, typename E>
class segment_tree{
    typedef function<T(T,T)> F; //要素に適用する演算
    typedef function<T(T,E)> G; //作用素の適用
    typedef function<E(E,E)> H; //作用素の合成
    typedef function<E(E,int)> P;
private:
    int num_of_elm_;
    vector<T> dat_, lazy_;
    F f_;
    G g_;
    H h_;
    P p_;
    T ident_;
    E op_ident_;
public:
    segment_tree(int n, F f, G g, H h, P p, T ident, E op_ident):f_(f), g_(g), h_(h), p_(p), ident_(ident), op_ident_(op_ident){
        num_of_elm_ = 1;
        while(num_of_elm_<n)num_of_elm_*=2;
        dat_ .resize(2*num_of_elm_,ident);
        lazy_.resize(2*num_of_elm_,op_ident);
    }
    
    void eval(int k, int len){
        if(lazy_[k] == op_ident_)return ;
        
        if(k<num_of_elm_){
            lazy_[k*2]=h_(lazy_[k*2], lazy_[k]);
            lazy_[k*2+1]=h_(lazy_[k*2+1], lazy_[k]);
        }
        dat_[k] = g_(dat_[k],p_(lazy_[k], len));
        lazy_[k] = op_ident_;
    }
    
    T update(int L, int R, int val, int l=0, int r=0, int k=1){
        if(k==1)r = num_of_elm_;
        
        eval(k,r-l);
        if(r<=L || R<=l)return dat_[k];
        else if(L<=l && r<=R){
            lazy_[k] = h_(lazy_[k], val);
            return g_(dat_[k], p_(lazy_[k], r-l));
        }
        else{
            return dat_[k] = f_(update(L,R,val,l,(l+r)/2,k*2), update(L,R,val,(l+r)/2,r,k*2+1));
        }
        
    }
    
    T query(int L, int R,int l=0,int r=0, int k=1){
        if(k==1)r = num_of_elm_;
        
        eval(k,r-l);
        if(r<=L || R<=l)return ident_;
        else if(L<=l && r<=R){
            return dat_[k];
        }
        else{
            return f_(query(L,R,l,(l+r)/2,k*2), query(L,R,(l+r)/2,r,k*2+1));
        }
    }
};

int main(){
    int n,q;
    cin>>n>>q;
    auto f = [](int a, int b){return max(a,b);};
    auto g = [](int a, int b){return a+b;};
    auto h = g;
    auto p = [](int a, int len){return a;};
    segment_tree<int,int> st(n, f, g, h, p, 0, 0);
    rep(i,q){
        int com;
        cin>>com;
        if(com==0){
            int s,t,x;
            cin>>s>>t>>x;
            s--,t--;
            st.update(s,t+1,x);
        }else{
            int x;
            cin>>x;
            x--;
            cout<<st.query(x,x+1)<<endl;
        }
    }
}




Measured memory_bytes: 4892
#include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e18;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 20000;
constexpr ll nx[8] = {1,0,-1,0,-1,-1,1,1};
constexpr ll ny[8] = {0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    ll n = s.length();
    vector<vector<ll>> dp(n+1,vector<ll>(2,0));
    dp[0][0] = 1;
    rep(i,n){
        if (s[i] == '1'){
            dp[i+1][0] += dp[i][0]*2%MOD;
            dp[i+1][1] += dp[i][0]+dp[i][1]*3%MOD;
        }
        else{
            dp[i+1][0] += dp[i][0];
            dp[i+1][1] += dp[i][1]*3%MOD;
        }
    }
    PRINT((dp[n][0]+dp[n][1])%MOD);
}


Measured memory_bytes: 5840
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <vector>
using namespace std;

int main() {
    int N;
    int A=0;
    int B=0;
    cin>>N;
    vector<int> a(N);
    for(int i=0;i<N;i++)
    {
      cin>>a[i];
    }
    sort(a.begin(),a.end());
    reverse(a.begin(),a.end());
    for(int i=0;i<N;i++)
    {
      if(!(i%2)){
        A+=a[i];
        //cout<<"A:"<<a[i]<<endl;
      }else{
        B+=a[i];
        //cout<<"B:"<<a[i]<<endl;
      }
    }
  
    cout<<A-B<<endl;
    return 0;
}

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


#define li          long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

inline li gojo(li x) {
    li res = 1;
    rep(i, 5)res *= x;
    return res;
}

int main() {
    string s;
    cin >> s;
    cout << (s == "ABC" ? "ARC" : "ABC") << endl;


    return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int a[100],x,n,ans=0;
	cin >> n >> x;
	for(int i=0;i<n;i++)
		cin >> a[i];
	sort(a,a+n);

	for(;ans<n;ans++)
		if((x-=a[ans])<0) break;
	if(x>0 && ans==n) ans--;
	cout << ans << endl;
}

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;

int main() {
	cin.tie(0)->sync_with_stdio(false);

	int n, m, k;
	cin >> n >> m >> k;
	vector<int> A(n), B(m);
	REP(i, n) cin >> A[i];
	REP(i, m) cin >> B[i];

	vector<ll> a(n + 1, 0);
	REP(i, n) a[i + 1] = a[i] + A[i];
	vector<ll> b(m + 1, 0);
	REP(i, m) b[i + 1] = b[i] + B[i];

	int res = 0;
	REP(i, n + 1) {
		if (a[i] > k) break ;
		while (b[m] > k - a[i])
			m--;
		res = max(res, i + m);
	}

	cout << res << '\n';
	return 0;
}


Measured memory_bytes: 7916
import java.util.*;

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());
    }
    
    Scanner sc;
    String S;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        S = sc.next();
    }
    
    //解答処理
    int solve() {
        int price = 700;
        
        for (int i=0; i<S.length(); i++){
            if (S.charAt(i) == 'o'){
                price += 100;
            }
        }
        return price;
    }
    
    //出力
    void show(int answer) {
        System.out.println(answer);
    }
}


Measured memory_bytes: 35688
#include <iostream>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <algorithm>
#include <functional>
#include <cstring>
#include <limits.h>
#define FOR(i,k,n)  for (int i=(k); i<(int)(n); ++i)
#define REP(i,n)    FOR(i,0,n)
#define FORIT(i,c)	for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define SZ(i) ((int)i.size())
#define pb          push_back
#define mp          make_pair
#define mt          make_tuple
#define get0(x)     (get<0>(x))
#define get1(x)     (get<1>(x))
#define get2(x)     (get<2>(x))
#define ALL(X)      (X).begin(),(X).end()
#define LLMAX       9223372036854775807LL
#define LLMIN       -9223372036854775808LL
#define IMAX        2147483647
#define IMIN        -2147483648
typedef long long LL;
using namespace std;

int N,M;

int main(void){
    cin>>N>>M;
    long double t=1900*M+100*(N-M);
    long double Ps=1/(long double)(1<<M);
    long double ans=t/Ps;
    cout<<(int)ans<<endl;
     return 0;
}

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

#define LL long long

int color[100009];

vector<pair<int,int> > G[100009];

void dfs(int s,int p,int dis){
	color[s] = dis;
	for(int i=0;i<(int)G[s].size();i++){
		pair<int,int> p1 = G[s][i];
		if(p1.first != p){
			dfs(p1.first,s,(dis+p1.second)%2);
		}
	}
}

int main(){
	

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

	int n;
	cin>>n;

	for(int i=1;i<n;i++){
		int a,b,w;
		cin>>a>>b>>w;

		G[a].push_back(make_pair(b,w%2));
		G[b].push_back(make_pair(a,w%2));
	}

	dfs(1,1,0);

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

Measured memory_bytes: 9984
#include <iostream>
using namespace std;
int main()
{
int x,y,z,s,k,rc=0;
cin>>k>>s;
for(int i=0;i<=k;i++){
    for(int j=0;j<=k;j++){
        if(s-i-j<=k&&s-i-j>=0){
            rc++;
        }
        }
    }

cout<<rc;
return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,K;
  cin>>N>>K;
  vector<int>h(N);
  int count=0;
  for(int i=0;i<N;i++){
    cin>>h.at(i);
    if(h.at(i)>=K){
      count=count+1;
    }
  }
  cout<<count<<endl;
}

Measured memory_bytes: 640
from itertools import combinations


def ok(a, b, c):
    return abs(a - b) < c < a + b



N = int(input())
L = list(map(int, input().split()))
L.sort()
res = 0
for a, b, c in combinations(L, 3):
    if a != b != c and ok(a, b, c):
        res += 1
print(res)

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

using namespace std;

#define int long long
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, a, b) for(ll i = (a); i > (b); --i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define bitcnt __builtin_popcount
#define SZ(x) ((ll)(x).size())
#define fi first
#define se second
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CINT(...)                                                              \
    int __VA_ARGS__;                                                           \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Yes(a) cout << (a ? "Yes" : "No") << "\n"
#define YES(a) cout << (a ? "YES" : "NO") << "\n"
#define Printv(v)                                                              \
    {                                                                          \
        FOREACH(x, v) { cout << x << " "; }                                    \
        cout << "\n";                                                          \
    }
template <typename T = string> inline void eputs(T s) {
    cout << s << "\n";
    exit(0);
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
    std::fill((T *)array, (T *)(array + N), val);
}

typedef long long ll;
typedef unsigned long long ul;
typedef vector<ll> VL;
typedef pair<ll, ll> PL;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll, VL, greater<ll>> PQG;

const int INF = 1e9;
const int MOD = 1e9 + 7;
// const int MOD = 998244353;
const ll LINF = 1e18 + 1;
const ll dx[] = {1, -1, 0, 0};
const ll dy[] = {0, 0, 1, -1};

ll N, M;
VL sum;
map<ll, ll> memo;

signed main() {
    cin >> N >> M;
    sum.resize(N + 1);
    REP(i, N) sum[i + 1] = (sum[i] + IN()) % M;
    REP(i, N + 1) memo[sum[i]]++;
    ll ans = 0;
    FOREACH(r, memo) ans += r.second * (r.second - 1) / 2;
    cout << ans << "\n";
}


Measured memory_bytes: 4992
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdlib>
using namespace std;
// 多倍長テンプレ
/* ---------------------- ここから ---------------------- */
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;
/* ---------------------- ここまで ---------------------- */
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
int main() {
  string x;
  cin >> x;
  if(x=="ABC"){
    cout << "ARC";
  }
  else{
    cout << "ABC";
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 3624
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <iomanip>
typedef long long ll;
#define MOD 1000000007

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    
    vector<ll> v(m);
    for(int i = 0; i < m; i++) {
        cin >> v[i];
    }
    
    // フィボナッチ数列の作成
    ll num[100005] = {0};
    for(int i = 0; i <= n; i++) {
        if(i == 0) {
            num[i] = 1;
            continue;
        }
        if(i == 1) {
            num[i] = 1;
            continue;
        }
        
        num[i] = num[i - 1] + num[i - 2];
        num[i] %= MOD;
    }
    
    // ゴールに到達可能か判定
    for(int i = 0; i < m; i++) {
        if(i < m - 1 && v[i] + 1 == v[i + 1]) {
            cout << 0 << endl;
            return 0;
        }
    }
    
    // 最後の穴までの場合の数を計算
    int now = 0;
    ll ans = 1;
    for(int i = 0; i < m; i++) {
        ans *= num[v[i] - now - 1];
        ans %= MOD;
        now += v[i] - now + 1;
    }
    
    // 最後の穴からゴールまでの場合の数を計算
    ans *= num[n - now];
    ans %= MOD;
    
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1792
r,g,b,n = map(int,input().split(' '))
A = [r,g,b]
A.sort()
r,g,b = A[2], A[1], A[0]
rmax, gmax = n//r, n//g
count = 0
i = 0
while i <= rmax:
    j = 0
    if g == 1:
        count += (n-i*r)+1
        j += 30000
    while (n-i*r-j*g) >= 0:
        if (n-i*r-j*g)%b == 0:
            count += 1
        j += 1
    i += 1
print(count)

Measured memory_bytes: 3064