akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include<vector>
#define mod 1000000007
using namespace std;

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

    vector<vector<int>> arr(n+1,vector<int>(m+1,0)), dp(n+1,vector<int>(m+1,0));

    for(int i=1;i<=n;i++)
     {
         for(int j=1;j<=m;j++)
            {
                char ch;
                cin>>ch;
                if(ch=='.')
                 arr[i][j]=1;
            }
     }
    
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
        {
            if(arr[i][j]==0)
             continue;

             if(i==1&&j==1)
              dp[i][j]=1;
             else
              dp[i][j]=dp[i-1][j]%mod+dp[i][j-1]%mod; 
        }
    } 
    cout<<dp[n][m]%mod;
}


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

#define int long long

const int N=100005;

int a[N],b[N];
int n;
int pref[N];
vector<int> les,more;
int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin>>n;
    int sum=0;
    for(int i=1;i<=n;i++)
    {
    	cin>>a[i];
    	sum+=a[i];
    }
    for(int i=1;i<=n;i++)
    {
    	cin>>b[i];
    	if(a[i]>b[i])
    		more.push_back(a[i]-b[i]);
    	else if(a[i]<b[i])
    		les.push_back(b[i]-a[i]);

    	pref[i]=pref[i-1]+b[i];
    }
    if(pref[n]>sum)
    {
    	cout<<"-1";
    	return 0;
    }

    sort(les.begin(),les.end());
    sort(more.rbegin(),more.rend());

    int curr=0;
    for(int i=0;i<les.size();i++)
    {
    	if(more[curr]>=les[i])
    		more[curr]-=les[i];
    	else
    	{
    		les[i]-=more[curr];
    		i--;
    		curr++;
    	}
    }
    
    if(more.size() && les.size())
    cout<<les.size()+curr+1<<endl;
    else cout<<0<<endl;
    return 0;
}

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

int N;

int main() {
  cin >> N;

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

  int count = 0;

  for (int i = 0; i < N; i++) {
    if (a[i] == count+1) {
      count++;
    }
  }

  cout << (count == 0 ? -1 : (N - count)) << endl;

  return 0;
}

Measured memory_bytes: 1024
#pragma region template
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vld = vector<ld>;
using vvld = vector<vld>;
using vvvld = vector<vvld>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
template <typename T>
using pqrev = priority_queue<T, vector<T>, greater<T>>;
#define rep(i, n) for (ll i = 0, i##_end = (n); i < i##_end; i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repr(i, a, b) for (ll i = (a), i##_end = (b); i < i##_end; i++)
#define reprb(i, a, b) for (ll i = (b)-1, i##_end = (a); i >= i##_end; i--)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
//*
constexpr ll MOD = 1e9 + 7;
/*/
constexpr ll MOD = 998244353;
//*/
constexpr ll INF = 1e+18;
constexpr ld EPS = 1e-12L;
constexpr ld PI = 3.14159265358979323846L;
constexpr ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
constexpr ll LCM(ll a, ll b) { return a / GCD(a, b) * b; }
template <typename S, typename T>
constexpr bool chmax(S &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename S, typename T>
constexpr bool chmin(S &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif
template <typename T>
bool print_(const T &a) {
  cout << a;
  return true;
}
template <typename T>
bool print_(const vector<T> &vec) {
  for (auto &a : vec) {
    cout << a;
    if (&a != &vec.back()) {
      cout << " ";
    }
  }
  return false;
}
template <typename T>
bool print_(const vector<vector<T>> &vv) {
  for (auto &v : vv) {
    for (auto &a : v) {
      cout << a;
      if (&a != &v.back()) {
        cout << " ";
      }
    }
    if (&v != &vv.back()) {
      cout << "\n";
    }
  }
  return false;
}
void print() { cout << "\n"; }
template <typename Head, typename... Tail>
void print(Head &&head, Tail &&... tail) {
  bool f = print_(head);
  if (sizeof...(tail) != 0) {
    cout << (f ? " " : "\n");
  }
  print(forward<Tail>(tail)...);
}
#pragma endregion

void Pr(bool f){
  cout << (f ? "Yes" : "No") << "\n";
  exit(0);
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  ll n;
  cin >> n;
  ll k = 0;
  ll K = 26;
  ll cn = 26;
  ll c = 1;
  vector<char> ans;
  n--;
  while(1){
    if(k <= n && n < K){
      //print(k, n, K);
      n -= k;
      rep(i, c){
        ans.emplace_back('a'+(n%26));
        n /= 26;
      }
      reverse(ALL(ans));
      for(auto&& e: ans){
        cout << e;
      }
      cout << "\n";
      break;
    }
    cn *= 26;
    k = K;
    K += cn;
    c++;
  }
}


Measured memory_bytes: 3648
def solve(V, take, A, B, C):
    make = [0, 0, 0] #A, B, C
    cnt = [0, 0, 0] #cntA, cntB, cntC
    cost = 0
    for i in range(N):
        if V[i] == 0:
            continue
        elif V[i] == 1:
            make[0] += take[i]
            if cnt[0] != 0:
                cost += 10
            cnt[0] += 1
        elif V[i] == 2:
            make[1] += take[i]
            if cnt[1] != 0:
                cost += 10
            cnt[1] += 1
        else:
            make[2] += take[i]
            if cnt[2] != 0:
                cost += 10
            cnt[2] += 1
    
    #何もないところからは作れないので、そのときは十分大な数を返す
    if 0 in make:
        return 100000
    cost += (abs(make[0]-A) + abs(make[1]-B) + abs(make[2]-C))
    return cost


        


temp = list(map(int, input().split()))
N = temp[0]
A = temp[1]
B = temp[2]
C = temp[3]
take = []
min = 100000
for i in range(N):
    take.append(int(input()))
zenbu = 4**N
for i in range(zenbu):
    bit = i
    vec = []
    for j in range(N):
        vec.append(bit % 4)
        bit //= 4
    cost = solve(vec, take, A, B, C)
    if cost < min:
        min = cost
print(str(min))

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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef long long ll;

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    bool ans;
    cin>>s;
    int word=s.size();
    int count=0;
    int dount=0;
    if(s[0]!='A'){ans=false; goto end;}
    for(int i=2;i<word-1;i++){
        if(s[i]=='C'){count++;}
    }
    for(int i=0;i<word;i++){
        if(s[i]<97){dount++;}
    }
    if(dount>2){ans=false;}
    else if(count==1){ans=true;}
    else{ans=false;}
    end:;
    if(ans==true){cout<<"AC"<<endl;}
    else{cout<<"WA"<<endl;}
    return 0;
}

Measured memory_bytes: 256
a, b, c, d = map(int,input().split())

if (0 - d <= c - a) and (d >= c - a):
    print('Yes') 
elif ((0 - d <= b - a) and (d >= b - a)) and ((0 - d <= c - b) and (d >= c - b)):
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3060
a,b,c,x,y = map(int, input().split())

mini = 1000000000000
for i in range(max(x,y)+1):
	summ = (2*c*i) + (a * max(0,x-i)) + (b * max(0,y-i))
	if summ < mini:
		mini = summ
print(mini)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long dp[100000][13];
int main() {
	string s;
	cin >> s;
	int n = s.size();
	if (s[n - 1] == '?') {
		for (int j = 0; j < 10; j++) {
			dp[n - 1][j] = 1;
		}
	}
	else {
		dp[n - 1][s[n - 1] - '0'] = 1;
	}
	int pw = 10;
	for (int i = n - 2; i >= 0; i--) {
		if (s[i] != '?') {
			int val = pw * (s[i] - '0');
			for (int j = 0; j < 13; j++) {
				dp[i][j] += dp[i + 1][(j - val % 13 + 13) % 13];
				dp[i][j] %= mod;
			}
		}
		else {
			for (int dig = 0; dig < 10; dig++) {
				int val = dig * pw;
				for (int j = 0; j < 13; j++) {
					dp[i][j] += dp[i + 1][(j - val % 13 + 13) % 13];
					dp[i][j] %= mod;
				}
			}
		}
		pw *= 10;
		pw %= 13;
	}
	cout << dp[0][5];
	return 0;
}


Measured memory_bytes: 13880
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <stack>
#include <numeric>
#include <cassert>

#define endl '\n'
#define sp ' '

#define pb push_back
#define mp make_pair
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

bool changed[105];

int main(){
    
    ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);cerr.tie(nullptr);

    string s;ll k;
    cin>>s>>k;
    string t = s;
    
    ll cnt1=0,cnt2=0;
    
    for(int i=1;i<t.size();i++){
        if(t[i-1] == t[i]){
            t[i] = '-';
            cnt1++;
        }
    }
    t = s+s;
    for(int i=1;i<t.size();i++){
        if(t[i-1] == t[i]){
            t[i] = '-';
            cnt2++;
        }
    }
    //cout<<cnt1<<endl;
    
    if(t[0] != t.back()){
        cout<<k/2 * cnt2 + k%2 * cnt1;
    }
    else{
        cout<<k*cnt1 - (k-1) * (2*cnt1 - cnt2);
    }
}













