akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
#include <map>
#include <string.h>
#include <cstring>
#include <stack>
#include <queue>

typedef long long ll;
#define ALL(obj) (obj).begin(),(obj).end()
using namespace std;

long long GCD(long long x, long long y){
   long long r, tmp;
   if(x < y){
       tmp = x;
       x = y;
       y = tmp;
   }
   while(y!=0){
       r = x%y;
       x = y;
       y = r;
   }
   return x;
}
long long LCM(long long x, long long y){
   long long lcm = (x*y)/GCD(x, y);
   return lcm;
}

int bubblesort(int n){
    vector<int> data(n);
    int num=0;
    for(int end = n-1; end>0; end--){
        for(int j=0; j<end; j++){
            if(data[j+1] < data[j]){
                int temp = data[j];
                data[j] = data[j+1];
                data[j+1] = temp;
                num++;
            }
        }
    }
    return num;
}

int main(){
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    long long x, y, z, t;
    x = a*c;
    y = a*d;
    z = b*c;
    t = b*d;
    long long ans = max(max(x, y), max(z, t));
    cout << ans << endl;
}


Measured memory_bytes: 3632
// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <iostream>
#include <cstdlib>
#include <bits/stdc++.h>

#define int int64_t

using namespace std;

signed main()
{
    int n;
    
    cin >> n;
    vector<int> v;

    v.resize(n);
    
    int cnt = 0;
    int ans = 0;
    int min = std::numeric_limits<int>::max();
    
    for (auto &a : v) {
        cin >> a;
        if (a < 0) {
            cnt++;
            a = abs(a);
        }
        
        if (a < min) {
            min = a;
        }
        
        ans += a;
    }
    
    if (cnt % 2 == 1) {
        ans = ans - min - min;
    }
    
    cout << ans << endl;
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://cppreference.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   https://www.boost.org/doc/


Measured memory_bytes: 1152
#include <vector>
#include <iostream>

using namespace std;

vector<int> m;

int proc(vector<int>& vec, int n) {
  if (n == 0) {
    return 0;
  } else if (n == 1) {
    return abs(vec[1] - vec[0]);
  }

  if (m[n] > 0) {
    return m[n];
  }

  int b = abs(vec[n] - vec[n-2]) + proc(vec, n-2);
  int a = abs(vec[n] - vec[n-1]) + proc(vec, n-1);

  int r = min(a, b);
  m[n] = r;
  return r;
}

int main(void) {
  int n;

  cin >> n;
  vector<int> vec;

//  vec.resize(n);
  m.resize(n);

  for (size_t i = 0; i < n; ++i) {
    int tmp;
    cin >> tmp;
    vec.push_back(tmp);
  }

//  int r = proc(vec, n-1);

  for (size_t i = 1; i < n; ++i) {
    if (i == 1) {
      m[i] = abs(vec[1] - vec[0]);
      continue;
    }
    int a = abs(vec[i] - vec[i-1]) + m[i-1];
    int b = abs(vec[i] - vec[i-2]) + m[i-2];
    m[i] = min(a, b);
  }
  cout << m[n-1] << endl;
  return 0;
}


Measured memory_bytes: 1276
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner (System.in);
		int n = sc.nextInt(), m = sc.nextInt();
		boolean[] ch = new boolean[n];
		Arrays.fill(ch, false);
		int[] co = new int[n];
		Arrays.fill(co, 0);
		for(int i = 0; i < m; i++) {
			int x = sc.nextInt()-1;
			String s = sc.next();
			if(!ch[x] && s.equals("WA")) {
				co[x]++;
			}else if(s.equals("AC")){
				ch[x] = true;
			}
		}
		int acn = 0, pen = 0;
		for(int i = 0; i < n; i++) {
			if(ch[i]) {
				acn++;
				pen += co[i];
			}
		}
		System.out.println(acn + " " + pen);
	}

	static class FastScanner {
		private BufferedReader reader = null;
	    private StringTokenizer tokenizer = null;
	    public FastScanner(InputStream in) {
	        reader = new BufferedReader(new InputStreamReader(in));
	        tokenizer = null;
	    }

	    public String next() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                tokenizer = new StringTokenizer(reader.readLine());
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }
	        return tokenizer.nextToken();
	    }

	    public String nextLine() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                return reader.readLine();
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }

	        return tokenizer.nextToken("\n");
	    }

	    public long nextLong() {
	        return Long.parseLong(next());
	    }

	    public int nextInt() {
	        return Integer.parseInt(next());
	    }

	    public double nextDouble() {
	         return Double.parseDouble(next());
	     }

	    public int[] nextIntArray(int n) {
	        int[] a = new int[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextInt();
	        return a;
	    }

	    public long[] nextLongArray(int n) {
	        long[] a = new long[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextLong();
	        return a;
	    }
	}
}


Measured memory_bytes: 40920
package main

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

func chmax(a *int, b int) bool {
	if *a < b {
		*a = b
		return true
	}
	return false
}

var sc = bufio.NewScanner(os.Stdin)

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

func main() {
	var n, w int
	inputLine := strings.Split(newLine(), " ")
	n, _ = strconv.Atoi(inputLine[0])
	w, _ = strconv.Atoi(inputLine[1])

	dp := make([][]int, n+1)
	for i := 0; i < n+1; i++ {
		dp[i] = make([]int, w+1)
	}
	var weight, value int
	for i := 1; i < n+1; i++ {
		inputLine = strings.Split(newLine(), " ")
		weight, _ = strconv.Atoi(inputLine[0])
		value, _ = strconv.Atoi(inputLine[1])
		for j := 0; j < w+1; j++ {
			chmax(&dp[i][j], dp[i-1][j])
			if j-weight >= 0 {
				chmax(&dp[i][j], dp[i-1][j-weight]+value)
			}
		}
	}
	//fmt.Println(dp)
	fmt.Println(dp[n][w])
}


Measured memory_bytes: 81792
import sys
#import time
#import copy
#from collections import deque, Counter, defaultdict
#from fractions import gcd
#import bisect
#import itertools
import numpy as np
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

