akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rep1(i, n) for(int i=1; i<n; i++)
#define all(v) v.begin(), v.end()
typedef int64_t lint;
using pint = pair<lint, lint>;
using tint = tuple<lint, lint, lint>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
constexpr lint LINF = LLONG_MAX/2;

int main() {
	lint N, M, S;
	cin >> N >> M >> S;

	// 路線情報　x -> y で A 銀貨を失い B 分かかる
	lint a=0, b=0, c=0, x, y, z, w;
	vector<vector<pint>> vv(N);
	vector<lint> A(M+N);
	vector<lint> B(M+N);
	rep(i, M) {
		cin >> x >> y >> A.at(i) >> B.at(i);
		x--, y--;
		A.at(i) *= -1;
		vv.at(x).push_back(make_pair(y, i));
		vv.at(y).push_back(make_pair(x, i));
	}
	// その駅で銀貨に交換する場合 A 銀貨を得るのに B 分かかる
	rep(i, N) {
		cin >> A.at(i+M) >> B.at(i+M);
		vv.at(i).push_back(make_pair(i, i+M));
	}
	// 銀貨最大値
	lint G = 50*(N-1);

	priority_queue<tint, vector<tint>, greater<tint>> PQ;
	vector<vector<lint>> v(N, vector<lint>(G+1));
	rep(i, N) fill(all(v.at(i)), LINF);
	v.at(0).at(min(G,S)) = 0;
	PQ.push(make_tuple(0, S, 0));
	while (!PQ.empty()) {
		tie(w, z, a) = PQ.top();
		PQ.pop();
		rep(i, vv.at(a).size()) {
			// 路線 c を使用 して a -> b 駅へ移動
			tie(b, c) = vv.at(a).at(i);
			// x 銀貨所持
			x = z + A.at(c);
			if (x < 0) continue;
			// y 分に到着
			y = w + B.at(c);
			if (chmin(v.at(b).at(min(x,G)), y)) PQ.push(make_tuple(y, x, b));
		}
	}
	rep1(i, N) {
		a = LINF;
		rep(j, G+1) {
			chmin(a, v.at(i).at(j));
		}
		cout << a << '\n';
	}
}


Measured memory_bytes: 7312
#include <bits/stdc++.h>
using namespace std;
main(){
  string S;
  int y = 700;
  cin >> S;
  if(S[0] == 'o') y += 100;
  if(S[1] == 'o') y += 100;
  if(S[2] == 'o') y += 100;
  cout << y << endl;
}

Measured memory_bytes: 3576
// ######      ###      #######    #######    ##     #     #####        ###     ##### //
// #     #    #   #          #        #       # #    #    #     #      #   #     ###  //
// #     #   #     #        #         #       #  #   #   #       #    #     #    ###  //
// ######   #########      #          #       #   #  #   #           #########    #   //
// #     #  #       #     #           #       #    # #   #    ####   #       #    #   //
// #     #  #       #    #            #       #     ##   #    #  #   #       #        //
// ######   #       #   #######    #######    #      #    #####  #   #       #    #   //

// #pragma GCC optimize(2)
// #pragma GCC optimize(3)
// #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
// #pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double lld;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> ppl;
#define ain(a,n) for(ll i=0;i<(n);++i)  cin>>(a)[i];
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define loop(i,n) for(ll i=0;i<(n);++i)
#define FOR(i,a,b) for(ll i=(a);i<=(b);++i)
#define FORD(i,a,b) for(ll i=(a);i>=(b);--i)
#define cases ll T=0;cin>>T;while(T--)
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define END "\n"
#define pb push_back
#define mp make_pair
#define go(c,itr) for(auto itr=(c).begin(); itr!=(c).end(); ++itr)
// #define back(c,itr) for(auto itr=(c).rbegin(); itr!=(c).rend(); ++itr)
#define PI 3.14159265359
#define inf 9e18
#define MOD 1000000007
#define MODU 998244353
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define MAXN 1000005
#define BLOCK 555
const string alpha = "abcdefghijklmnopqrstuvwxyz";
const ll N = 200005;
const long double epsilon = 1e-9;
ll binexp(ll a, ll b, ll m) {
    a %= m;
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}
ll modinvfermat(ll a, ll m)
{
    return binexp(a, m - 2, m);
}
void task(bool flag)
{
    if (flag)
        cout << "YES\n";
    else
        cout << "NO\n";
}
ll lcm(ll a, ll b)
{
    return ((1LL * a * b) / (__gcd(a, b)));
}

ll n, m, ans;
vvl adj;
vl vis;
void dfs(ll node, ll& cnt)
{
    vis[node] = 1;
    ++cnt;
    for (auto child : adj[node])
    {
        if (vis[child] == 0)
            dfs(child, cnt);
    }
}