Measured memory_bytes: 256
s = input()

s_x = s.replace('x', '')
if s_x != s_x[::-1]:
    print(-1)
    exit()

res = 0
l, r = 0, len(s) - 1
while l < r:
    if s[l] == s[r]:
        l += 1
        r -= 1
    elif s[l] == 'x':
        l += 1
        res += 1
    elif s[r] == 'x':
        r -= 1
        res += 1
    else:
        print(-1)
        exit()
print(res)


Measured memory_bytes: 3316
def d_redistribution(MOD=10**9 + 7):
    S = int(input())
    if S in (1, 2):
        return 0

    ans = [0] * (S + 1)
    ans[3] = 1
    for n in range(3, S + 1):
        ans[n] += ans[n - 1] + ans[n - 3]
        ans[n] %= MOD
    return ans[S]

print(d_redistribution())

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

int main() {
  ll N;
  cin >> N;
  vector<ll> A(N), B(N);
  rep(i, N) {
    cin >> A[i];
    B[i] = A[i] - i;
  }

  // メディアンを
  sort(B.begin(), B.end());
  ll x = B[N / 2];

  ll ans = 0;
  rep(i, N) ans += max(x - B[i], -x + B[i]);  // |A| = max(A, -A)
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 6332
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <stack>
#include <vector>
#include <set>
#include <tuple>
#include <utility>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
const int INF = 1000000000;
const int MOD = 1000000007;
int main(){
	int w,h,x,y;
	cin >> w >> h >> x >> y;
	if(w % 2 == 0 && h % 2 == 0 && w/2 == x && h/2 == y){
		cout << (ll)w * h / 2 << " " << 1 << endl;
	}
	else{
		printf("%.14lf %d\n",(double)w * h /2,0);
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define show(x) cerr << #x << " = " << x << endl
using namespace std;
using ll = long long;
using ld = long double;

int main()
{
    ll K;
    cin >> K;
    auto f = [](const ll n) -> ld {
        int sum = 0;
        for (ll m = n; m > 0; m /= 10) { sum += m % 10; }
        return (ld)n / sum;
    };
    vector<ll> cand;
    for (ll i = 1; i < 10000; i++) {
        string s = to_string(i);
        for (ll j = 0; j <= 15 and s.size() <= 16; j++) { cand.push_back(stoll(s)), s.push_back('9'); }
    }
    sort(cand.begin(), cand.end());
    reverse(cand.begin(), cand.end());
    vector<ll> ans;
    ld prev = 1e100;
    for (const ll e : cand) {
        const auto F = f(e);
        if (prev >= F) { ans.push_back(e), prev = F; }
    }
    sort(ans.begin(), ans.end());
    ans.erase(unique(ans.begin(), ans.end()), ans.end());
    for (int i = 0; i < K; i++) { cout << ans[i] << endl; }
    return 0;
}


Measured memory_bytes: 2420
n,c=map(int,input().split())
x,y,z=-1,-1,-1
for i in range(n+1):
  for j in range(n+1-i):
    if 10000*i+5000*j+(n-i-j)*1000==c:
      x,y,z=i,j,n-i-j
      print(x,y,z)
      exit()
print(x,y,z)

Measured memory_bytes: 9144
N = int(input())
X = str(input())
count = X.count("1")
num, nump, numm = 0, 0, 0
now, nowp, nowm = 1, 1, 1

if count == 0:
  for i in range(N):
    print(1)
    quit()
elif count == 1:
  if X[-1] == "1":
    for i in range(N):
      if i != N - 1:
        print(2)
      else:
        print(0)
  else:
    for i in range(N):
      if i!= N - 1:
        if X[i] == "1":
          print(0)
        else:
          print(1)
      else:
        print(2)
  quit()
  

xx = [0] * N
x_plus = [0] * N
x_minus = [0] * N
for i in range(1, N + 1):
  if i != 1:
    now *= 2
    nowp *= 2
    
    now %= count
    nowp %= (count + 1)
    

    nowm *= 2
    nowm %= (count - 1)
  
  else:
    now %= count
    nowp %= (count + 1)
    nowm %= (count - 1) 
  xx[i - 1] = now
  x_plus[i - 1] = nowp
  x_minus[i - 1] = nowm
  if X[-i] == "1":
    num += now
    num %= count
    nump += nowp
    nump %= count + 1
    numm += nowm
    numm %= count - 1
    
#print(num, xx, x_plus, x_minus)    

nextn = [0] * N
#ans = [1] * N
for i in range(N):
    if X[i] == "0":
      a = nump + x_plus[N - 1 - i]
      b = count + 1
      #print(a, b)
      nextn[i] = a % b
    else:
      #if count == 2:
      #  nextn[i] = 0
      #else:
        a = numm - x_minus[N - 1 - i]
        b = count - 1
        nextn[i] = a % b
        
#print(nextn)    
for i in range(N):
  if nextn[i] == 0:
    print("1")
  else:
    nownow = nextn[i]
    ans = 1
    while nownow != 0:
      alpha = bin(nownow)[2:]
      beta = str(alpha).count("1")
      nownow %= beta
      ans += 1
    print(ans)







Measured memory_bytes: 41180
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  stack<string> num;
  int a,b,sum;
  while(1){
    string st;
    cin>>st;
    if(st=="+"){
      a = stoi(num.top());
      num.pop();
      b = stoi(num.top());
      num.pop();
      sum=a+b;
      st = to_string(sum);
      num.push(st);
    }
    else if(st=="-"){
      a = stoi(num.top());
      num.pop();
      b = stoi(num.top());
      num.pop();
      sum=b-a;
      st = to_string(sum);
      num.push(st);
    }
    else if(st=="*"){
      a = stoi(num.top());
      num.pop();
      b = stoi(num.top());
      num.pop();
      sum=a*b;
      st = to_string(sum);
      num.push(st);
    }
    else if(cin.eof()){
       cout<<num.top()<<endl;
       break;
    }
    else{
      num.push(st);
    }
  }
  return 0;
}


Measured memory_bytes: 3212
import java.util.*;
 
public class Main{
  
  public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    
    if(n>=1 && n<=100000){
    String[] list = new String[n];
    for(int i=0; i < n; ++i){
      list[i] = sc.next();
    }
    
    int acCount = 0;
    int waCount = 0;
    int tleCount = 0;
    int reCount = 0;
    for(int i=0; i < n; ++i){
      String str = list[i];
      
      if(str.equals("AC")){
        acCount++;
      }else if(str.equals("WA")){
        waCount++;
      }else if(str.equals("TLE")){
        tleCount++;
      }else if(str.equals("RE")){
        reCount++;
      }
      
    }
    
      System.out.println("AC" + " " + "x" + " " + acCount);
      System.out.println("WA" + " " + "x" + " " + waCount);
      System.out.println("TLE" + " " + "x" + " " + tleCount);
      System.out.println("RE" + " " + "x" + " " + reCount);
    
    }else{
      System.out.println("入力条件に違反しています");
    }
  }  
    
}

Measured memory_bytes: 63808
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
	int N;
	cin>>N;
	if (N==1){
		cout<<"YES"<<endl;
		return 0;
	}
	long long even=0;
	long long odd=0;
	long long A;
	for (int i=0;i<N;i++){
		cin>>A;
		if (A%2==0){
			even++;
		}else{
			odd++;
		}
	}
	if (odd%2==0){
		cout<<"YES"<<endl;
	}else{
		cout<<"NO"<<endl;
	}

	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        if((a<0 || 100<a) || (b<0 || 100<b) ||(c<0 || 100<c)){
            System.exit(-1);
        }else if(a<b && b<c){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
    
}

Measured memory_bytes: 26164
/*********************
*@Author:   CKang *
*@Language: C++11    *
*********************/
#include<bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
//#define DEBUG
#define RI register int
#define endl "\n"

using namespace std;

typedef long long ll;
//typedef __int128 lll;
//const int N=100000+10;
const int M=100000+10;
const int MOD=1e9+7;
const double PI = acos(-1.0);
const double EXP = 1E-9;
const int INF = 0x3fffffff;
const ll LINF = 0x3fffffffffffffff;

inline ll read(){
    long long x=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){
        if(ch=='-')
            f=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        x=(x<<1)+(x<<3)+(ch^48);
        ch=getchar();
    }
    return x*f;
}