def ri():
    return list(map(int, input().split()))
def rs():
    return list(input().strip())
a, b , h , m = ri()

ang=abs((h+m/60)*30-m*6)

c = np.sqrt(a**2+b**2-2*a*b*np.cos(ang/180*np.pi))

print(c)

Measured memory_bytes: 27200
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#define MAX(X, Y) (((X) > (Y))? (X) : (Y))
#define MIN(X, Y) (((X) < (Y))? (X) : (Y))
int compare_int(const void *a, const void *b){
  return *(long int*)b - *(long int*)a; // 大きい順
}
int compare_int_small(const void *a, const void *b){
  return *(long int*)a - *(long int*)b; // 小さい順
}
// 公約数
long long int gcd(long long int a, long long int b){
  if(b == 0){
    return a;
  }else{
    return gcd(b, a % b);
  }
}
// 最小公倍数 = a * b / 最大公約数
// 公倍数
long long int lcm(long long int a, long long int b){
  return a * b / gcd(a, b);
}

// 5min
int main(void){
  int a, b, c;
  int ans = 0;

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

  ans = a * b / 2;

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


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

#ifdef LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif

using namespace std;

#define REP(i, a, b) for(int i = (a); i < int(b); ++i)
#define rep(i, n) REP(i, 0, n)
#define ALL(x) begin(x), end(x)

template<class T> inline void chmax(T &a, const T &b) { if(a < b) a = b; }
template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; }


struct edge {
	int to, need;
	edge(int to_, int need_):to(to_), need(need_) {}
};

typedef pair<int, int> state;
typedef vector<vector<edge>> graph;
constexpr int ok = 0;
constexpr int INF = (1 << 29);

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

	int n, m, e, s, t, r;
	cin >> n >> m >> e >> s >> t >> r;

	vector<int> event(n, 0);
	graph G(n);

	for(int i = 0; i < m; ++i) {
		int a, b;
		cin >> a >> b;
		G[a].emplace_back(b, ok);
		G[b].emplace_back(a, ok);
	}

	for(int i = 0; i < e; ++i) {
		int a, b, c;
		cin >> a >> b >> c;
		const int bit = 1 << i;
		event[c] = bit;
		G[a].emplace_back(b, bit);
		G[b].emplace_back(a, bit);
	}

	int ans = INF;
	vector<vector<int>> dist(n, vector<int>(1 << e, INF));
	vector<vector<int>> day(n, vector<int>(1 << e, INF));
	queue<state> que;

	dist[s][event[s]] = 0;
	day[s][event[s]] = 0;
	que.emplace(s, event[s]);

	for(int i = 0; i <= e; ++i) {
		vector<vector<bool>> used(n, vector<bool>(1 << e, false));

		while(!que.empty()) {
			const int v = que.front().first;
			const int bit = que.front().second;
			que.pop();

			if(day[v][bit] >= r) {
				while(!que.empty()) que.pop();
				break;
			}

			if(used[v][bit]) continue;
			used[v][bit] = true;

			for(const auto &E : G[v]) {
				if(E.need == ok || (E.need & bit)) {
					const int next_bit = bit | event[E.to];
					if(dist[E.to][next_bit] > dist[v][bit] + 1) {
						dist[E.to][next_bit] = dist[v][bit] + 1;
						day[E.to][next_bit] = day[v][bit] + 1;
						que.emplace(E.to, next_bit);
					}
				}
			}
		}

		for(int bit = 0; bit < (1 << e); ++bit) {
			chmin(ans, dist[t][bit] + i);

			bool update = false;
			for(int v = 0; v < n; ++v) {
				if(v == s) continue;

				if(dist[s][bit] > dist[v][bit]) {
					dist[s][bit] = dist[v][bit];
					update = true;
				}
				dist[v][bit] = INF;
			}

			if(update) {
				day[s][bit] = 0;
				que.emplace(s, bit);
			}
		}
	}

	cout << (ans == INF ? -1 : ans) << endl;

	return EXIT_SUCCESS;
}

Measured memory_bytes: 1656
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define chmin(x, y) x = min(x, y)