signed main() {
// #ifndef ONLINE_JUDGE
//     freopen("input.txt", "r", stdin);
//     freopen("output.txt", "w", stdout);
// #endif
    fast
    cin >> n >> m;
    adj = vvl(n + 1);
    vis = vl(n + 1, 0);
    loop(i, m)
    {
        ll a, b;
        cin >> a >> b;
        adj[a].pb(b);
        adj[b].pb(a);
    }
    FOR(i, 1, n)
    {
        if (vis[i] == 0)
        {
            ll cnt = 0;
            dfs(i, cnt);
            ans = max(ans, cnt);
        }
    }
    cout << ans << END;




// #ifndef ONLINE_JUDGE
//     cout << "\nTime Elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " sec\n";
// #endif
    return 0;
}

Measured memory_bytes: 21912
import sys
from heapq import heappush, heappop

input = sys.stdin.readline

def main():
    N, M = map(int, input().split())
    A, B = [[] for i in range(M)], []
    
    for i in range(N):
        a, b = map(int, input().split())
        if a > M: continue
    
        A[a-1].append(-b)
        
    ans = 0
    
    for i in range(M):
        for a in A[i]: heappush(B, a)
        
        if not B: continue
    
        ans += heappop(B)
        
    print(-ans)
    
if __name__ == '__main__':
    main()


Measured memory_bytes: 17604
#include <iostream>
#include <sstream>
#include <vector>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iomanip>
#include <vector>
#include <cstdio>
#include <float.h>
#include <queue>
#include <set>
#include <map>
#include <fstream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <stack>
#include <functional>
 
using namespace std;
 
#define endl '\n'
#define MOD 1000000007
#define INF 1ll<<30
#define MAX 100010
#define eps 1e-11
#define bit_max 1ll<<32
#define _USE_MATH_DEFINES
 
long long int CountTriangles(vector <int> A){  
  
    int n=A.size(); 
  
    sort(A.begin(), A.end());  
  
    long long int count = 0; 
      
    for( int i = n-1; i >= 1; i--){ 
        long long int  l = 0, r = i-1; 
        while( l < r){ 
            if( A[l] + A[r] > A[i]){ 
  
                // If it is possible with a[l], a[r] 
                // and a[i] then it is also possible 
                // with a[l+1]..a[r-1],a[r] and a[i] 
                count += r - l ;  
  
                //checking for more possible solutions 
                r--;   
            } 
            else 
  
                // if not possible check for  
                // higher values of arr[l] 
                l++;   
        } 
    } 
   return count;
} 
 
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //freopen("./input.txt","r",stdin);
    //freopen("./output.txt","w",stdout);
    int n;
    cin>>n;
    vector<int> a;
    for(int i=0;i<n;i++)
    {
        int temp;
        cin>>temp;
        a.push_back(temp);

    }
    cout<<CountTriangles(a);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please


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

	
	int N;
	cin >> N;


	int kotae = N * 800 - (N / 15) * 200;
	co(kotae);
	Would you please return 0;
}

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

namespace Aizu {
    class OnlineJudge {
        static void Main() {
            var dict = Enumerable.Range(0, int.Parse(Console.ReadLine())).Select(p => {
                var input = Console.ReadLine().Split();
                return new { t = input[0], w = input[1], d = Convert.ToDateTime(input[2]) };
            }).ToList();
            for (int i = int.Parse(Console.ReadLine()) - 1; i >= 0; --i) {
                var input = Console.ReadLine().Split();
                var ds = Convert.ToDateTime(input[2] == "*" ? "1970/01/01" : input[2]);
                var db = Convert.ToDateTime(input[3] == "*" ? "2037/12/31" : input[3]);
                foreach (var item in dict.Where(p => (input[0] == "*" || p.t.Contains(input[0])) && (input[1] == "*" || p.w.Contains(input[1])) && (p.d >= ds) && (p.d <= db) )) {
                    Console.WriteLine(item.t);
                }
                if (i != 0) {
                    Console.WriteLine();
                }
            }
        }
    }
}

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

using System.Collections;

class Program
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        string S = Console.ReadLine();

        //X[i]は、i番目かそれより西側にいる、西を向いている人の合計人数とする。
        int[] X = new int[N + 1];
        for (int i = 1; i <= S.Length; i++)
        {
            X[i] = S[i - 1] == 'W' ? X[i - 1] + 1 : X[i - 1];
        }

        //Y[i]は、i番目かそれよりも東にいる、東を向いている人の合計人数とする。
        int[] Y = new int[N + 2];
        for (int i = S.Length; i >= 1; i--)
        {
            Y[i] = S[i - 1] == 'E' ? Y[i + 1] + 1 : Y[i + 1]; 
        }

        //全部の番目で試す
        int ans = int.MaxValue;
        for(int i = 1; i <= S.Length; i++)
        {
            ans = Math.Min(ans, X[i - 1] + Y[i + 1]);
        }

        Console.WriteLine(ans);
        
    }
}