int n,m;
int h[100005]={0},c[100005]={0},g[100005]={0};

void init(){
    for(int i=0;i<100005;i++)
        h[i]=c[i]=g[i]=0;
    return ;
}
void solve(){
    n=read(),m=read();
    for(int i=1;i<=n;i++)h[i]=read();
    for(int i=0;i<m;i++){
        int a=read(),b=read();
        c[a]=c[b]=1;
        if(h[a]==h[b])
            g[a]=g[b]=1;
        else if(h[a]<h[b])
            g[a]=1;
        else
            g[b]=1;
    }
    int ans=0;
    for(int i=1;i<=n;i++){
        if(c[i]==0)ans++;
        else if(g[i]==0)ans++;
    }
    cout<<ans<<endl;
    return ;
}

int main()
{
#ifdef DEBUG
    freopen("input.in", "r", stdin);
    //freopen("output.out", "w", stdout)
#endif
    //cout.tie(0);
    //for(ll t=read();t;t--)
        solve();
#ifdef DEBUG
    printf("Time cost : %lf s\n",(double)clock()/CLOCKS_PER_SEC);
#endif
    //cout << "Fuck You !" << endl;
    return 0;
}


Measured memory_bytes: 4792
import numpy as np


def element_conn(l):
	result = ''
	for x in l:
		result += str(x)
	return result