int main(){
  int N;
  cin >> N;
  int cnt = 0;
  while(pow(2, cnt) <= N){
    cnt++;
  }
  cnt--;
  cout << pow(2, cnt) << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define INF 1e9
typedef long long ll;
using namespace std;

int main() {
    int n; cin >> n;
    vector<int> v(n);
    rep(i,n){
        cin >> v[i];
    }
    int count = 1;
    int num = 1;
    int count1 = 0;
    rep(i,pow(10,5)+1){     
        num = v[num-1];
        if(num==2){
            cout << count << endl;
            count1 += 1;
            break;
        }
        count += 1;
    }
    if(count1 == 0){
        cout << -1 << endl;
    }
    return 0;
}

Measured memory_bytes: 640
n,m,x=map(int,input().split())
a=[list(map(int,input().split())) for _ in range(n)]
minc=float("inf")

for i in range(2**n):
  lst=[0]*(m+1)
  for bit in range(n):
    if (i>>bit)&1==1:
      for ii,aa in enumerate(a[bit]):
        lst[ii]+=aa
  if min(lst[1:]) >= x:
    minc=min(minc,lst[0])
    
print(-1 if minc == float("inf") else minc)
      
    


Measured memory_bytes: 9192
N = int(input())
A = list(map(int, input().split()))

r = [0] * N


def f(n):
    """
    nの倍数のボールの数
    """
    cnt = 0
    t = n + n
    while t <= N:
        cnt += r[t-1]
        t += n
    return cnt


for i in range(N):
    n = N - i
    x = f(n)
    if x % 2 == A[n-1]:
        pass
    else:
        r[n-1] += 1

# print(r)

ans = []
for i, ri in enumerate(r):
    if ri == 1:
        ans.append(str(i+1))

if len(ans) == 0:
    print(0)
else:
    print(len(ans))
    print(" ".join(ans))

Measured memory_bytes: 17204
#include<bits/stdc++.h>
using namespace std;
using lli = long long int;
using ld = long double;
using ulli = unsigned long long int;
#define filein freopen ("in.txt", "r", stdin)
#define fileout freopen ("out.txt", "w", stdout)
#define dbg(args...) do {cerr << #args << " : "; debug(args); } while(0)
#define all(v) ((v).begin()),((v).end()) 
#define pb emplace_back
#define mp make_pair
#define PI 3.14159265
#define mod 1000000007
void debug () {cerr << endl;}
template < typename T, typename ... hello>void debug( T arg, const hello &... rest) {cerr << arg << ' ';debug(rest...);}
int dx[8]= {1,0,-1,0,-1,-1,1,1};
int dy[8]= {0,1,0,-1,-1,1,-1,1};
void solve(){
	int n;
	cin>>n;
	map<int,int> nums;
	for(int i = 0;i<n -  1;i++){
		int x;
		cin>>x;
		nums[x] += 1;
	}
	for(int i = 1;i<=n;i++){
		cout<<nums[i]<<"\n";
	}
}
int main(){
	ios::sync_with_stdio(false);
    cin.tie(nullptr);
    solve();
}



Measured memory_bytes: 12984
import sys, heapq


def main():
    
    input = sys.stdin.readline
    
    N, M = map(int, input().split())
    value = []
    heapq.heapify(value)
    for inp in input().split():
        heapq.heappush(value, -int(inp))

    for _ in range(M):
        new_elem = -(- heapq.heappop(value) // 2)
        heapq.heappush(value, new_elem)

    print(- sum(value))
    
if __name__=="__main__":
    main()

Measured memory_bytes: 14172
#include<stdio.h>
#include<iostream>
#include<string.h>
#include<algorithm>

using namespace std;

long long a[100015];

int main(){
	
	long long n,i,lv,rv,ans;
	scanf("%lld",&n);
	for(i=1;i<=n;i++)
		scanf("%lld",&a[i]);
	sort(a+1,a+1+n);
	lv=a[1];
	rv=a[n];
	ans=a[n]-a[1];
	for(i=2;i+i<=n;i++){
		ans+=a[n-i+1]-lv;
		ans+=rv-a[i];
		lv=a[i];
		rv=a[n-i+1];
	}
	if(n&1)ans+=max(rv-a[i],a[i]-lv);
	printf("%lld",ans);
	return 0;
}
		
	

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

using namespace std;

int main(void) {

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

	int d, r;
	double f;
	d = a / b;
	r = a % b;
	//f = (double)a / double(b);
	f = static_cast<double>(a) / static_cast<double>(b);

	cout << d << " " << r << " ";
	printf("%.8f\n",f);

	return 0;
}

Measured memory_bytes: 1240
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define pi pair<int,int> 
#define pb push_back
#define INF INT_MAX 
#define mod 1000000007ll
#define fi first
#define se second
#define f(i,p,q) for(int i=p;i<q;i++)
#define si(a) scanf("%d",&a)
#define sii(a,b) scanf("%d %d",&a,&b)
#define siii(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define pii(a) printf("%d\n",a)
#define psi(a) printf(" %d",a)
#define poi(a) printf("%d",a)
#define sl(a) scanf("%lld",&a)
#define pl(a) printf("%lld\n",a)
#define Nline() printf("\n")
#define sstr(str) scanf("%s",str)
#define pstr(str) printf("%s\n",str)
#define SET(a) memset(a,-1,sizeof(a))
#define CLR(a) memset(a,0,sizeof(a))
#define vi vector<int>
#define vvi vector<vi>
#define all(v) (v).begin(),(v).end()
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())
#define VI(a,n) vi a(n); rep(i,n)cin>>a[i];
#define sq(n) (n)*(n)
#define iso ios::sync_with_stdio(false); cin.tie(0);cout.tie(NULL);
bool com(pair<int,int>p,pair<int,int>pp)
{
     return p.first<pp.first;
}
int main()
{  
    int n;
    cin>>n;
    vector<pair<int,int>>v;
    for(int i=1;i<=n;i++)
    {
        int x;cin>>x;
        v.pb({x,i});
    }
    sort(v.begin(),v.end(),com);
    for(int i=0;i<v.size();i++)
    cout<<v[i].se<<" ";
}

Measured memory_bytes: 1780
#include<bits/stdc++.h>
using namespace std;
//#define Fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
typedef vector<int>Vl;
typedef pair<int,int>PII;
typedef vector<PII>Vll;
typedef vector<pair<int,pair<int,int> > >Vlll;
typedef priority_queue<int>PQL;
typedef map<int,int>M;
#define S second
#define F first
#define mp make_pair
#define ms(x,y) memset(x,y,sizeof(x))
#define pb push_back
#define sl(n) cin>>n
#define pl(n) cout<<n
const int mod=1e9+7;
const int sze=1e4+2;
const int inf = 0x3f3f3f3f;
int dp[sze];
void solve(){
  int H,n;
  sl(H);sl(n);
  
  
  int a[n+1],b[n+1];
  for(int i=1;i<=n;i++){
	  cin>>a[i]>>b[i];
  }
  ms(dp,inf);
  dp[0]=0;
  int ans=inf;
  for(int i=1;i<=n;i++){
	  for(int h=0;h<H;h++){
		  
		  dp[min(h+a[i],H)]=min(dp[min(h+a[i],H)],dp[h]+b[i]);
	  }
	  ans=min(dp[H],ans);  
  }
  cout<<ans<<endl;
}

signed main(){
   int test=1;
   //sl(test);
   while(test--){
      solve();

   }
  return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ll, ll> l4;
typedef pair<double, double> dd;
#define mp make_pair
#define pb push_back
#define debug(x) cerr << #x << " = " << x << " "


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  
  int n;
  while (cin >> n)
    {
      vector<int> v(n);
      for (auto & e : v) cin >> e;
      sort(v.begin(), v.end());
      cout << ((unique(v.begin(), v.end()) == v.end())?"YES":"NO") << endl;
    }
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define loop(i, r, n) for (int i = (r); i < (n); i++)
#define pb push_back
#define all(in) in.begin(),in.end()

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

using ll = long long;
using ull = unsigned long long;
using namespace std;


int main() {
    int n; cin >> n;
    vector<int> a(n), b(n);
    vector<int> aa(n,0), bb(n,0);
    rep(i,n) { cin >> a[i]; aa[ --a[i] ]++; }
    rep(i,n) { cin >> b[i]; bb[ --b[i] ]++; }
    rep(i,n) if (aa[i] + bb[i] > n) { cout << "No" << endl; return 0; }

  
    queue<pair<int,int>> que;

    rep(i,n) {
        if (a[i] != b[i]) {
            if (que.empty()) continue;
            auto p = que.front();
            if (a[i] != p.first && b[i] != p.first) {
                que.pop();
                swap(b[p.second], b[i]);
            }
        }
        else if (a[i] == b[i]) {
            if (que.empty()) {
                que.push(make_pair(a[i],i));
                continue;
            }
            auto p = que.front();
            if (a[i] == p.first) que.push(make_pair(a[i],i));
            else {
                que.pop();
                swap(b[p.second], b[i]);
            }
        }
    }
    rrep(i,n) {
        if (a[i] != b[i]) {
            if (que.empty()) continue;
            auto p = que.front();
            if (i == p.second) continue;
            if (a[i] != p.first && b[i] != p.first) {
                que.pop();
                swap(b[p.second], b[i]);
            }
        }
        else if (a[i] == b[i]) {
            auto p = que.front();
            if (i == p.second) continue;
            if (a[i] != p.first) {
                que.pop();
                swap(b[p.second], b[i]);
            }
        }
    }

    while (!que.empty()) {
        auto p = que.front();
        que.pop();
        int i = 0;
        while (i < n) {
            if (a[i] != p.first && b[i] != p.first && i != p.second) {
                b[p.second] = b[i];
                b[i] = p.first;
                break;
            }
            i++;
        }
        if (i == n) { cout << "No" << endl; return 0; }
    }

    cout << "Yes" << endl;
    rep(i,n) cout << b[i] + 1 << " ";
    cout << endl;
    return 0;
}


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

int main() {    
    int a, b, c, k;
    cin >> a >> b >> c >> k;

    int sum = 0;
    rep(i,k) {
        if(i < a) sum++;
        else if(i < a+b);
        else sum--;
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3596
#include <iostream>
#include <cmath>

using namespace std;
long long x[200005], y[200005];
long long n, d;
long long ans = 0;

int main() {
    cin >> n >> d;
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i];
        if (sqrt(x[i] * x[i] + y[i] * y[i]) <= d) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 6796
#define _GLIBCXX_DEBUG

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

int main(){
    int N;
    cin >> N;
    int now = 1000000000;
    int count = 0;

    vector<int> data(N);

    rep(i, N)
    {
        cin >> data.at(i);
    }
    sort(data.begin(), data.end(), greater<int>());

    rep(i, N)
    {
        if(data.at(i) < now){
            now = data.at(i);
            count++;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 3664
use proconio::input;
use proconio::fastout;
use std::collections::HashMap;

#[fastout]
fn main() {
    input! {
        n: usize,
        a: [usize; n],
        q: usize,
        bc: [(usize, usize); q],
    }

    let mut sum_list: HashMap<usize, usize> = HashMap::new();
    let mut sum_all = 0;
    for v in a {
        let mut sum_now = sum_list.entry(v).or_insert(0);
        *sum_now += v;
        sum_all += v;
    }

    for (b, c) in bc {
        if sum_list.get(&b) == None {
            println!("{}", sum_all);
            continue
        }
        let sum_now = sum_list[&b];
        sum_all -= sum_now;
        let sum_new = sum_now / b * c;
        sum_list.remove(&b);
        let mut sum_past = sum_list.entry(c).or_insert(0);
        *sum_past += sum_new;
        sum_all += sum_new;
        println!("{}", sum_all);
    }

}


Measured memory_bytes: 9524
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <numeric>
#include <math.h>
#include <algorithm>
#include <functional>
#include <string>
#include <array>
#include <vector>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <queue>
#include <complex>
#define full(c) c.begin(), c.end()
#define vector2d(name,type,h,w,init) vector<vector<type>> name(h,vector<type>(w,init)) 
const int PRIME = 1000000007;
const int INT_INF = 2147483647;
const long long int LL_INF = 9223372036854775807;
const double PI = acos(-1);
const double EPS = 0.000000001;
typedef unsigned long long int ull;
typedef long long int ll;
using namespace std;

int main(){
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	ll x, y, z, N, Y;
	cin >> N >> Y;
	for (x = 0; x <= N; x++){
		for (y = 0; y <= N; y++){
			z = N - x - y;
			if (z < 0 || N < z) continue;
			if (10000 * x + 5000 * y + 1000 * z == Y){
				cout << x << " " << y << " " << z << endl;
				return 0;
			}
		}
	}
	cout << -1 << " " << -1 << " " << -1 << endl;
	return 0;
}


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

typedef long long ll;
const int MaxN = 1123456;
const ll mod = 1000000007;
const ll inf = 1000000005LL;

double dp[305][305][305];

class Solver {
    int n;
	int* a;
	public:
	Solver(int nn) {
		n = nn;
		a = new int[n + 1];
		solve();
	}
	
	void solve() {
		ll x = 0, y = 0, z = 0;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		
		for (int i = 0; i < n; i++) {
			if (a[i] == 1) x++;
			if (a[i] == 2) y++;
			if (a[i] == 3) z++;
		}
		
		cout << go(x, y, z);
	}
	
	double go(int x, int y, int z) {
		if (!x && !y && !z) return 0;
		if (dp[x][y][z] > 0) return dp[x][y][z];
		
		double sum = x + y + z;
		double ans = n / sum;
		if (x) ans += x / sum * go(x - 1, y, z);
		if (y) ans += y / sum * go(x + 1, y - 1, z);
		if (z) ans += z / sum * go(x, y + 1, z - 1);
		return dp[x][y][z] = ans;
	}
};

void solve_case() {
	//cout << "hell";
    int n;
	cin >> n;
	cout << setprecision(30) << fixed;
	Solver s(n);
}

signed main() {
    /*ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);*/
    
    int t=1;
    //cin >> t;
    while(t--) solve_case();
}


Measured memory_bytes: 112668
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int main()
{
    int x1, y1, x2, y2, x3, y3, x4, y4;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    int dx = abs(x1-x2);
    int dy = abs(y1-y2);
    if (y2>=y1) {
        if (x2>=x1) {
            x3 = x2 - dy;
            y3 = y2 + dx;
            x4 = x1 - dy;
            y4 = y1 + dx;
        } else {
            x3 = x2 - dy;
            y3 = y2 - dx;
            x4 = x1 - dy;
            y4 = y1 - dx;
        }
    } else {
        if (x2>=x1) {
            x3 = x2 + dy;
            y3 = y2 + dx;
            x4 = x1 + dy;
            y4 = y1 + dx;
        } else {
            x3 = x2 + dy;
            y3 = y2 - dx;
            x4 = x1 + dy;
            y4 = y1 - dx;
        }
    }
    printf("%d %d %d %d\n", x3, y3, x4, y4);
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#include<math.h>
using namespace std;
using ll = long long;

int main(){ 
 unsigned long long a, b;
 ll v, w;
 ll t;
 cin >>a>>v;
 cin >> b >> w;
 cin >> t;
 if(llabs(a-b) <= t*(v-w)) cout << "YES" << endl;
   else cout << "NO" << endl;
   return 0;
cout <<  llabs(a-b)  << " " <<   t*(v-w) << endl;
} 

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

using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;
using P = pair<int, int>;

const int INF = 1e9;
const ll INFLL = 1e18;
const int MOD = 1e9 + 7;
const int NIL = -1;
const ld PI = acosl(-1);

#define rep(i,n) for(int i=0; i<(n); ++i)
#define all(n) n.begin(),n.end()

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

int main()
{
	ios::sync_with_stdio(false); cin.tie(nullptr);
	//cout << fixed << setprecision(6);
	int n; cin >> n;
	ld t, a;
	cin >> t >> a;
	vi h(n);
	rep(i, n) cin >> h[i];

	vector<ld> tmp(n);
	rep(i, n) tmp[i] = t - h[i] * 0.006;
	ld min = INFLL;
	int index = 0;
	rep(i, n)
	{
		if(chmin(min, abs(a - tmp[i])))
			index = i + 1;
	}

	cout << index << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using ll=long long;
using ld=long double;
#define inf INT_MAX  
const ll infll=1ll*inf*inf;
#define mode 998244353
#define mod 1000000007
const long double PI=3.141592653589793238462643383279502884197169399375105820974944;
#define pb push_back
#define mp make_pair
#define ub upper_bound 
#define lb lower_bound 
#define far(i,a,b) for (ll i = a; i <= b; i++)
#define rev(i,a,b) for (ll i = a; i >= b; i--)
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define sz(a) int((a).size())
#define ftr(c,i) for(auto i = begin(c); i != end(c); i++)
#define rtr(c,i) for(auto i = rbegin(c); i != rend(c); i++)
#define pre(c,x) ((c).find(x) != (c).end())
#define cpre(c,x) (find(all(c),x) != (c).end())
#define mll map<ll,ll>
#define vs vector<string>
#define vi vector<int>
#define vl vector<ll>
#define pll pair<ll,ll>
#define pii pair<int,int>
#define vii vector<pii >
#define vll vector<pll >
#define vvl vector<vector<ll> >
#define vvi vector< vector<int > >
#define W(t) while(t --)
#define print(arr) for (auto it = arr.begin(); it != arr.end(); ++it) cout <<(ll)(it-arr.begin()) << ')' <<  *it << ' '; cout << endl;
#define printii(arr) for (auto it = arr.begin(); it != arr.end(); ++it) cout << it->ff<<' '<<it->ss << endl; cout << endl;
#define MID(i,j) ((i)+(j))/2
#define nl '\n' 
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
ll max(ll a,ll b) {return (a>b? a:b);}
ll min(ll a,ll b) {return (a>b? b:a);}
ll gcd(ll a,ll b) {return (b==0)? a:gcd(b,a%b); }
ll gcd(ll a,ll b,ll & x,ll & y) {
    if (a == 0) {
        x = 0;
        y = 1;
        return b;
    }
    ll x1, y1;
    ll d = gcd(b % a, a, x1, y1);
    x = y1 - (b / a) * x1;
    y = x1;
    return d;
}
ll modinv(ll a,ll b){
	ll x,y;
	gcd(a, b, x, y);
	return (x%b + b)%b;
}
ll ceiling(ll a,ll b){ 
        if(a%b==0) return a/b;
        else return a/b+1;
}
ll powm(ll a,ll b,ll m){
	a%=m;
	ll res=1;
	while(b>0){
		if(b&1) res=(res*a)%m;
		b>>=1;
		a=a*a%m;
	}
	return res;
}
const int N=1e6+5;
ll n,m,q,t,k,x,y,z;
vs mat(2005);
vvi rl(2005,vi(2005)),cl=rl;
int main()
{
	fio;
	cin >> n >> m;
	string s;
	far(i,1,n) cin >>s,mat[i]+=' '+s+'#';
	far(i,0,m) mat[n+1]+='#';
	far(i,1,n){
		x=0;
		far(j,1,m+1){
			if(mat[i][j]=='#'){
				y=j-x-1;
				while(++x<j) rl[i][x]=y; 
			}
		}
	}
	far(i,1,m){
		x=0;
		far(j,1,n+1){
			if(mat[j][i]=='#'){
				y=j-x-1;
				while(++x<j) cl[x][i]=y; 
			}
		}
	}

	far(i,1,n)
	far(j,1,m){
		if(mat[i][j]!='#') z=max(z,rl[i][j]+cl[i][j]-1);
	}
	cout << z << nl;






}


Measured memory_bytes: 35968
#include <cstdio>

struct node {
  int key;
  node *left, *right;
  node(int key) : key(key), left(nullptr), right(nullptr) {}
  ~node() {
    delete left;
    delete right;
  }
};

enum order {
  pre,
  in
};

void rec(node *t, order o) {
  if (!t)
    return;
  if (o == pre)
    printf(" %d", t->key);
  rec(t->left, o);
  if (o == in)
    printf(" %d", t->key);
  rec(t->right, o);
}

int main() {
  node *T(nullptr);
  size_t m;
  scanf("%zu\n", &m);
  for (size_t i = 0; i < m; i++) {
    char s[8];
    scanf("%s", s);
    switch (s[0]) {
      case 'i':
        {
          int k;
          scanf("%d", &k);
          node *x = T, *y = nullptr, *z = new node(k);
          while (x) {
            y = x;
            x = z->key < y->key ? y->left : y->right;
          }
          (y ? z->key < y->key ? y->left : y->right : T) = z;
        }
        break;
      case 'f':
        {
          int k;
          scanf("%d", &k);
          bool found = false;
          for (auto x = T; x; x = k < x->key ? x->left : x->right)
            if (x->key == k) {
              found = true;
              break;
            }
          puts(found ? "yes" : "no");
        }
        break;
      case 'd':
        {
          int k;
          scanf("%d", &k);
          node *x = T, *y = nullptr;
          while (x) {
            if (x->key == k)
              break;
            y = x;
            x = k < x->key ? x->left : x->right;
          }
          if (x->key == k) {
            if (x->left && x->right) {
              auto z = x->right, w = x;
              while (z->left) {
                w = z;
                z = z->left;
              }
              (z->key < w->key ? w->left : w->right) = z->right;
              z->right = nullptr;
              x->key = z->key;
              delete z;
            } else if (x->left) {
              (y ? x->key < y->key ? y->left : y->right : T) = x->left;
              x->left = nullptr;
              delete x;
            } else if (x->right) {
              (y ? x->key < y->key ? y->left : y->right : T) = x->right;
              x->right = nullptr;
              delete x;
            } else {
              (y ? x->key < y->key ? y->left : y->right : T) = nullptr;
              delete x;
            }
          }
        }
        break;
      default:
        rec(T, in);
        puts("");
        rec(T, pre);
        puts("");
        break;
    }
  }
  delete T;
  return 0;
}

Measured memory_bytes: 15156
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int>v(n),r(n);
    for(int i=0;i<n;i++)
    {
        cin>>v[i];
    }
    r=v;
    sort(v.begin(),v.end());
    int median=n/2-1;
    for(int i=0;i<n;i++)
    {
        if(v[median]>=r[i]){
            cout<<v[median+1]<<endl;
        }
        else
        {
            cout<<v[median]<<endl;
        }
    }
}

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

using namespace std;

int main() {
  int h, w;
  cin >> h >> w;
  char arr[100][100];
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      cin >> arr[i][j];
    }
  }
  for (int i = 0; i < w + 2; i++) {
    cout << '#';
  }
  cout << '\n';
  for (int i = 0; i < h; i++) {
    cout << '#';
    for (int j = 0; j < w; j++) {
      cout << arr[i][j];
    }
    cout << '#';
    cout << '\n';
  }
  
  for (int i = 0; i < w + 2; i++) {
    cout << '#';
  }

  return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) debug(x) debug(y);
#define repn(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) for(int i = 0; i < (int)(a); i++)
#define all(v) v.begin(), v.end() 
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sq(x) ((x) * (x))

template<class T> T gcd(T a, T b){ return ((b == 0) ? a : gcd(b, a % b)); }

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
	string s;
	cin >> s;
	rep(i, s.size() - 1){
		string s1 = s.substr(i, 2);
		if(s1[0] == s1[1]){
			cout << i + 1 << " " << i + 2 << endl;
			return 0;
		}
	}
	rep(i, s.size() - 2){
		string s1 = s.substr(i, 3);
		if(s1[0] == s1[2]){
			cout << i + 1 << " " << i + 3 << endl;
			return 0;
		}
	}
	cout << "-1 -1" << endl;
	return 0;
}
/*
Things to look out for:
	- Integer overflows
	- Array bounds
	- Special cases
Be careful!
*/


Measured memory_bytes: 512
import java.util.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int r = Integer.parseInt(sc.next());
        int d = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        for(int i = 0;i<10;i++){
            x = r*x-d;
            System.out.println(x);
        }
    }
}

Measured memory_bytes: 21844
from sys import stdin

n = int(stdin.readline().rstrip())
w = [int(x) for x in stdin.readline().rstrip().split()]

m = sum(w)

for i in range(n):
    w1 = w[:i]
    w2 = w[i:]
    wm = abs(sum(w1) - sum(w2))
    if wm < m:
        m = wm

print(m)

Measured memory_bytes: 2940
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int H = sc.nextInt();
		int W = sc.nextInt();
		int[][] A = new int[H][W];
		int[][] D = new int[H][W];
		for(int i=0; i<H; i++) {
			for(int j=0; j<W; j++) {
				A[i][j] = sc.nextInt();
			}
		}
		for(int i=0; i<H; i++) {
			for(int j=0; j<W; j++) {
				D[i][j] = Math.abs(A[i][j] - sc.nextInt());
			}
		}
		
		int LEN = (H+W)*80;
		boolean[][][] b = new boolean[H][W][LEN];
		
		b[0][0][D[0][0]] = true;
		for(int i=0; i<H; i++) {
			for(int j=0; j<W; j++) {
				if(i+1<H) {
					for(int k=0; k<LEN; k++) {
						if(b[i][j][k]) {
							b[i+1][j][k+D[i+1][j]] = true;
							b[i+1][j][Math.abs(k-D[i+1][j])] = true;
						}
					}
				}
				if(j+1<W) {
					for(int k=0; k<LEN; k++) {
						if(b[i][j][k]) {
							b[i][j+1][k+D[i][j+1]] = true;
							b[i][j+1][Math.abs(k-D[i][j+1])] = true;
						}
					}
				}
			}
		}

		for(int i=0; i<=LEN; i++) {
			if(b[H-1][W-1][i]) {
				System.out.println(i);
				sc.close();
				return;
			}
		}
		sc.close();
	}
}



Measured memory_bytes: 117900
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
#include <climits>
#include <cmath>
#include <utility>
#include <iomanip>

using namespace std;




int main(int argc, char *argv[])
{
	int n;

	//input
	cin >> n;



	//calc
	int ans = 0;
	
	if (n < 10){
		ans = n;
	}
	else if (n < 100){
		ans = 9;
	}
	else if (n < 1000){
		ans = 9;
		ans += (n - 99);
	}
	else if (n < 10000){
		ans = 909;
	}
	else if (n < 100000){
		ans = 909;
		ans += (n - 9999);
	}
	else{
		ans = 90909;
	}


	//ans
	cout << ans << endl;




	return 0;
}


Measured memory_bytes: 256
#include <iostream>  
#define ll long long
using namespace std;  
ll a[1000];
/* 欧几里得算法：递归法计算最大公约数 */  
long long gcd(long long m, long long n)  
{  
    return (m==0)?n:gcd(n%m, m);  
}  
  
// 计算最小公倍数函数  
long long lcm(long long a, long long b)  
{  
   return a / gcd(a, b) * b;  
  
}  
  
int main()  
{  
    int N;  
    cin>>N;
    for(int i=1;i<=N;i++)
	cin>>a[i]; 
    ll temp=a[1];
    for(int i=2;i<=N;i++) 
    {
    	temp=lcm(temp,a[i]);
	}
	cout<<temp<<endl; 
    return 0;  
}  


Measured memory_bytes: 256
#include<string>
#include<iostream>
#include<algorithm>
#include<set>
#include<math.h>
#include<vector>
#include<sstream>
#include<queue>
#include<functional>
#include<bitset>
#include<cstdio>
#include<iomanip>
#include<map>
#include <string.h>
using namespace std;
int a[2][105];
int dp[2][105];
int n;
int t, x, y, pt, px, py;


int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> t >> x >> y;
		t -= pt;
		x -= px;
		y -= py;
		if (t < x + y) {
			cout << "No" << endl;
			return 0;
		}
		else if ((t % 2) != (abs(x + y) % 2)) {
			cout << "No" << endl;
			return 0;
		}
		pt += t;
		px += x;
		py += y;

	}
	cout << "Yes" << endl;

	return 0;
}