static class MathUtil
{
    public static T Max<T>(params T[] datas)
    {
        return datas.Max();
    }

    public static T Min<T>(params T[] datas)
    {
        return datas.Min();
    }

    public static IEnumerable<IEnumerable<int>> GetPermutation(int n)
    {
        if (n == 0)
        {
            yield return Single(0);
            yield break;
        }

        for (int i = 0; i <= n; i++)
        {
            foreach (var x in GetPermutation(n - 1))
            {
                yield return Single(i).Concat(x.Select(itm => itm < i ? itm : itm + 1));
            }
        }
    }

    private static IEnumerable<int> Single(int x)
    {
        yield return x;
    }

    public static IEnumerable<int> EnumeratePrimeNumbers()
    {
        List<int> primes = new List<int>() { 2 };
        yield return 2;

        for (int i = 3; i < int.MaxValue; i++)
        {
            bool isPrime = true;
            int Sqrt = (int)Math.Sqrt(i) + 1;

            foreach (var prime in primes)
            {
                if (prime > Sqrt)
                {
                    break;
                }
                if (i % prime == 0)
                {
                    isPrime = false;
                    break;
                }
            }

            if (isPrime)
            {
                primes.Add(i);
                yield return i;
            }
        }
    }
}


Measured memory_bytes: 15968
import java.io.*;
import java.util.*;
import java.math.BigInteger;
public class Main {
	static PrintWriter out=new PrintWriter(System.out);
	
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int arr[]=sc.nextArr(n);
		long dp[]=new long[n];
		dp[1]=Math.abs(arr[0]-arr[1]);
		
		for(int i=2;i<n;i++) {
			long a=(long)Math.abs(arr[i-2]-arr[i])+dp[i-2];
			long b=(long)Math.abs(arr[i-1]-arr[i])+dp[i-1];
			if(a<b) {
				dp[i]=a;
			}else dp[i]=b;
		}
		out.println(dp[n-1]);
		out.close();
  }
	
	static class Scanner {
		StringTokenizer st;
		BufferedReader br;
		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}
		public Scanner(String file) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(file));
		}
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
		public boolean ready() throws IOException {
			return br.ready();
		}
		public int[] nextArr(int n) throws IOException{
			int arr[]=new int[n];
			for(int i=0;i<n;i++)arr[i]=nextInt();
			return arr;
		}
		public BigInteger BigInteger(String s) throws IOException{
			BigInteger a=new BigInteger(s);
			return a;
		}
	}
}

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

int main(){
  int n,i,a,kotae=0;
  cin>>n;
  for(i=0;i<n;i++){
    cin>>a;
    if(a%2==0){
      if(a%3==0){
      }else if(a%5==0){
      }else{
        kotae=1;
      }
    }
  }
  if(kotae){
    cout<<"DENIED";
  }else{
    cout<<"APPROVED";
  }
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        String op = sc.next();
        int b = sc.nextInt();
        if(op.equals("+")) System.out.println(a + b);
        else System.out.println(a - b);
    }
}

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

int main(void)
{
	std::string s, p;
	std::cin >> s >> p;
	s += s;
	int count;
	bool contains = false;
	for (int i = 0; i + p.size() <= s.size(); i++)
	{
		count = 0;
		while (count < p.size() && p[count] == s[i + count])
		{
			count++;
		}
		if (count == p.size())
		{
			contains = true;
			break;
		}
	}
	std::cout << (contains ? "Yes" : "No") << '\n';
	return 0;
}

Measured memory_bytes: 3184
// 6/23 解き直し
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int, int>;

string N;
vector<int> n;
int dp[110][2][5];

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

    // int size = N.size();
    for (auto a : N) {
        n.push_back(a-'0');
    }
    int l = n.size();

    dp[0][0][0] = 1;  // 初期条件

    for (int i = 0; i < l; i++) {
        for (int smaller = 0; smaller < 2; smaller++) {
            for (int k = 0; k <= K; k++) {
                for (int x = 0; x <= (smaller ? 9 : n[i]); x++) {
                    if (x==0) dp[i + 1][smaller || x < n[i]][k] += dp[i][smaller][k];
                    else dp[i + 1][smaller || x < n[i]][k + 1] += dp[i][smaller][k];   
                }
            }
        }
    }

    cout << dp[l][0][K] + dp[l][1][K] << endl;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define printYes() cout << "Yes" << endl;