def exclusive_or(n, m):
	array_bin_n = np.array(list(format(n, 'b')))
	array_bin_m = np.array(list(format(m, 'b')))
	num_elem_n = len(array_bin_n)
	num_elem_m = len(array_bin_m)
	
	if num_elem_m-num_elem_n > 0:
		array_zero = np.array(['0' for i in range(num_elem_m-num_elem_n)])
		array_added_bin_n = np.hstack((array_zero, array_bin_n))
		result = array_bin_m.astype(int) + array_added_bin_n.astype(int)
	else:
		result = array_bin_m.astype(int) + array_bin_n.astype(int)
	
	result[result==2]=0
	
	convert_list = list(result)
	
	final_result = int(element_conn(convert_list), 2)
	
	return final_result




A, B = map(int, input().split())

list_binary = []

if A%2 == 0:
	if B%2 == 0:
		if ((A+B)/2)%2 == 0:
			print(B)
		else:
			print(B+1)
	else:
		if ((A+B+1)/2)%2 == 0:
			print(0)
		else:
			print(1)
else:
	if B%2 == 0:
		if ((A+B-1)/2)%2 == 0:
			print(exclusive_or(A-1, B))
		else:
			print(exclusive_or(A, B))
	else:
		if ((A+B)/2)%2 == 0:
			print(A-1)
		else:
			print(A)

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

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

    int n;
    cin >> n;
    vector<ll> p(n + 1), q(n + 1);
    rep(i, 0, n) {
        cin >> p[i];
        q[p[i]] = i;
    }
    set<int> used;
    used.insert(-1);
    used.insert(-2);
    used.insert(n);
    used.insert(n + 1);
    used.insert(q[n]);

    ll ans = 0;

    for (int i = n - 1; i > 0; i--) {
        auto x = used.lower_bound(q[i]);
        auto y = x;
        int u = *y;
        y++;
        int uu = *y;
        x--;
        int d = *x;
        x--;
        int dd = *x;
        used.insert(q[i]);

        if (d != -1) {
            ans += (d - dd) * (u - q[i]) * (ll)i;
        }
        if (u != n) {
            ans += (uu - u) * (q[i] - d) * (ll)i;
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 6528
S = list(input())

ans = 0

for i in range(len(S)-1):
    if S[i]!=S[i+1]:
        continue
    if S[i+1]=="0":
        ans = ans + 1
        S[i+1] = "1"
    else:
        ans = ans + 1
        S[i+1] = "0"

print(ans)

Measured memory_bytes: 3956
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <map>
const int MOD = 1e9+7;
typedef long long ll;
using namespace std;

int main(){
	int n, maxi1 = 0, maxi2 = 0;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++){
		cin >> a[i];
		if (maxi1 < a[i]){
			maxi1 = a[i];
		}else if (maxi2 < a[i]){
			maxi2 = a[i];
		}
	}
	for (int i = 0; i < n; i++){
		if (maxi1 == maxi2){
			cout << maxi1 <<endl;
		}else{
			if (maxi1 == a[i]) cout << maxi2 << endl;
			else cout << maxi1 << endl;
		}
	}
	return 0;
}



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

vector<vector<int>> v(100010),u(100010),r(100010);

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);
    
    ll x,y,z,n,m,s,t;
    cin>>x>>y>>z>>n>>m>>s>>t;
    s--, t=n+t-1;
    int a[n],b[n+m],d[m];
    for(int i=0;i<n;i++){
        cin>>a[i]>>b[i];
        a[i]--,b[i]--;
        v[a[i]].push_back(i);
        u[b[i]].push_back(i);
    }
    for(int i=0;i<m;i++){
        cin>>b[i+n]>>d[i];
        b[i+n]--,d[i]--;
        u[b[i+n]].push_back(i+n);
        r[d[i]].push_back(i+n);
    }
    bool visited[n+m]={};
    bool used[x+y+z]={};
    int ans[n+m]={};
    queue<int> q;
    q.push(s);
    while(q.size()){
        int p = q.front(); q.pop();
        visited[p]=1;
        if(p<n){
            if(!used[a[p]]){
                used[a[p]]=1;
                for(auto i:v[a[p]]){
                    if(!visited[i]){
                        q.push(i);
                        visited[i]=1;
                        ans[i] = ans[p]+1;
                    }
                }
            }
        }
        else{
            if(!used[d[p-n]+x+y]){
                used[d[p-n]+x+y]=1;
                for(auto i:r[d[p-n]]){
                    if(!visited[i]){
                        q.push(i);
                        visited[i]=1;
                        ans[i] = ans[p]+1;
                    }
                }
            }
        }
        if(!used[b[p]+x]){
            used[b[p]+x]=1;
            for(auto i:u[b[p]]){
                if(!visited[i]){
                    q.push(i);
                    visited[i]=1;
                    ans[i] = ans[p]+1;
                }
            }
        }
    }
    if(ans[t]==0){
        cout << -1 << endl;
    }
    else cout << ans[t] << endl;
}