Measured memory_bytes: 256
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
S = [input() for i in range(N)]
S.sort()
c = Counter(S)
m = 0
for word,num in c.items():
    m = max(m, num)
W = []
for word, num in c.items():
    if num == m:
        W.append(word)
W.sort()
print(*W, sep="\n")

Measured memory_bytes: 37608
#include <stdio.h>
#include <math.h>
int main(){
 
  int a,b;
  double c,C,cc;
   
  scanf("%d %d %lf",&a,&b,&C);
 
  C=C*M_PI/180;
   
  printf("%.5lf\n",a*b*sin(C)/2);
 
  cc=a*a+b*b-2*a*b*cos(C);
 
  c=sqrt(cc);
 
  printf("%.5lf\n",a+b+c);
 
  printf("%.5lf\n ",b*sin(C));
 
  return 0;
 
}

Measured memory_bytes: 700
#include<stdio.h>
#include<algorithm>
#include<functional>
#include<cmath>
using namespace std;
long long  mod = 1000000007;
int main()
{
	char S[100];
	scanf("%s", S);
	int i = 0;
	int count[26] = { 0 };
	while (S[i] != '\0') {
		if (count[S[i] - 'a'] == 1) {
			printf("no");
			return 0;
		}
		count[S[i] - 'a'] = 1;
		i++;
	}
	printf("yes");
	return 0;
}