#define printNo() cout << "No" << endl;
#define printVector(v) rep(i, v.size()) cout << v[i] << endl;
void bfs(vector<vector<int>> &maps)
{
  int dirx[] = {1, -1, 0, 0};
  int diry[] = {0, 0, 1, -1};
  int INF = INT32_MAX;
  int H, W;
  H = maps.size();
  W = maps[0].size();

  queue<pair<int, int>> pos_queue;
  rep(i, H) rep(j, W)
  {
    if (maps[i][j] == 0)
    {
      pos_queue.push(make_pair(i, j));
    }
  }

  while (pos_queue.size())
  {
    pair<int, int> pos = pos_queue.front();
    pos_queue.pop();
    int pos_x = pos.first;
    int pos_y = pos.second;

    rep(i, 4) rep(j, 4)
    {
      int next_x = pos_x + dirx[i];
      int next_y = pos_y + diry[i];
      if (0 <= next_x && next_x < H && 0 <= next_y && next_y < W && maps[next_x][next_y] == INF)
      {
        int next_cost = maps[pos_x][pos_y] + 1;
        maps[next_x][next_y] = next_cost;
        pos_queue.push(make_pair(next_x, next_y));
      }
    }
  }
}

int main()
{
  int H, W;
  cin >> H >> W;
  int INF = INT32_MAX;
  vector<vector<int>> maps(H, vector<int>(W, INF));
  rep(i, H)
  {
    string A;
    cin >> A;
    rep(j, W)
    {
      if (A[j] == '#')
        maps[i][j] = 0;
    }
  }
  bfs(maps);
  int ans = 0;
  rep(i, H)
  {
    rep(j, W)
    {
      ans = max(ans, maps[i][j]);
    }
  }

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

Measured memory_bytes: 12432
#![allow(unused)]

//入力マクロここから
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
//入力マクロここまで

//input
//use std::io::Read;

//collections
//use std::collections::BTreeMap;
//use std::collections::BTreeSet;
//use std::collections::HashMap;
//use std::collections::HashSet;
//use std::collections::VecDeque;
//use std::collections::BinaryHeap;

//use std::cmp::*;

fn main() {
    input! {
        x: u64,
        y: u64,
    }
    let mut cnt = 0;
    let mut i = x;
    while i <= y {
        i *= 2;
        cnt += 1;
    }

    println!("{}", cnt);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
typedef long double ld;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(x) x.begin(),x.end()
#define DEBUG


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

	rep(i,s.size())
	{
		int diff = s[i] - 'A';
		if(diff + n >= 26) s[i] += (n - 26);
		else s[i] += n;
	}
	cout << s << endl;
	return 0;
}

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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string last = Console.ReadLine();
            HashSet<string> set = new HashSet<string>() { last };

            for (int i = 0; i < n - 1; i++)
            {
                string text = Console.ReadLine();
                if (!set.Contains(text) && last.Last() == text.First())
                {
                    set.Add(text);
                    last = text;
                }
                else
                {
                    Console.WriteLine("No");
                    return;
                }
            }

            Console.WriteLine("Yes");
        }
    }
}

Measured memory_bytes: 13280
import java.util.Scanner;

public class Main {

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

		Scanner sc = new Scanner(System.in);

		long x = sc.nextLong();
		long k = sc.nextLong();
		long d = sc.nextLong();

		long ans;
		x = Math.abs(x);

		if (x / d >= k) {
			ans = x - k * d;
		} else {
			long tmp = x % d;
			long remain = k - x / d;

			if (remain % 2 == 0) {
				Thread.sleep(1000);
				ans = tmp;
			} else {
				Thread.sleep(500);
				ans = Math.abs(tmp - d);
			}

		}

		System.out.println(ans);

		sc.close();
	}

}