Measured memory_bytes: 20460
import queue

K=int(input())
Q=queue.Queue()
for i in range(1,10):
    Q.put(i)

for i in range(1,K+1):
    deq=Q.get()
    mod=deq%10
    if mod!=0:
        Q.put(10*deq+mod-1)
    Q.put(10*deq+mod)
    if mod!=9:
        Q.put(10*deq+mod+1)
print(deq)

Measured memory_bytes: 12480
# 04:58 sec    63276 KB     912 bytes
import sys

class Node:
    __slots__ = ['key', 'left', 'right']
    def __init__(self, key):
        self.key = key
        self.left = self.right = None

class BST:
    def __init__(self):
        self.root = None
    def insert(self, key):
        x, y, z = self.root, None, Node(key)
        while x != None: x, y = x.left if z.key < x.key else x.right, x
        if y == None: self.root = z
        else:
            if z.key < y.key: y.left = z
            else: y.right = z
    def print_tree(self):
        def inorder(node):
            return inorder(node.left) + f' {node.key}' + inorder(node.right) if node else ''
        def preorder(node):
            return f' {node.key}' + preorder(node.left) + preorder(node.right) if node else ''
        print(inorder(self.root))
        print(preorder(self.root))

tree = BST()
input()
for e in sys.stdin:
    if e[0] == 'i': tree.insert(int(e[7:]))
    else: tree.print_tree()


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

   string s;
   int n,i;
   cin>>n;
   cin>>s;
   int l=s.size();
   if(l<=n)
   {
    cout<<s<<endl;
    return 0;
   }
    
    for(i=0;i<n;i++)
    {
      cout<<s[i];
    }
    if(l>n)
    {
      cout<<"...";
    }
    cout<<endl;

  
}


Measured memory_bytes: 3620
s = list(input())
c = 0
li = ["A","C","G","T"]
li2 = []
for i in range(len(s)):
    if s[i] in li:
        c += 1
        
    else:
        li2.append(c)
        c = 0
li2.append(c)
print(max(li2))

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

int main() {
  int n; 
  cin >> n;
  vector<int> t(n);
  vector<string> s(n);
  rep(i,n){
    cin >> s[i];
    cin >> t[i];
  }
  string x; 
  cin >> x;
  int sleep; 
  int total = 0;
  rep(i, n){
    if(s[i] == x) sleep = i;
  }
  for(int i = sleep + 1; i < n ; ++i)  total += t[i];
  cout << total << endl;
}


Measured memory_bytes: 256
//author rhythmicankur
                                                                  //god_is_almighty
#pragma GCC optimize("O3")
#pragma GCC target ("sse4")
#include<bits/stdc++.h>
#define f 	first
#define s 	second
#define ll 	int
#define int 	long long
#define ld 	long double
#define pb 	push_back
#define eb 	emplace_back
#define mk 	make_pair
#define vi 	vector<int>
#define pii 	pair<int,int>
#define vpi 	vector<pii>
#define fori(a,b,c) for(register int i=a;i<b;i+=c)
#define ford(a,b,c) for(register int i=a;i>=b;i-=c)
#define 	PI acos(-1)
#define coud(a,b) cout<<fixed << setprecision((b)) << (a)
#define M1 	998244353
#define M2 	1000000007
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
template<typename T> T gcd(T a,T b) { if(a==0) return b; return gcd(b%a,a); } 
#define test4(x,y,z,a) 		cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<"  |  "<<#a<<": "<<a<<endl;
#define test1(x)                cerr<<#x<<": "<<x<<endl
#define test2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define test3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
ll power(ll a,ll b,ll m=M2){ll answer=1;while(b){if(b&1)answer=(answer*a)%m;b/=2;a=(a*a)%m;}return answer;}
using namespace std;
void ctrl()
{
	cout<<"Control\n";
}
int dp[10000+10];
 vpi v;
int recur(int x)
{
    if(x<=0)
    return 0;

    if(dp[x]!=-1)
    return dp[x];

    int s=0;
    int d=1e15;
    for(auto it:v)
    {
        d=min(d,it.s+recur(x-it.f));
    }

    return dp[x]=d;
}

signed main()
{	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n,h;
    cin>>n>>h;
    memset(dp,-1,sizeof(dp));

   

    fori(0,h,1)
    {
        int x,y;
        cin>>x>>y;
        v.pb({x,y});
    }

    int x=recur(n);
    cout<<x;

return 0;
}

Measured memory_bytes: 768
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
using namespace std;

#define rep(i, s) for (int i = 0; i < s; ++i)
#define all(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
/*
sort(sp.begin(), sp.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
*/

typedef long long  ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

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





    return 0;
}


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

int N,Q;
struct LazySegmentTree{
  private:
  int n; vector<ll> node,lazy;
  
  public:
  LazySegmentTree(vector<ll> v){
    int sz=(int)v.size();
    n=1;  while(n<sz)n*=2;
    node.resize(2*n-1);
    lazy.resize(2*n-1,0);
    for(int i=0;i<sz;i++)node[i+n-1]=v[i];
    for(int i=n-2;i>=0;i--)node[i]=node[2*i+1]+node[2*i+2];
  }
  
  void eval(int k,int l,int r){
    if(lazy[k]!=0){
      node[k]+=lazy[k];
      if(r-l>1){lazy[2*k+1]+=lazy[k]/2; lazy[2*k+2]+=lazy[k]/2;}
      lazy[k]=0;
    }
  }
  void add(int a,int b,ll x,int k=0,int l=0,int r=-1){
    if(r<0)r=n;
    eval(k,l,r);
    if(b<=l || r<=a)return;
    if(a<=l && r<=b){lazy[k]+=(r-l)*x; eval(k,l,r);}
    else{
      add(a,b,x,2*k+1,l,(l+r)/2);
      add(a,b,x,2*k+2,(l+r)/2,r);
      node[k]=node[2*k+1]+node[2*k+2];
    }
  }
  ll getsum(int a,int b,int k=0,int l=0,int r=-1){
    if(r<0)r=n;
    eval(k,l,r);
    if(b<=l || r<=a)return 0;
    if(a<=l && r<=b)return node[k];
    ll vl=getsum(a,b,2*k+1,l,(l+r)/2);
    ll vr=getsum(a,b,2*k+2,(l+r)/2,r);
    return vl+vr;
  }
};