Measured memory_bytes: 128
row, col = map(int, input().split())
li = [list(map(int, input().split())) for i in range(row)]
last_row = []

for i in range(col):
    s = 0
    for j in range(row):
        s += li[j][i]
    last_row.append(s)

for r in range(row):
    print(" ".join(map(str, li[r])), sum(li[r]))
print(" ".join(map(str, last_row)), sum(last_row))


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

using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vi> vvi;

#define INF (1e9)

int N;
ll MOD = 1000000007;

int main() {
    cin >> N;

    int a;
    vi A(N + 10);  // 同じ色で一人前の候補になる人数
    vi B(N + 10);  //
    A[0] = 3;
    ll ans = 1;
    for (int i = 0; i < N; i++) {
        cin >> a;
        if (A[a] <= A[a + 1]) {  // 前の人が足りない
            cout << 0 << endl;
            return 0;
        }
        int m = A[a] - A[a + 1];
        ans *= m;
        ans %= MOD;
        A[a + 1]++;
    }

    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <limits>
#include <string>
#include <algorithm>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include "math.h"
#include "assert.h"

using namespace std;

#define ll long long

#define BUFF ios::sync_with_stdio(false)
#define epsilon 1e-07
#define pi 2 * acos(0.0);
#define mod 1000000007   // 1e9+7
#define cerr if(false)cerr
#define watch(x) cerr << #x << " = " << x << endl;

#define inf std::numeric_limits<int>().max()

int main() {
	string n;
	cin >> n;
	if (n[n.size()-1] == '2') cout << "hon" << endl;
	if (n[n.size()-1] == '4') cout << "hon" << endl;
	if (n[n.size()-1] == '5') cout << "hon" << endl;
	if (n[n.size()-1] == '7') cout << "hon" << endl;
	if (n[n.size()-1] == '9') cout << "hon" << endl;


	if (n[n.size()-1] == '0') cout << "pon" << endl;
	if (n[n.size()-1] == '1') cout << "pon" << endl;
	if (n[n.size()-1] == '6') cout << "pon" << endl;
	if (n[n.size()-1] == '8') cout << "pon" << endl;

	if (n[n.size()-1] == '3') cout << "bon" << endl;
}


Measured memory_bytes: 3052
# coding: utf-8
# Your code here!
N, A, B = map(int, input().rstrip().split())
sum_of_integers = 0
for i in range(1, N + 1):
    sum_of_each_digit = sum(list(map(int, (str(i))))) #各桁の和を求める
    if A <= sum_of_each_digit and sum_of_each_digit <= B:
        sum_of_integers += i
print(sum_of_integers)


Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define all(c) begin(c), end(c)
#define dump(x) cerr << __LINE__ << ":\t" #x " = " << x << endl

using ld = double;
using P = complex<ld>;
using G = vector<P>;
const ld pi = acos(-1);
const ld eps = 1e-10;
const ld inf = 1e12;

ld cross(const P& a, const P& b) { return a.real()*b.imag() - a.imag()*b.real(); }
ld dot(const P& a, const P& b) { return a.real()*b.real() + a.imag()*b.imag(); }

using C = pair<ld, P>;
#define rad first
#define pnt second

C smallest_enclosing_disc(vector<P> ps){
    auto c3 = [](const P &a, const P &b, const P &c){
        ld A = norm(b - c);
        ld B = norm(c - a);
        ld C = norm(a - b);
        ld S = abs(cross(b - a, c - a));
        P p = (A*(B+C-A)*a + B*(C+A-B)*b + C*(A+B-C)*c) / (4*S*S);
        ld r = abs(p - a);
        return make_pair(r, p);
    };

    auto c2 = [](const P &a, const P &b){
        P c = (a + b) / (ld)2;
        ld r = abs(a - c);
        return make_pair(r, c);
    };

    auto in_circle = [](const P &a, const C &c){
        return norm(a - c.pnt) <= c.rad*c.rad + eps;
    };

    int n = ps.size();
    random_shuffle(ps.begin(), ps.end());
    C c = c2(ps[0], ps[1]);
    for(int i = 2; i < n; ++i){
        if(!in_circle(ps[i], c)){
            c = c2(ps[0], ps[i]);
            for(int j = 1; j < i; ++j){
                if(!in_circle(ps[j], c)){
                    c = c2(ps[j], ps[i]);
                    for(int k = 0; k < j; ++k){
                        if(!in_circle(ps[k], c)){
                            c = c3(ps[i], ps[j], ps[k]);
                        }
                    }
                }
            }
        }
    }
    return c;
}


//-------------------------------------------------

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    srand(time(0));
    int n; cin>>n;
    vector<P> ps(n);
    rep(i,n){
        ld x,y; cin>>x>>y;
        ps[i] = P(x,y);
    }
    cout<<setprecision(15)<<fixed<<(double)smallest_enclosing_disc(ps).rad<<endl;
    return 0;
}