Measured memory_bytes: 35788
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
const int INFTY =2147483647;
int main(){
    int x,n,a,ans;
    int A[202]={};
    cin>>x>>n;
    REP(i,n){
        cin>>a;
        A[101-(x-a)]++;
    }
    REP(i,101){
        if(A[101-i]==0){
            ans=x-i;
            break;
        }
        else if(A[101+i]==0){
            ans=x+i;
            break;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 3596
#include "bits/stdc++.h"
using namespace std;

int main(){
  long long int n,x;
  cin>>n>>x;
  long long int ans=n;
  long long int a=min(x,n-x);
  long long int b=max(x,n-x);
  while(a){
    long long int c=b/a;
    ans+=2*a*c;
    b%=a;
    if(a>b){
      long long int tmp=a;
      a=b;
      b=tmp;
    }
  }
  ans-=b;
  cout<<ans<<endl;
}


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

template <typename A, typename B>
string to_string(pair<A, B> p);
 
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
 
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
 
string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(const char& ch) {
	string s = "";
	s += ch;
	return "'" + s + "', ";
}
 
string to_string(const char* s) {
  return to_string((string) s);
}
 
string to_string(bool b) {
  return (b ? "true" : "false");
}
 
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
 
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
 
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
 
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
 
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}
 
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
 
void debug_out() { cout << endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << " " << to_string(H);
  debug_out(T...);
}
 
#ifdef LOCAL_DEFINE
#define debug(...) cout << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif
   
#define int long long
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
typedef pair<int, int> pii;
const int mod = (int) 1000000007; // 998244353;
const int inf = (int) 4e18;



int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(9);
	#ifdef LOCAL_DEFINE
		freopen("in.txt", "rt", stdin);
	#endif
	
	
	int n;
	cin >> n;
	string s = "";
	
	while(n)
	{
		-- n;
		int alph = n % 26;
		s += (char) (alph + 'a');
		n /= 26;
	}
	reverse(all(s));
	cout << s << '\n';
	
	return 0;
}






Measured memory_bytes: 3648
function main()
  
  (N,A,B) = map(x -> parse(Int,x), split(readline()))
  
  ans = div(N,A+B)*A

  if N % (A+B) > A
    ans += A
  else
    ans += N % (A+B)
  end
  
  println(ans)
  
end

main()

Measured memory_bytes: 165208
package main

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

func main() {
	sc := NewScanner(os.Stdin)
	N := sc.NextInt()
	Q := sc.NextInt()
	S := sc.Next()
	num := make([]int, N+1)
	for i := 0; i < N-1; i++ {
		if S[i:i+2] == "AC" {
			num[i+2] = num[i+1] + 1
		} else {
			num[i+2] = num[i+1]
		}
	}
	for i := 0; i < Q; i++ {
		l := sc.NextInt()
		r := sc.NextInt()
		ans := num[r] - num[l-1]
		if l-2 >= 0 && S[l-2:l] == "AC" {
			ans--
		}
		fmt.Println(ans)
	}
}

func lcm(x, y int) int {
	x, y = max(x, y), min(x, y)
	if y == 0 {
		return x
	}
	return lcm(y, x%y)
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

// scanner
type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner(r io.Reader) *Scanner {
	rdr := bufio.NewReaderSize(r, 1024)
	return &Scanner{r: rdr}
}

func (s *Scanner) ReadLine() {
	s.buf = make([]byte, 0)
	for {
		line, isp, err := s.r.ReadLine()
		if err != nil {
			os.Exit(1)
		}
		s.buf = append(s.buf, line...)
		if !isp {
			break
		}
	}
}

func (s *Scanner) NextInt() int {
	i, err := strconv.Atoi(s.Next())
	if err != nil {
		os.Exit(1)
	}
	return i
}

func (s *Scanner) NextFloat64() float64 {
	i, err := strconv.ParseFloat(s.Next(), 64)
	if err != nil {
		os.Exit(1)
	}
	return i
}

func (s *Scanner) Next() string {
	s.Pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	next := string(s.buf[start:s.p])
	s.p++
	return next
}

func (s *Scanner) Pre() {
	if s.p >= len(s.buf) {
		s.ReadLine()
		s.p = 0
	}
}


Measured memory_bytes: 6016
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define all(x) (x).begin(), (x).end()
#define endl '\n'
#define fsp(x) cout << fixed << setprecision(x)
const ll inf = LLONG_MAX;
const long double pi = M_PI;
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

int main() {
  string s;
  cin >> s;
  ll ans = 0;
  for (ll i = 0; i < s.size(); i++) {
    if (s[i] == 'o') ans++;
  }
  if (ans + 15 - s.size() >= 8) YES();
  else NO();
}

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

#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
int a,b,c;
signed main(){
    cin>>a>>b>>c;
    if(b-a==c-b){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mod 1000000007
#define ff first
#define ss second
using namespace std;
ll power(ll x,ll y)
{
    ll res=1;
    while(y>0)
    {
        if(y%2==1)
            res=(res*x)%mod;
        x=(x*x)%mod;
        y=y/2;
    }
    return res;
}
int main()
{
    ll arr[2001];
    arr[0]=1;
ll n,k,i,r;
cin>>n>>k;
for(i=1;i<=2000;i++)
    arr[i]=(i*arr[i-1])%mod;
for(i=1;i<=k;i++)
{
    if(n-k<i-1)
    {
        cout<<0<<endl;
    }
    else
    {
        r=(arr[k-1]*power(arr[k-i],mod-2))%mod;
        r=(r*power(arr[i-1],mod-2))%mod;
        r=(r*arr[n-k+1])%mod;
        r=(r*power(arr[n-k-i+1],mod-2))%mod;
        r=(r*power(arr[i],mod-2))%mod;
        cout<<r<<endl;
    }
}
}


Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
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")
}

fn main() {
    let a = read::<i64>();
    let b = read::<i64>();
    let c = read::<i64>();
    let d = read::<i64>();
    if (a - c).abs() <= d || ((a - b).abs() <= d && (b - c).abs() <= d) {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 4352
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

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

		int n = Integer.parseInt(sc.next());
		int[] a = new int[n];
		int[] cnt = new int[100010];

		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sc.next());
			cnt[a[i] + 1]++;
			cnt[a[i]]++;
			cnt[a[i] + 2]++;
		}

		Arrays.sort(cnt);

		System.out.println(cnt[100009]);

	}
}

Measured memory_bytes: 47580
N = int(input())
A = [int(input()) for _ in range(N)]
flag = 0
cnt = A[N-1]
for i in range(N-2,-1,-1):
    if A[i]==A[i+1]-1:continue
    elif A[i]>=A[i+1]:
        if A[i]>0:
            cnt += A[i]
    else:
        flag = 1
        break
if A[0]>0 or flag==1:
    print(-1)
else:
    print(cnt)

Measured memory_bytes: 17000
#include<iostream>
#include<algorithm>
#include<string>

using namespace std;
#define rep(i,a) for(int i = 0 ; i < a ; i ++)

bool flag[1<<20];

int main(void){
  int n , a , b;
  while(cin>> n >> a >> b,a+b+n){
    int cnt = 0;
    fill(flag,flag+(1<<20),false);
    flag[0] = true;
    rep(i,n+1){
      if(!flag[i]) continue;
      if(1 <= i && i <= n) cnt ++;
      flag[i+a] = flag[i+b] = true;
    }
    cout<<n - cnt << endl;
  }
}

Measured memory_bytes: 2184
#include<stdio.h>
int main(){
  int a[4][14]={};
  int n,i,j;
  char ch;
  int b;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf(" %c %d",&ch,&b);
    //printf("%c\n",ch);
    //printf("%d\n",b);
    if(ch=='S') a[0][b]=1;
    if(ch=='H') a[1][b]=1;
    if(ch=='C') a[2][b]=1;
    if(ch=='D') a[3][b]=1;
  }
  for(i=0;i<4;i++){
    for(j=1;j<14;j++){
      if(a[i][j]==0) {
        if(i==0) {
          printf("S ");
          printf("%d\n",j);
        }
        if(i==1) {
          printf("H ");
          printf("%d\n",j);
        }
        if(i==2) {
          printf("C ");
          printf("%d\n",j);
        }
        if(i==3) {
          printf("D ");
          printf("%d\n",j);
        }


    }
  }

}

return 0;
}