int main(){
  cin >> N >> Q;
  LazySegmentTree seg(vector<ll>(N,0));
  for(int i=0;i<Q;i++){
    int q; cin >> q;
    if(q==0){
      int s,t,x; cin >> s >> t >> x;
      seg.add(s-1,t,x);
    }
    else{
      int s,t; cin >> s >> t;
      cout << seg.getsum(s-1,t) << endl;
    }
  }
}


Measured memory_bytes: 7524
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>

using namespace std;

static const double EPS=1e-12;
static const double INF=1e24;

using Point=complex<double>;
using Plane=vector<Point>;

namespace std {
    bool operator<(const Point &a, const Point &b) {
        return real(a)!=real(b)? real(a)<real(b) : imag(a)<imag(b);
    }
}

double cross_prod(const Point &a, const Point &b) {
    return imag(conj(a)*b);
}

double dot_prod(const Point &a, const Point &b) {
    return real(conj(a)*b);
}

struct Line: public pair<Point, Point> {
    Line() {}
    Line(const Point &a, const Point &b) {
        first = a;
        second = b;
    }
};

struct LineSeg: public pair<Point, Point> {
    LineSeg() {}
    LineSeg(const Point &a, const Point &b) {
        first = a;
        second = b;
    }
};

struct Circle {
    Point p;
    double r;
    Circle() {}
    Circle(const Point &p, const double r): p(p), r(r) {}
};

enum CCWiseState {
    ONLINE_FRONT=-2,
    CLOCKWISE,
    ON_SEGMENT,
    COUNTER_CLOCKWISE,
    ONLINE_BACK,
};

CCWiseState ccwise(Point a, Point b, Point c) {
    b -= a; c -= a;

    if (cross_prod(b, c) > 0) {
        return COUNTER_CLOCKWISE;
    } else if (cross_prod(b, c) < 0) {
        return CLOCKWISE;
    } else if (dot_prod(b, c) < 0) {
        return ONLINE_BACK;
    } else if (norm(b) < norm(c)) {
        return ONLINE_FRONT;
    } else {
        return ON_SEGMENT;
    }
}

bool includes(const Point &A, const Point &B, const Point &C, const Point &P) {
    // returns whether triangle ABC includes point P
    CCWiseState tmp=ccwise(A, P, B);
    if (tmp != ccwise(B, P, C)) return false;
    if (tmp != ccwise(C, P, A)) return false;

    return true;
}

bool testcase_ends() {
    double x, y;
    if (scanf("%lf %lf", &x, &y) == EOF)
        return 1;

    Point A(x, y);
    scanf("%lf %lf", &x, &y);
    Point B(x, y);
    scanf("%lf %lf", &x, &y);
    Point C(x, y);

    scanf("%lf %lf", &x, &y);
    Point P(x, y);

    printf("%s\n", includes(A, B, C, P)? "YES":"NO");
    return 0;
}

int main() {
    int solved=0;
    while (!testcase_ends())
        ++solved;

    return !solved;
}

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

namespace Atcoder
{
    public class Program
    {
        static void Main(string[] args)
        {
            var s = Read();
            long now = 0;
            var k = 1;
            var rest = new int[10000];
            long ans = 0;
            rest[0] = 1;
            for (int i = 0; i < s.Length; i++)
            {
                var si = s[s.Length - i - 1].Long();
                now += si * k % 2019;
                now = now % 2019;
                rest[now] += 1;
                k = k * 10 % 2019;
            }
            for (int i = 0; i < 10000; i++)
            {
                if (rest[i] >= 2)
                {
                    ans += (long)rest[i] * (rest[i] - 1) / 2;
                }
            }
            WriteRead(ans);
        }
        
        public static string Read()
        {
            return Console.ReadLine();
        }

        public static string[] ReadSplit()
        {
            return Console.ReadLine().Split(' ');
        }

        public static void WriteRead(object str)
        {
            Console.WriteLine(str);
            Read();
        }

        public static void Write(object str)
        {
            Console.WriteLine(str);
        }

        private static bool ChangeMin<T>(ref T a, T b) where T : IComparable
        {
            if (a.CompareTo(b) > 0)
            {
                a = b;
                return true;
            }
            return false;
        }

        private static bool ChangekMax<T>(ref T a, T b) where T : IComparable
        {
            if (b.CompareTo(a) > 0)
            {
                a = b;
                return true;
            }
            return false;
        }
    }
}


public static class Extentions
{
    public static int Int(this object obj)
    {
        return int.Parse(obj.ToString());
    }

    public static long Long(this object obj)
    {
        return long.Parse(obj.ToString());
    }

    public static decimal Decimal(this object obj)
    {
        return decimal.Parse(obj.ToString());
    }

    public static double Double(this object obj)
    {
        return double.Parse(obj.ToString());
    }

    public static T2 GetValueZero<T1, T2>(this Dictionary<T1, T2> d, T1 key) where T2 : struct
    {
        T2 value;
        if (d.TryGetValue(key, out value))
        {
            return value;
        }
        return new T2();
    }
}



Measured memory_bytes: 21620
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            var N = cin.ReadInt;
            var M = cin.ReadInt;
            if (N == M)
            {
                WriteLine("Yes");
            }
            else
            {
                WriteLine("No");
            }
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); }}
        public int ReadInt { get { return int.Parse(Read); }}
        public long ReadLong { get { return long.Parse(Read); }}
        public double ReadDouble { get { return double.Parse(Read); }}
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret;}
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret;}
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret;}
    }
}