Measured memory_bytes: 256
fn main() {
    let n: isize = read();
    let a: isize = read();
    let b: isize = read();
    let a = a * n;
    let ans = if a < b { a } else { b };
    println!("{}", ans);
}

// 以下関数

use std::io::*;
use std::str::FromStr;
pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

pub const MOD: u64 = 10e9 as u64 + 7;

pub fn is_prime(n: i32) -> bool {
    if n < 2 {
        return false;
    } else if n == 2 {
        return true;
    }
    let mut i = 2;
    while i * i < n {
        if n % i == 0 {
            return false;
        } else {
            i += 1;
            continue;
        }
    }
    true
}

pub fn lcm(mut n: i32, mut m: i32) -> i32 {
    n = if n > m { m } else { n };
    m = if n > m { n } else { m };
    let mut i = n;
    while i % m != 0 {
        i += n;
    }
    i
}


Measured memory_bytes: 4352
h, w, k = map(int, input().split(" "))

mat = []
for i in range(h):
    mat.append(input())

ans = [[0] * w for i in range(h)]
num = 0
top = True

for i in range(h):
    found = False
    for j in range(w):
        if mat[i][j] == '#':
            num += 1
            ans[i][j] = num
            if not found:
                for x in range(j):
                    ans[i][x] = num
            found = True
        else:
            if found:
                ans[i][j] = num
    if (not found) and (not top):
        for x in range(w):
            ans[i][x] = ans[i - 1][x]
    if found and top:
        for y in range(i):
            for x in range(w):
                ans[y][x] = ans[i][x]
    if found:
        top = False