Measured memory_bytes: 2032
#include "bits/stdc++.h"
using namespace std;
#define mod 1000000007
#define ll long long
#define cases ll t;cin>>t;while(t--)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL)


int main(){
    fast;
    ll i,j,n,m,r,u,v,k,x,y;
    cin>>n>>m;
    vector<ll> h(n+1);
    for(i=1;i<=n;i++){
        cin>>h[i];
    }
    vector<vector<ll> > g(n+1);
    for(i=0;i<m;i++){
        cin>>u>>v;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    ll ans=0;
    for(i=1;i<=n;i++){
        bool chk=true;
        for(j=0;j<(ll)g[i].size();j++){
            v=g[i][j];
            if(h[i]<=h[v]){
                chk=false;
                break;
            }
        }
        if(chk) ans++;
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 9800
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

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 EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

LL gcd(LL a, LL b) {
	return b != 0 ? gcd(b, a % b) : a;
}

int main() {
	int n; cin >> n;
	vector<LL> a(n);

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

	vector<LL> l(n+1);
	vector<LL> r(n+1);

	for (int i = 0; i < n; i++) {
		l[i + 1] = gcd(l[i], a[i]);
	}

	for (int i = n-2; i >=0; i--) {
		r[i] = gcd(r[i + 1], a[i+1]);
	}

	LL ans = 1;
	for (int i = 0; i < n; i++) {
		ans = max(ans, gcd(l[i], r[i]));
	}

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


Measured memory_bytes: 2560
import java.util.*;

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

Measured memory_bytes: 22996
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0184

"""
import sys
from sys import stdin
from collections import defaultdict
input = stdin.readline


def main(args):
    while True:
        n = int(input())
        if n == 0:
            break
        visitors = defaultdict(int)

        for _ in range(n):
            age = int(input())
            if age < 10:
                visitors['under10'] += 1
            elif age < 20:
                visitors['10s'] += 1
            elif age < 30:
                visitors['20s'] += 1
            elif age < 40:
                visitors['30s'] += 1
            elif age < 50:
                visitors['40s'] += 1
            elif age < 60:
                visitors['50s'] += 1
            else:
                visitors['60s+'] += 1

        print(visitors['under10'])
        print(visitors['10s'])
        print(visitors['20s'])
        print(visitors['30s'])
        print(visitors['40s'])
        print(visitors['50s'])
        print(visitors['60s+'])



def main2(args):
    while True:
        n = int(input())
        if n == 0:
            break
        age = [0] * (12+1)

        for _ in range(n):
            n = int(input())
            age[n//10] += 1

        print(age[0])
        print(age[1])
        print(age[2])
        print(age[3])
        print(age[4])
        print(age[5])
        print(sum(age[6:]))


if __name__ == '__main__':
    main2(sys.argv[1:])

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

using namespace std;

int main(void)
{
    int m,n;
    string s;
    cin >> m >> n >> s;
    int l = m+n+1;
    for(int i = 0;i<l;i++)
    {
        if(i == m && s[i] != '-'){
            cout << "No" << endl;
            return 0;
        }
        if(!(s[i] >= '0' && s[i]<= '9')&& i!=m)
        {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}


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

typedef long long ll;

int main() {
    int N, K;
    cin >> N >> K;
    vector<int> A(N + 1, 0);
    rep(i, N) cin >> A[i + 1];
    if (K > 1000) {
        rep(i, N) {
            cout << N;
            if (i == N - 1) cout << "\n";
            else cout << " ";
        }
        return 0;
    }
    rep(i, K) {
        vector<int> D(N + 1, 0);
        rep(j, N) {
            D[max(0, j - A[j + 1])]++;
            D[min(N, j + A[j + 1] + 1)]--;
        }
        /*
        rep(j, N + 1) cout << D[j] << " ";
        cout << "\n";
        */
        rep(j, N) {
            A[j + 1] = A[j] + D[j];
        }
    }
    rep(i, N) {
        cout << A[i + 1];
        if (i == N - 1) cout << "\n";
        else cout << " ";
    }
}

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

int N, M;
string s;

void dfs(vector<vector<int>> &L, int i) {
  if (s[i - 1] == '1') return;
  s[i - 1] = '1';

  for (int j = 0; j < L[i].size(); j++) {
    dfs(L, L[i][j]);
  }
}

int main() {
  cin >> N >> M;
  vector<int> a(M), b(M);
  for (int i = 0; i < M; i++) {
    cin >> a[i] >> b[i];
  }
  string st = "";
  string g  = "";
  for (int i = 0; i < N; i++) {
    st += "0";
    g += "1";
  }

  int cnt = 0;
  for (int i = 0; i < M; i++) {
    vector<vector<int>> L(N + 1);
    s = st;
    for (int j = 0; j < M; j++) {
      if (i == j) continue;
      L[a[j]].push_back(b[j]);
      L[b[j]].push_back(a[j]);
    }
    dfs(L, 1);
    if (s != g) { cnt++; }
  }
  cout << cnt << endl;
}

Measured memory_bytes: 256
S = input().split(" ")
S = [int(i) for i in S]
a = 0
for i in range(1,S[0] + 1):
    a += (max(i-S[1],0) * int(S[0]/i)) + max(0,S[0]%i-(S[1]-1))
if S[1] == 0:
    a -= S[0]    
print(a)

Measured memory_bytes: 3060
fun main(args: Array<String>) {
    val additionForT = listOf("dream", "dreamer", "erase", "eraser")

    val s = readLine()!!

    val flag = checkCanSame(s, additionForT)

    if (flag) {
        println("YES")
    } else {
        println("NO")
    }
}

fun checkCanSame(sb: String, additionForT: List<String>): Boolean {
    val s = StringBuilder(sb)
    while (s.isNotEmpty()) {
        var isDeleted = false
        for (add in additionForT) {
            if (s.endsWith(add)) {
                s.delete(s.length - add.length, s.length)
                isDeleted = true
            }
        }
        if (!isDeleted) break
    }
    return s.isEmpty()
}

Measured memory_bytes: 36616
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <utility>
#include <map>
#include <list>
#include <climits>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>

// #define cerr if(false)cerr
#define watch(x) cerr << "> " << #x << ": " << x << "\n";

using namespace std;

template <typename T>
std::ostream &operator <<(std::ostream &out, vector<T> &v) {
	for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
		out << v[i] << " ";
	out << "\n";
    return out;
}
template <typename T, typename N>
std::ostream &operator <<(std::ostream &out, vector<pair<T, N> > &v) {
	for (size_t i = 0; i < v.size(); ++i)
		out << "(" << v[i].first << ", " << v[i].second << ") ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<vector<T> > &v) {
	for (size_t i = 0; i < v.size(); ++i) {
		for (size_t j = 0; j < v[i].size(); ++j) {
			out << v[i][j] << " ";
		}
		out << "\n";
	}
   	return out;
}

int main() {

	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	string s;
	cin >> s;

	int sz = s.size();

	stack<char> remain;
	for (int i = 0; i < sz; ++i) {
		if (!remain.empty() && remain.top() == 'S' && s[i] == 'T') {
			remain.pop();
		} else {
			remain.push(s[i]);
		}
	}

	cout << remain.size() << "\n";

	return 0;

}

Measured memory_bytes: 3724
#include <iostream>
#include <cassert>
#include <climits>
#include <bitset>
#include <stack>
#include <queue>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
#include <tuple>
#include <time.h>
#include <random>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P;

long long int INF = 3e18;
double Pi = 3.1415926535897932384626;

vector<ll> G[500005];
vector<P> tree[500010];
priority_queue <ll> pql;
priority_queue <P> pqp;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop

int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
//ll bit[500005];
//↓,→,↑,←


#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<(x)<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<(x);
#define pd(x) cerr<<"//"<<(x)<<endl;
#define re(i,n) for(i=0;i<n;i++);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define deba(x) cout<< #x << " = " << x <<endl


ll mod = 998244353;
ll rui(ll number1,ll number2){
    if(number2 == 0){
        return 1;
    }else{
        ll number3 = rui(number1,number2 / 2);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
ll gcd(ll number1,ll number2){
    if(number1 > number2){
        swap(number1,number2);
    }
    if(number1 == 0 || number1 == number2){
        return number2;
    }else{
        return gcd(number2 % number1,number1);
    }
}
void YES(bool condition){
    if(condition){
        p("YES");
    }else{
        p("NO");
    }
    return;
}
void Yes(bool condition){
    if(condition){
        p("Yes");
    }else{
        p("No");
    }
    return;
}

ll n,m,num,sum,ans,a,b,c,d,e,g,h,i,j,k,q,l,r;
ll x[500005],y[500005],z[500005],w[500005];
//bool check[5005];
char s[500005],t[500005];
bool flag,dame;

ll  fact[400005];
ll rfact[400005];
ll dp[10005][10005];
bool isprime[500005];
void c3_init(){
    fact[0] = rfact[0] = 1;
    for(ll i=1; i<400000; i++){
        fact[i] = (fact[i-1]*i) % mod;
        rfact[i] = rui(fact[i],mod - 2);
    }
}
ll c3(ll n,ll r){
    return (((fact[n] * rfact[r]) % mod) * rfact[n-r]) % mod;
}

int main(){
	cin >> a >> b >> c;
	if(a <= c && c <= b){
		Yes(1);
	}else if(b <= c && c <= a){
		Yes(1);
	}else{
		Yes(0);
	}

	
			

	return 0;
}

Measured memory_bytes: 24192
#include<bits/stdc++.h>
using namespace std;
#define int long long 

int A[201010];

signed main(void){ 
  
  double L; cin >> L;
  L /= 3;
  double ans = pow(L,3.0);
  
  printf("%.20f\n",ans);
  
  return 0;
}
  
  

Measured memory_bytes: 384
from sys import exit
import math
N = int(input())
dic = {}
a = [int(n) for n in input().split()]
for e in a:
    if e in dic:
        dic[e]+=1
    else:
        dic[e] = 1
ans = 0
for k in dic.keys():
    if k < dic[k]:
        ans+=dic[k]-k
    elif k > dic[k]:
        ans+=dic[k]
    else:
        continue
print(ans)


Measured memory_bytes: 17908
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::{Write, BufWriter};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

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

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

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

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

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

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

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

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }
    input! {
        a: i32, b: i32, c: i32,
    }
    puts!("{}\n", if a == b && b == c { "Yes" } else { "No" });
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


Measured memory_bytes: 8572
import sys
import numpy as np

n, m, c = map(int, sys.stdin.readline().split())
b = np.array(sys.stdin.readline().split(), dtype=np.int64)
a = np.array(sys.stdin.read().split(), dtype=np.int64).reshape(n, m)

def main():
    res = np.sum(a * b, axis=1) + c
    return np.count_nonzero(res > 0)

if __name__ == '__main__':
    ans = main()
    print(ans)

Measured memory_bytes: 12484
N=int(input())
list=[]
for i in range(N):
    ab=input().split(" ")
    list.append([int(ab[0]),int(ab[1])])
count=0
for i in range(N):
    k=N-i-1
    list[k][0]+=count
    t=list[k][1]-list[k][0]%list[k][1]
    if t!=list[k][1]:
        count+=t
print(count)


Measured memory_bytes: 23536
using System;
using System.Collections.Generic;
using System.Linq;
using System.Diagnostics;

class Program
{
    static void Main(string[] args)
    {
        var sc = new Scanner();
        int n = sc.nextInt();
        int k = sc.nextInt();
        int ans = 0;
        for (int i = 0; i < n; i++)
        {
            int h = sc.nextInt();
            if (k <= h) ans++;
        }

        Console.WriteLine(ans);
    }
}

// chokudai's Scanner
class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }

    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }

    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}


Measured memory_bytes: 15584
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using Pair = pair<int64_t, int64_t>;
constexpr int64_t kInf = INT64_MAX / 2L;

// std::cout << std::setprecision(20) << 1.1 << endl;

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

  int64_t N;
  cin >> N;
  int64_t result = (((-N) % 1000) + 1000) % 1000;
  cout << result << endl;
  return 0;
}


Measured memory_bytes: 3648