Measured memory_bytes: 13268
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize ("Ofast")
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
using namespace __gnu_pbds;
using namespace std;
 
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<long long,long long> ii; 	
typedef complex<long double> com;

const ll mod = 1e9+7;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    ld pi = 3.14159265358979323;
	ld r;
    cin >> r;
    cout << fixed << setprecision(60) << ld(2)*pi*r << endl;
}


Measured memory_bytes: 3804
import sys

group = {}

for line in sys.stdin:
    n = int(line)
    if n in group:
        group[n] += 1
    else:
        group[n] = 1

sorted_group = sorted(group.items(), key=lambda x: x[1])
sorted_group.reverse()

mx = 0
result = []
for k,v in sorted_group:
    if mx == 0:
        mx = v
    if v == mx:
        result.append(k)
    else:
        break

result.sort()

for i in result:
    print(i)

Measured memory_bytes: 4232
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1000000007;

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

int main(){
    int n, k, cnt;
    cin >> n >> k;
    for (cnt = 0; cnt < 100010; cnt++){
        if (n <= k + cnt * (k - 1)) break;
    }

    cout << cnt + 1 << endl;

    return 0;
}

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

string s, t;

int main() {
	ios::sync_with_stdio(false), cin.tie(0);
	cin >> s >> t;
	for (int i = 0; i < 110; i++) {
		if(s == t) {
			cout << "Yes";
			return 0;
		}
		char c = s.back();
		s.pop_back();
		s = c + s;
	}
	cout << "No";
	return 0;
}

Measured memory_bytes: 256
def main():
    N, A, B = map(int, input().split())
    ans = 0
    for x in range(1, N + 1):
        if A <= sum(map(int, str(x))) <= B:
            ans += x
    print(ans)


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())


Measured memory_bytes: 2940
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] strs = br.readLine().split(" ");
		int[] inputData = new int[n];
		for (int i = 0; i < n; i++) {
			inputData[i] = Integer.parseInt(strs[i]);
		}
		int swapCnt = selectionSort(inputData);

		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < inputData.length; i++) {
			sb.append(inputData[i]);
			if (i < inputData.length - 1) {
				sb.append(" ");
			}
		}
		sb.append("\n").append(swapCnt);
		System.out.println(sb.toString());
	}

	public static int selectionSort(int[] A) {
		int swapCnt = 0;
		for (int i = 0; i < A.length; i++) {
			int minIdx = i;
			for (int j = i; j < A.length; j++) {
				if (A[minIdx] > A[j]) {
					minIdx = j;
				}
			}
			if (i == minIdx) continue;
			int temp = A[i];
			A[i] = A[minIdx];
			A[minIdx] = temp;
			swapCnt++;
		}
		return swapCnt;
	}
}

Measured memory_bytes: 24436
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<sstream>
#include<stack>
#include<string>
#include<unordered_set>
#include<vector>

#define ll long long
#define P pair<int,int>
#define FOR(i,N) for(int i=0;i<(int)N;i++)
#define FORIN(i,a,b) for(int i=a;i<(int)b;i++)
#define ALL(x) (x).begin(),(x).end()
#define LAST(x) (x)[(x).size()-1]
#define GI(name) int (name);scanf("%d",&(name))
#define GI2(name1,name2) int (name1),(name2);scanf("%d %d",&(name1),&(name2))
#define GI3(name1,name2,name3) int (name1),(name2),(name3);scanf("%d %d %d",&(name1),&(name2),&(name3))
#define GVI(name,size) vector<int> (name)(size);FOR(i,(size))scanf("%d",&(name)[i])
#define MOD 1000000007

using namespace std;

string to_hex(int x){
    stringstream ss;
    ss<<hex<<x;
    return ss.str();
}

inline int get_int(){
    int ret;
    scanf("%d",&ret);
    return ret;
}

inline vector<int> get_ints(int n){
    vector<int> ret(n);
    FOR(i,n){
        scanf("%d",&ret[i]);
    }
    return ret;
}

inline string get_str(){
    string ret;
    cin>>ret;
    return ret;
}

bool is_prime(int n){
    int s=sqrt(n)+1;
    for(int i=2;i<=s;++i){
        if(n%i==0){
            return 0;
        }
    }
    return 1;
}

vector<P> prime_division(int n){
    vector<P> ret;
    int s=sqrt(n)+1;
    int c=0;
    for(int i=2;i<=n;++i){
        if(n%i==0){
            c=0;
            do{
                ++c;
                n/=i;
            }while(n%i==0);
            ret.push_back(P(i,c));
        }
    }
    return ret;
}

struct UnionFind{
    vector<int> data;
    UnionFind(int size){
        data=vector<int>(size,-1);
    }
    bool union_set(int x,int y){
        x=root(x);
        y=root(y);
        if(x!=y){
            if(data[y]<data[x])swap(x,y);
            data[x]+=data[y];
            data[y]=x;
        }
        return x!=y;
    }
    bool find(int x,int y){
        return root(x)==root(y);
    }
    int root(int x){
        return data[x]<0?x:data[x]=root(data[x]);
    }
    int size(int x){
        return -data[root(x)];
    }
};

string to_string(string s){
    return s;
}

template<class T>
string to_string(vector<T> v){
    string ret="{";
    FOR(i,v.size()-1){
        ret+=to_string(v[i])+",";
    }
    if(v.size()>0){
        ret+=to_string(LAST(v));
    }
    ret+="}";
    return ret;
}

void debug_print(){
    cerr<<endl;
}

template<class Head,class... Tail>
void debug_print(Head head,Tail... tail){
    cerr<<to_string(head)<<" ";
    debug_print(tail...);
}

template<class... T>
void debug(T... args){
    cerr<<"["<<__LINE__<<"]: ";
    debug_print(args...);
}

void print(){
    cout<<endl;
}

template<class Head,class... Tail>
void print(Head head,Tail... tail){
    cout<<to_string(head);
    print(tail...);
}