for i in range(h):
    for j in range(w):
        print(str(ans[i][j]) + " ", end="")
    print("")
        


Measured memory_bytes: 7552
#include <vector> 
#include <list> 
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << '=' << (x) << endl;
#define debug(x) cerr << #x << '=' << (x) << '('<<'L' << __LINE__ << ')' << ' ' << __FILE__ << endl;

const LL mod = 1e9 + 7;


int main() {
	
	int sx, sy, tx, ty;

	cin >> sx >> sy >> tx >> ty;

	//最短で行く
	REP(i, tx - sx) {
		cout << "R";
	}
	REP(i, ty - sy) {
		cout << "U";
	}
	REP(i, tx - sx) {
		cout << "L";
	}
	REP(i, ty - sy) {
		cout << "D";
	}
	cout << "D";
	sy--;
	REP(i, tx+1 - sx) {
		cout << "R";
	}
	REP(i, ty - sy) {
		cout << "U";
	}
	cout << "L";
	sy++;
	//蛙
	cout << "U";
	ty++;
	REP(i, tx + 1 - sx) {
		cout << "L";
	}
	REP(i, ty - sy) {
		cout << "D";
	}
	cout << "R";
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;

int main(){
 int a, b, c;
 cin >> a >> b >> c;
 
 double S, L, h;
 double Pi = 3.141592653589;
 S = 0.5 * a * b * sin( Pi * c / 180.0);
 L = a + b + sqrt(a * a + b * b -2.0 * a * b * cos(Pi * c / 180.0));
 h = 2.0 * S / a;
 printf("%f\n %f\n %f\n", S, L, h);
 
 return 0;
}


Measured memory_bytes: 3320
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  string tmp;
  map<string,int> ans;
  for(int i=0;i<N;i++){
    cin >> tmp;
    ans[tmp] ++;
  }
  
  cout << "AC x " << ans["AC"] << endl;
  cout << "WA x " << ans["WA"] << endl;
  cout << "TLE x " << ans["TLE"] << endl;
  cout << "RE x " << ans["RE"] << endl;
}

Measured memory_bytes: 3632