int main(){
    GI3(A,B,T);
    print(B*(T/A));
    return 0;
}

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

typedef long long ll;
ll n, q, cnt, mr, mc, r[200005], c[200005];
int main() {
	ll z, x, i;
	cin >> n >> q;
	mr = mc = n;
	while(q--) {
		scanf("%lld%lld", &z, &x);
		if(z == 1) {
			if(x < mc) {
				cnt += mr-2;
				for(i=x+1; i<mc; i++) c[i] = mr-2;
				mc = x;
			} else {
				cnt += c[x];
			}
		} else {
			if(x < mr) {
				cnt += mc-2;
				for(i=x+1; i<mr; i++) r[i] = mc-2;
				mr = x;
			} else {
				cnt += r[x];
			}
		}
	}
	cout << (n-2) * (n-2) - cnt;
	return 0;
}

Measured memory_bytes: 6804
#include<stdio.h>
int main(){
int sum=0,ans=0,n,i,t,r,l,a[100010];
scanf("%d %d\n",&n,&t);
for(i=0;i<=t;i++){
a[i]=0;
}
for(i=0;i<n;i++){
scanf("%d %d\n",&l,&r);
a[l]++;
a[r]--;
}
for(i=0;i<=t;i++){
sum=sum+a[i];
if(sum>ans){
ans=sum;
}
}
printf("%d\n",ans);
return 0;
}


Measured memory_bytes: 2176
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {

		try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){

			final String inputLine = br.readLine();

			final Double r = Double.valueOf(inputLine);

			final Double area = r * r * Math.PI;
			final Double circumference = 2 * Math.PI * r;

			System.out.format("%f %f\n", area, circumference);
		}
	}
}


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

ll inf =1e9+7;


bool isprime(ll a)
{
	
	ll cnt=0;	
	for(ll i=1;i*i<a;i++)
	{
		
	 	if(a%i==0)
	 	{
	 		cnt+=2;
		 }
		
		
	}
	
		if(cnt==2)
		return true;
		else
		return false;
		
}
ll mod(ll a)
{
	if(a<inf)return a;
	else
	return a%inf;
}
void solve()
{



ll n;
cin>>n;

n=n%10;
if(n==3)
{
	cout<<"bon";
}
else if(n==0||n==1||n==6||n==8)
{
	cout<<"pon";
}
else
cout<<"hon";

}

int main()
{


ios::sync_with_stdio(0); 
	cin.tie(0);

		solve();
	
return 0;

		
	}
	
	
	


Measured memory_bytes: 3632
n = int(input())
dp = [[0, 0, 0] for _ in range(n)]
dp[0][0], dp[0][1], dp[0][2] = map(int, input().split())

for i in range(n-1):
    a, b, c = map(int, input().split())
    dp[i+1][0] = max(dp[i+1][0], dp[i][1]+a)
    dp[i+1][0] = max(dp[i+1][0], dp[i][2]+a)
    dp[i+1][1] = max(dp[i+1][1], dp[i][0]+b)
    dp[i+1][1] = max(dp[i+1][1], dp[i][2]+b)
    dp[i+1][2] = max(dp[i+1][2], dp[i][0]+c)
    dp[i+1][2] = max(dp[i+1][2], dp[i][1]+c)

print(max(dp[n-1]))

Measured memory_bytes: 22820
#include <bits/stdc++.h>
#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++)
using namespace std;

int main() {
  int n; 
  cin>>n;
  double ans=0;
  rep(i,n){
    double a;
    string b;
    cin>>a>>b;
    if(b=="JPY"){
      ans+=a;
    }
    else{
      ans+=a*380000.0;
    }
  }
  
  cout<<fixed<<setprecision(8);
  cout<<ans<<endl;
}

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

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  
  if((a!=b && b!=c && c!=a) || (a==b && b==c && c==a)){
    cout << "No" << endl;
  }else{
    cout << "Yes" << endl;
  }
}

Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            MainStream();
        }
        static void MainStream()
        {
            Scan sc = new Scan();
            write wr = new write();

            int r = sc.intarr[0];

            wr.wri(3 * r * r);
        }


    }

    class Scan
    {
        public string str => Console.ReadLine();

        public string[] strarr => str.Split(' ');

        public long[] longarr => strarr.Select(long.Parse).ToArray();
        public int[] intarr => strarr.Select(int.Parse).ToArray();
        public char[] chararr => str.ToArray();


    }



    class write
    {
        public void wri<Type>(Type x)
        {
            Console.WriteLine(x);
        }
    }

    class Method
    {
        static public int max(params int[] nums)
        {

            int maxx = nums[0];
            for (int i = 1; i < nums.Length; i++)
            {
                maxx = Math.Max(maxx, nums[i]);
            }
            return maxx;
        }
    }
}


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

bool isPrime(int x)
{
  if(x == 1) return false;
  for(int i = 2; i < x; i++)
    if(x%i == 0) return false;
  return true;
}

int main()
{
  vector<int> v;

  for(int i = 0; i*5 < 55555; i++){
    if(isPrime(i*5+1)) v.push_back(i*5+1);
  }

  int n;
  cin >> n;

  for(int i = 0; i < n; i++){
    if(i != 0) cout << " ";
    cout << v[i];
  }
  cout << endl;

  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <math.h>
#include <stdlib.h>
#include <algorithm>
#include <string.h>
#define ll long long
#define me(a,b) memset(a,b,sizeof(a))
using namespace std;
ll f[100005];
int a[50];
int main()
{
    int n;
    scanf("%d",&n);
    int i=0;
    if(n==0)
        printf("0\n");
    else
    {
        while(n)
        {
            if(n%2!=0)
            {
                a[i]=1;
                n=(n-1)/(-2);
            }
           else
           {
               a[i]=0;
               n=n/(-2);
           }
            i++;
        }
        for(int j=i-1; j>=0; j--)
        {
            printf("%d",a[j]);
        }
        puts("");
    }
    return 0;
}


Measured memory_bytes: 256