akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <map>
using namespace std;
long long f(int x){
    if(x <= 1) return 1;
    return (1<<(x-1));
}
int main(void){
    long long h, w, n;
    cin >> h >> w >> n;
    map<long long, int> p;
    for(int i=0;i<n;i++){
        int a, b;
        cin >> a >> b;
        for(int j=0;j<9;j++){
            int x = a+j/3-1;
            int y = b+j%3-1;
            if(x >= 2 && x <= h-1 && y >= 2 && y <= w-1) p[x*w+y]++;
        }
    }
    long long ans[10];
    for(int i=0;i<10;i++) ans[i] = 0;
    for(auto z : p) ans[z.second]++;
    ans[0] = (h-2)*(w-2);
    for(int i=1;i<10;i++) ans[0] -= ans[i];
    for(int i=0;i<10;i++){
        cout << ans[i] << endl;
    }
}


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

#define M 2005
int n;
char a[M][M];
int f[M][M],l[M][M],r[M][M];

int main () {
	//freopen("a.in","r",stdin);
	scanf("%d",&n);
	for1(1,n,i) scanf("%s",a[i]+1);
	
	ll ans=0;
	FOR2(n,1,i) FOR2(n,1,j) 
		if(isdigit(a[i][j])) {
			bool t[2]={isdigit(a[i+1][j]),isdigit(a[i][j+1])};
			if(!t[0]&&!t[1]) {
				l[j][i]=r[j][i]=j;
				for1(i+1,n,k) l[j][k]=n+1,r[j][k]=0;
			}
			else if(!t[0]) {
				f[i][j]=f[i][j+1];
				l[j][i]=j,r[j][i]=r[j+1][i];
				for1(i+1,n,k) l[j][k]=l[j+1][k],r[j][k]=r[j+1][k];
			}
			else if(!t[1]) {
				f[i][j]=f[i+1][j];
				l[j][i]=r[j][i]=j;
			}
			else {
				int las=0;
				int tot=f[i+1][j]+f[i][j+1];
				l[j][i]=j,r[j][i]=r[j+1][i];
				
int flag = 1;
				for1(i+1,n,k) {
					if(l[j+1][k]<=r[j][k]&&flag) tot-=f[k][l[j+1][k]];
flag = l[j+1][k]>r[j][k];
					l[j][k]=min(l[j][k],l[j+1][k]);
					r[j][k]=max(r[j][k],r[j+1][k]); 
				}
				f[i][j]=tot;
			}
			ans+=f[i][j]*(a[i][j]-'0');
			f[i][j]+=a[i][j]-'0';
		}
		else l[j][i]=n+1,r[j][i]=0;
	cout<<ans<<endl;
}


Measured memory_bytes: 18176
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <array>
#include <queue>
#include <stack>
#include <algorithm>
#include <tuple>
#include <numeric>
#include <type_traits>

template<typename W, typename V>
struct dijkstra_result {
	std::vector<W> distance; // 距離
	std::vector<V> prev; // 「前」の頂点
};

/**
 * ダイクストラ法で、ある頂点から到達可能な頂点までの距離と最短経路を求める
 * 
 * @tparam G グラフを表す型。
 *           グラフ g で頂点 u から v への重み w の辺があることを g[u][v] = w で表す。無向グラフなら g[u][v] = g[v][u] にしておく
 *           G は map<V, map<V, W>> や vector<vector<pair<V, W>>> などが可能
 * @tparam V 頂点番号の型。普通は int にすると思う
 * @tparam W 重みの型。 G から求まるので指定しなくてよい
 */
template<typename G, typename V, typename W = typename std::remove_reference<decltype(std::declval<G>()[0][0])>::type>
dijkstra_result<W, V> dijkstra(/*const*/ G& graph, V start, V num)
{
	using PQT = std::pair<W, V>;

	std::vector<W> distance;
	std::vector<V> prev;
	std::deque<bool> done; // 既に確定している頂点かどうか（覚えておかなくても計算できるが無駄がある）
	std::priority_queue<PQT, std::vector<PQT>, std::greater<PQT>> q;

	distance.resize(num);
	prev.resize(num);
	done.resize(num);

	for (V i = 0; i < num; ++i) {
		distance[i] = std::numeric_limits<W>::max();
	}
	distance[start] = 0;
	q.push({0, start});

	while (!q.empty()) {
		const auto& du = q.top();
		const auto dist = du.first;
		const auto u = du.second;
		q.pop();
        if (done[u]) {
          continue;
        }
		done[u] = true;
		const auto& edges = graph[u];
		for (const auto& vw : edges) {
			const auto v = vw.first;
			const auto w = vw.second;
			if (!done[v]) {
				long updated = dist + w;
				if (distance[v] > updated) {
					distance[v] = updated;
					prev[v] = u;
					q.push({updated, v});
				}
			}
		}
	}

	return {distance, prev};
}

int main()
{
	long N;
	std::unordered_map<long, std::unordered_map<long, long> > E; // src -> {dst -> weight}

	std::cin >> N;
	for (int i = 0; i < N-1; ++i) {
		long u, v;
		long w;
		std::cin >> u >> v >> w;
		--u;
		--v;
		E[u][v] = w;
		E[v][u] = w;
	}

	auto dij_res = dijkstra(E, 0L, N);
	auto& D = dij_res.distance;

	for (long i = 0; i < N; ++i) {
		std::cout << (D[i] % 2) << "\n";
	}
}


Measured memory_bytes: 22820
class Integer
  def divisor_list
    require 'prime'

    return [] if self <= 0
    return [1] if self == 1

    prime_division.map.with_index { |(base, k), i|
      s = i.zero? ? 0 : 1
      (s..k).map { |n| base ** n }
    }.inject { |res, e| res + res.flat_map { |t| e.map { |v| t * v } } }.sort
  end
end

N = gets.to_i
V = 2 * N

r = V.divisor_list.find { |n| m = V / n; m - n == 1 }

if r.nil?
  puts 'No'
  exit
end

S = []
v = 0
counter = Hash.new(0)

m = V / r
stock = []

m.times do
  s = []
  remain = r

  r.times do |i|
    break if stock[i].nil?

    remain -= 1
    s << stock[i].pop
  end

  remain.times do
    while counter[v] >= 2
      v = (v + 1) % N
    end

    s << v + 1
    counter[v] += 1
    v = (v + 1) % N
  end

  S << s
  stock << s.dup
end

puts 'Yes'
puts S.size
S.each do |s|
  puts [s.size, s.join(' ')].join(' ')
end


Measured memory_bytes: 12412
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define double long double
#define low lower_bound
#define upp upper_bound
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define Rep(i,n) for (int i = (int)(n); i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define rever(vec) reverse(all(vec));
#define cend printf("\n");
#define prique(T) priority_queue<T, vector<T>, greater<T>>
#define prique2(T) priority_queue<T>

struct edge { int to, cost; };
using P = pair<int, int>;
using PP = pair<P, int>;
using D = pair<double, double>;
//const int mod = 998244353;
const int mod = (int)1e9 + 7, inf = (int)1e16;
const string sp = " ";
template<class T> inline bool chmax(T& a, T b) {
	if (a < b) {
		a = max(a, b);
		return true;
	}
	return false;
}
template<class T> inline bool chmin(T& a, T b) {
	if (a > b) {
		a = min(a, b);
		return true;
	}
	return false;
}

int modpow(int x, int n) {
	int ans = 1;
	while (n > 0) {
		if (n & 1) {
			ans *= x;
			if (mod <= ans) ans %= mod;
		}
		x *= x;
		if (mod <= x) x %= mod;
		n >>= 1;
	}
	return ans;
}

int fact[1000000];
void f_init(int n) {
	if (1000000 <= n) return;
	fact[0] = fact[1] = 1;
	for (int i = 2; i <= n; ++i) {
		fact[i] *= fact[i - 1];
		if (mod <= fact[i]) fact[i] %= mod;
	}
	return;
}

int comb(int n, int r) {
	if (n < r) return 0;
	int ans = fact[n] * modpow(fact[n - r], mod - 2) % mod * modpow(fact[r], mod - 2);
	if (ans < 0) return ans + mod;
	return ans;
}

int perm(int n, int r) {
	if (n < r) return 0;
	if (n - r < r) r = n - r;
	int ans= fact[n] * modpow(fact[n - r], mod - 2) % mod;
	if (ans < 0) return ans + mod;
	return ans;
}

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

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

bool pri(int p) {
	for (int i = 2; i * i <= p; ++i) if (p % i == 0) return false;
	return p > 1;
}

map<int, int> factring(int n) {
	map<int, int>ans;
	for (int i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			n /= i;
			++ans[i];
		}
	}
	if (n != 1) ++ans[n];
	return ans;
}

int n, m, cnt, ans;
P p[100010];
prique2(int)que;
signed main() {
	cin >> n >> m;
	rep(i, n) {
		cin >> p[i].first >> p[i].second;
	}
	sort(p, p + n);
	for (int i = 1; i <= m; ++i) {
		while (cnt < n&& p[cnt].first <= i) {
			que.push(p[cnt].second);
			cnt++;
		}
		if (que.empty()) continue;
		ans += que.top();
		que.pop();
	}
	cout << ans << endl;
}

Measured memory_bytes: 2936
n,m =[int(r) for r in input().split()]

matrix = []
for ni in range(n):
    matrix.append([int(a)for a in input().split()])

vector = []
for mi  in range(m):
    vector.append(int(input()))

for ni in range(n):

    sum = 0
    for mi in range(m):
        sum += matrix[ni][mi] * vector[mi]

    print(sum)

Measured memory_bytes: 7988
N, A, B = [int(_) for _ in input().split()]
X = [int(_) for _ in input().split()]
p = [B] * (N - 1)
for i in range(N - 1):
    if (X[i + 1] - X[i]) * A < B:
        p[i] = (X[i + 1] - X[i]) * A
print(sum(p))


Measured memory_bytes: 20020
#include <stdio.h>
#include <limits.h>
#define MAXN 100
#define MAXROW 100
#define MAXCOL 100
#define min(a, b) ( ((a) > (b)) ? (b):(a) )

/* Prototype Declaration */
void matrixChainOrder(void);

/* Global Variables */
int m[MAXROW + 1][MAXCOL + 1];
int p[MAXN + 1];
int n;

/* Main */
int main() {
  int i;

  scanf("%d", &n);
  for ( i = 1; i <= n; i++ )
    scanf("%d%d", &p[i-1], &p[i]);

  matrixChainOrder();

  printf("%d\n", m[1][n]);

  return 0;
}

void matrixChainOrder() {
  int i, j, k, l;
  int x;

  for ( i = 1; i <= n; i++ ) m[i][i] = 0;

  for ( l = 2; l <= n; l++ ) {
    for ( i = 1; i <= n - l + 1; i++ ) {
      j = i + l - 1;
      m[i][j] = INT_MAX;
      for( k = i; k < j; k++ ) {
        x = m[i][k] + m[k + 1][j] + p[i - 1] * p[k] * p[j];
        m[i][j] = min(m[i][j], x);
      }
    }
  }
}

Measured memory_bytes: 636
// include
#include <iostream>

// typedef
typedef unsigned long long ull;
typedef unsigned int uint;

// macro
#define REP(index, num) for (auto index = 0; index < num; index++)
#define REP1(index, num) for (auto index = 1; index <= num; index++)

#define MAX_NUM 60

// using namespace 
using namespace std;

const int ExistIsland(const int inX, const int inY);

// global
int W, H;
int c[MAX_NUM][MAX_NUM] = { 0 };

int main()
{
  while (1)
  {
    cin >> W >> H;

    // 入力が 0 0 なら終了
    if (W * H == 0)
      break;

    REP(hId, H)
      REP(wId, W)
      cin >> c[wId][hId];

    // 深さ優先探索
    int count = 0;
    REP(hId, H)
      REP(wId, W)
      count += ExistIsland(wId, hId);

    cout << count << endl;
  } 
}

const int ExistIsland(const int inX, const int inY)
{
  if (inX < 0 || W <= inX) return 0;
  if (inY < 0 || H <= inY) return 0;

  if (c[inX][inY] == 0)
    return 0;
  else
    c[inX][inY] = 0;

  //bool existFlag = true;

  // 周りに移動
  ExistIsland(inX + 1, inY);
  ExistIsland(inX + 1, inY + 1);
  ExistIsland(inX, inY + 1);
  ExistIsland(inX - 1, inY + 1);
  ExistIsland(inX - 1, inY);
  ExistIsland(inX - 1, inY - 1);
  ExistIsland(inX, inY - 1);
  ExistIsland(inX + 1, inY - 1);

  return 1;
}





Measured memory_bytes: 3228
import java.io.*;
import java.util.*;
public class Main {
    private static MyScanner scanner;

    public static void main (String[] args){
        Main instance = new Main();
        scanner = instance.new MyScanner();
        instance.solve();
    }

    private void solve() {
        try {
            int N = scanner.nextInt();
            long[] A = new long[N];
            for (int i = 0; i < N; i++) {
                A[i] = scanner.nextLong();
            }
            long[] d = new long[N];
            for (int i = 0; i < N; i++) {
                d[i] = A[(i+1)%N] - A[i];
            }
            long n = 0;
            for (int i = 0; i < N; i++) {
                n += A[i];
            }
            long x = (long)(N+1)*N / 2l;
            long k = n / x;
            if (n % x != 0) {
                System.out.println("NO");
                return;
            }
            for (int i = 0; i < N; i++) {
                if (d[i]-k > 0 || (d[i]-k) % N != 0) {
                    System.out.println("NO");
                    return;
                }
            }
            System.out.println("YES");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private class MyScanner {
        String[] s;
        int i;
        BufferedReader br;
        String reg = " ";

        MyScanner () {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() throws IOException {
            if (i < s.length) return s[i++];
            String line = br.readLine();
            while (line.equals("")) {
                line = br.readLine();
            }
            s = line.split(reg, 0);
            i = 0;
            return s[i++];
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }

        public long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }
    }
}

Measured memory_bytes: 50004
import java.util.Scanner;

class Main{
    
    public static void main(String[] args){
        
        Scanner sc = new Scanner(System.in);
        
        for(int i=1;i<=10000;i++){
        int n=sc.nextInt();
        if(n==0) break;
        System.out.println("Case "+i+": "+n);
        }
    }
    
}


Measured memory_bytes: 42120
h,w=map(int, input().split())
a=[input().split() for _ in range(h)]
x="#"*(w+2)
b=[]
for i in range(h):
    b.append('#'+"".join(a[i])+'#')
print(x)
for i in range(h):
    print(b[i])
print(x)

Measured memory_bytes: 3060
package main

import "fmt"

// a > b
func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a % b)
}

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	if a > b {
		fmt.Println(gcd(a, b))
	} else {
		fmt.Println(gcd(b, a))
	}
}



Measured memory_bytes: 1128
io = STDIN
N=io.gets.to_i
v=io.gets.split.map(&:to_i).sort
def merge(a)
  return a.inject(:+)/2.0 if a.size==2
  merge (a[2..-1] + [a[0..1].inject(:+)/2.0]).sort
end
puts merge(v)


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

using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;
#define DEBUG freopen("in.txt", "r", stdin);

struct fastio {
    fastio() {
        ios::sync_with_stdio(false);
        cout << setprecision(10) << fixed;
        cin.tie(0);
    }
};

fastio _fast_io;

const int N = 1e5 + 5;
int n, m, k, ans;

int main() {
    cin >> n;
    cout << (1 + n) * n / 2 << endl;
    return 0;
}


Measured memory_bytes: 3560
#include <iostream> 
#include <vector>
#include <stdio.h>
#include <cmath>
#include <map> 
#include <climits>
#include <unordered_map> 
#include <string> 
#include <algorithm>
#include <stack>
#include <queue>
#include <list> 

using namespace std;

int main() {
	int n;
	long p;
	cin >> n >> p;
	if (n == 1) {
		cout << p << endl;
		return 0;
	}
	long tempP = p;
	int tempCounter = 0;
	int result = 1;
	while (tempP % 2 == 0) {
		tempCounter++;
		tempP /= 2;
	}
	result *= pow(2, floor(tempCounter / n));
	for (int i = 3; i <= sqrt(p); i+= 2) {
		tempCounter = 0;
		while (tempP % i == 0) {
			tempCounter++;
			tempP /= i;
		}
		result *= pow(i, floor(tempCounter / n));
	}
	if (tempP > 2) {
		result *= pow(tempP, floor(tempCounter / n));
	}
	cout << result << endl;
    return 0;
}

Measured memory_bytes: 888
import java.io.*;
import java.util.*;
import java.math.*;
import java.awt.Point;

public class Main {
	static final long MOD = 998244353L;
	//static final long INF = -1000000000000000007L;
	//static final long MOD = 1000000007L;
	//static final int INF = 1000000007;
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter pw = new PrintWriter(System.out);
		long A = sc.nl();
		long B = sc.nl();
		pw.println(A*B/gcd(A,B));
		pw.close();
	}
	
	//Find the GCD of two numbers
	public static long gcd(long a, long b) {
		if (b == 0)
			return a;
		else
			return gcd(b,a%b);
	}
	
	//Fast exponentiation (x^y mod m)
	public static long power(long x, long y, long m) { 
		long ans = 1;
		x %= m;
		while (y > 0) { 
			if(y % 2 == 1) 
				ans = (ans * x) % m; 
			y /= 2;  
			x = (x * x) % m;
		} 
		return ans; 
	}
	
    public static int[][] sort(int[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<int[]>() {
			  @Override
        	  public int compare(int[] arr1, int[] arr2) {
				  return arr1[0]-arr2[0]; //ascending order
	          }
		});
		return array;
	}
    
    public static long[][] sort(long[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    long[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<long[]>() {
			  @Override
        	  public int compare(long[] arr1, long[] arr2) {
				  return 0;
	          }
		});
		return array;
	}
    
    static class FastScanner { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastScanner() { 
            br = new BufferedReader(new InputStreamReader(System.in)); 
        } 
  
        String next() { 
            while (st == null || !st.hasMoreElements()) { 
                try { 
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int ni() { 
            return Integer.parseInt(next()); 
        } 
  
        long nl() { 
            return Long.parseLong(next()); 
        } 
  
        double nd() { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() { 
            String str = ""; 
            try { 
                str = br.readLine(); 
            } catch (IOException e) {
                e.printStackTrace(); 
            } 
            return str;
        }
    }
}

Measured memory_bytes: 23124
#include <bits/stdc++.h>
#define DEBUG if(0)
#define lli long long int
#define ldouble long double
using namespace std;

const int maxN = 1e5; int n, m;
vector<int> graph[maxN];

int parent[maxN];
void bfs()
{
  queue<pair<int, int>> q;
  q.push({0, -1});
  while (!q.empty())
  {
    int u = q.front().first, prv = q.front().second; q.pop();
    if (parent[u] != -1) continue;
    if (prv != -1) parent[u] = prv;
    for (int v: graph[u])
      q.push({v, u});
  }
}

int main()
{
  while (scanf("%d %d", &n, &m) != EOF)
  {
    for (int i = 0; i < n; i++) graph[i].clear();
    for (int i = 0; i < m; i++)
    {
      int u, v; scanf("%d %d", &u, &v); u--, v--;
      graph[u].push_back(v), graph[v].push_back(u);
    }

    memset(parent, -1, sizeof(parent));
    bfs();
    bool ans = true;
    for (int i = 1; i < n; i++)
      if (parent[i] == -1)
        ans = false;
    printf("%s\n", ans ? "Yes" : "No");
    if (ans)
      for (int i = 1; i < n; i++)
        printf("%d\n", parent[i] + 1);
  }
  return 0;
}

Measured memory_bytes: 12984
#include<bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    map<int, int> M;
    long long ans = 1;
    for (int i = 0; i < N; ++i) {
        int d;
        cin >> d;
        M[d]++;
        if (i == 0 ^ d == 0) {
            ans = 0;
        }
    }
    pair<int, int> before = {-1, 1};
    for (auto m : M) {
        if (m.first != before.first+1) {
            ans = 0;
        }
        for (int i = 0; i < m.second; ++i) {
            ans *= before.second;
            ans %= mod;
        }
        before = m;
    }
    printf("%lld\n", ans);
    return 0;
}


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

using namespace std;

typedef long long ll;

vector <ll> v;

int main ()
{
  ll n, k, i, j;
  
  cin>> n >> k;
  
  for (i = 0; i < n; i++) {
    cin>> j;
    v.push_back(j);
  }

  if (n <= k) {
    cout<< 0 << endl;
    return 0;
  }
  
  sort (v.begin(), v.end());
  
  j = 0;
  
  for (i = 0; i < n-k; i++) {
    j += v[i];
  }
  
  cout<< j << endl;
  
  return 0;
}

Measured memory_bytes: 2420
/*
　　　∫ ∫ ∫
　　　ノヽ
　　（＿　 ）
　（＿　　　 ）
（＿＿＿＿＿＿ ）
　ヽ(´･ω･)ﾉ　
　　 |　 /
　　 UU
*/
#pragma region macro
#include <bits/stdc++.h>
typedef long long int64;
using namespace std;
using P = pair<int64, int64>;
typedef vector<int> vi;
const int MOD = (int)1e9 + 7;
const int64 INF = 1LL << 62;
const int inf = 1<<30;
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; }
#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i,s,n) for (int i = s; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end() //コンテナじゃないと使えない!!
#define debug(x) cerr << #x << ": " << x << "\n";
#define mp make_pair
#define bn '\n'
template <typename T>
ostream& operator<<(ostream& os, const vector<T> &V){
    int N = V.size();
    REP(i,N){
        os << V[i];
        if (i!=N-1) os << " ";
    }
    os << "\n";
    return os;
}
template <typename T,typename S>
ostream& operator<<(ostream& os, pair<T,S> const&P){
    os << "(";
    os << P.first;
    os << " , ";
    os << P.second;
    os << ")";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, set<T> &S){
    auto it=S.begin();
    while(it!=S.end()){
        os << *it;
        os << " ";
        it++;
    }
    os << "\n";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, deque<T> &q){
    for(auto it=q.begin();it<q.end();it++){
        os<<*it;
        os<<" ";
    }
    os<<endl;
    return os;
}
template <typename T,typename S>
ostream& operator<<(ostream& os, map<T,S> const&M){
    for(auto e:M){
        os<<e;
    }
    os<<endl;
    return os;
}
vector<pair<int,int>> dxdy = {mp(0,1),mp(1,0),mp(-1,0),mp(0,-1)};
#pragma endregion
//fixed<<setprecision(10)<<ans<<endl;



int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<vector<int64>> DP(N+3,vector<int64>(3,-INF)); //飛ばした回数
    DP[0][0] = 0;
    DP[1][0] = 0;
    DP[2][1] = 0;
    vector<int64> A(N);
    REP(i,N) cin >> A[i];

    REP(i,N){
        int idx = i + 3;
        REP(j,3){
            chmax(DP[idx][j], DP[idx-2][j] + A[i]);
            if(j) chmax(DP[idx][j], DP[idx-3][j-1] +  A[i]);
            if(j) chmax(DP[idx][j], DP[idx-1][j-1]);
        }
    }

    auto ans = DP.back()[1 + (N&1)];
    cout << ans << endl;
}

Measured memory_bytes: 15872
c = []
for i in range(3):
    c.append(list(int(x) for x in input().split()))
c[1][0] -= c[0][0]
c[2][0] -= c[0][0]
if c[1][1] == c[0][1] + c[1][0] and c[1][2] == c[0][2] + c[1][0] and c[2][1] == c[0][1] + c[2][0] and c[2][2] == c[0][2] + c[2][0]:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3064
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#include<cmath>
using namespace std;
int a,b;
int main(){
    cin>>a>>b;
    cout<<a*b-a-b+1;
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
    return 0;
}


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

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

typedef long long ll;
const ll MOD=1e9+7;
using pear = pair<int,int>;

int main(){
   double r; cin>>r;
   cout<<2*r*M_PI<<endl;
}

Measured memory_bytes: 3788
n,m = map(int, input().split())
maxl = 0
minr = 100000
for i in range(m):
    l,r = map(int, input().split())
    maxl = max(maxl,l)
    minr = min(minr,r)
ans = max(minr - maxl + 1, 0)
print(ans)

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

int main() {
  
  long long int cnt = 0;
  int n_in;
  int s[100];
  
  cin >> n_in;
  
  rep(i, n_in) cin >> s[i];
  
  rep(i, n_in){
    rep(j, n_in){
      rep(k, n_in){
        
        //以下、全探索
        if(i == j || j == k || i == k){
          continue;
        }
        
        //要素が同じ場合も弾く
        if(s[i] == s[j] || s[j] == s[k] || s[i] == s[k]){
          continue;
        }
        
        if(s[i] < s[j] && s[j] < s[k]){
          //三角形の存在条件
          if( s[i]+s[j] > s[k] && s[j]+s[k] > s[i] && s[k]+s[i] > s[j] ){
            cnt++;
          }
          
        }
        else{
          // i < j < k を満たさないので弾く
          continue;
        }
        
      }
    }
  }
  
  cout << cnt << endl;

  
  return 0;
  
}


Measured memory_bytes: 3560
num_input = [input() for i in range(3)]
a = int(num_input[0].split()[0])
v = int(num_input[0].split()[1])
b = int(num_input[1].split()[0])
w = int(num_input[1].split()[1])
t = int(num_input[2].split()[0])

hoge=b-a
if hoge<0:
    hoge=hoge*-1

if v-w<=0:
    ans="NO"
elif t*(v-w)>=hoge:
    ans="YES"
else:
    ans="NO"
    
print(ans)

Measured memory_bytes: 9152
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>



#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = (int)(n-1); i >= 0; i--)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).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; }

typedef long long ll;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;cin>>n;
  set<int>se;
  repi(i,1,10)repi(j,1,10){
    se.insert(i*j);
  }
  if(se.count(n))cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

  return 0;

}


Measured memory_bytes: 256
import java.util.Scanner;


public class Main{

	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		int n =sc.nextInt();
		String s=sc.next();

		char c[]=new char[n];
		int blackcount=0;
		int blacknum=0;
		int min=n;

		for(int i=0;i<n;++i){
			if(s.charAt(i)=='#')++blacknum;

		}
		for(int i=0;i<n;++i){
			if(s.charAt(i)=='#'){
				++blackcount;
				min=Math.min(min, blackcount-1+(n-1-i)-blacknum+blackcount);
			}
			else min=Math.min(min, blackcount+(n-1-i)-blacknum+blackcount);
		}

		System.out.println(min);


	}
}

Measured memory_bytes: 26724
#include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cout<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cout<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 1120000000

int main(){
  int n;
  cin>>n;
  vector<double> vec(n);
  vector<double> pos(n);
  rep(i,n) cin>>vec[i];

  pos[0] = vec[0];
  repl(i,1,n){
    double best = vec[i];
    rep(j,i){
      double c = vec[i]+vec[j];
      double b = abs(vec[i]-vec[j]);
      best = max(best, pos[j] + sqrt(c*c - b*b));
    }
    pos[i] = best;
  }

  double ans = 0;
  rep(i,n) ans = max(ans, pos[i]+vec[i]);

  printf("%.9f\n", ans);

  return 0;
}

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

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    double a = Double.parseDouble(str[0]);
    double b = Double.parseDouble(str[1]);
    System.out.println((int)Math.ceil((a+b)/2));
  }
}
       

Measured memory_bytes: 33144
#include <stdio.h>

int main() {
  int i;
  char s[4];
  scanf("%s", s);
  
  for(i = 0; i < 2; i++) {
    if (s[i] == s[i+1])
      continue;
    else {
      printf("Yes");
      return(0);
    }
  }
  
  printf("No");
  return(0);
}

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

int main(){
	int n, y;
	cin >> n >> y;
	for(int i = 0; i <= n; i++){
		for(int j = 0; j <= n - i; j++){
			if(y == i*10000 + j*5000 + (n - i -j)*1000){
				cout << i << ' ' << j << ' ' << n - i -j;
				return 0;
			}
		}
	}
	cout << "-1 -1 -1";
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <bitset>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

int main() {
  string s;
  cin >> s;
  bitset<6> bs(s);
  cout << bs.count() << endl;
}


Measured memory_bytes: 256
#11
from collections import Counter
N = int(input())
a = list(map(int, input().split()))


mod = 10 ** 9 + 7
up = [1 for i in range(N+1)]
for i in range(2, N+1):
    up[i] = up[i-1]*i % mod
down = [1 for i in range(N+1)]
down[N] = pow(up[N], mod-2, mod)
for i in range(N-1, 0, -1):
    down[i] = (i+1)*down[i+1] % mod


def ncr(n, r):
    if not n >= r >= 0:
        return 0
    else:
        return up[n]*down[n-r]*down[r] % mod


duplicated_number, _cnt = Counter(a).most_common()[0]
index_que = []

for i in range(N+1):
    if a[i] == duplicated_number:
        index_que.append(i)
        
A, B = min(index_que), max(index_que)

for k in range(1, N+2):
    if k == 1:
        print(N)
    else:
        ans = ncr(N-1, k-2)+ncr(N-1, k)+2 * ncr(N-1, k-1)-ncr(N-B+A, k-1)
        print(ans % mod)



Measured memory_bytes: 34644
import Control.Applicative
import Control.Monad
import Data.List
main = do
  n<- (read::String->Int) <$> getLine
  ws <-  map (map (read::String->Int) .words) <$> (replicateM n getLine)
  putStr $ unlines $ drawMap $ foldl (\x y-> zipWith (+) x y) (replicate (10*3*4) 0) (map room ws)

room:: [Int]->[Int]
room [b,f,r,v] = (replicate (pos-1) 0)++[v]++(replicate (10*3*4-pos) 0)
  where pos=(b-1)*30+(f-1)*10+r

chunk :: Int -> [a] -> [[a]]
chunk n [] = []
chunk n xs = ys : chunk n zs
  where (ys,zs) = splitAt n xs

drawFloor:: [Int]->String
drawFloor x = " " ++ ((unwords . map show) x)

drawBlock:: [Int]->[String]
drawBlock x = map drawFloor $ chunk 10 x

drawMap::[Int]->[String]
drawMap x = concat (intersperse [separator] (map drawBlock (chunk 30 x)))

separator:: String
separator= replicate 20 '#'

Measured memory_bytes: 5172
#include <iostream>
#include <queue>
#define int long long

using namespace std;

signed main()
{

    int k;
    cin >> k;
    queue<int> q;
    for (int i = 1; i <= 9; i++)
        q.push(i);
    while (!q.empty())
    {
        int x = q.front();
        q.pop();
        k--;
        if (k == 0)
        {
            cout << x << '\n';
            break;
        }
        int t = x % 10;
        for (int y = t - 1; y <= t + 1; y++)
        {
            if (y < 0)
                continue;
            if (y > 9)
                break;
            q.push(x * 10 + y);
        }
    }

    return 0;
}

Measured memory_bytes: 5172
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(os.Stdout)

	var chokudai Chokudai
	n := getNextInt(scanner)
	chokudai.preorders = make([]int, n)
	chokudai.inorders = make([]int, n)
	chokudai.postorders = make([]int, n)
	chokudai.pos = 0
	chokudai.n = n
	chokudai.i = 0

	for i := 0; i < n; i++ {
		chokudai.preorders[i] = getNextInt(scanner)
	}
	for i := 0; i < n; i++ {
		chokudai.inorders[i] = getNextInt(scanner)
	}

	chokudai.rec(0, n)

	fmt.Fprintln(writer, joinint(chokudai.postorders, " "))

	writer.Flush()
}

// Chokudai solver
type Chokudai struct {
	preorders  []int
	inorders   []int
	postorders []int
	pos        int
	n          int
	i          int
}

func (c *Chokudai) rec(l, r int) {
	if l >= r {
		return
	}
	root := c.preorders[c.pos]
	c.pos++
	for i := l; i < r; i++ {
		if root != c.inorders[i] {
			continue
		}
		c.rec(l, i)
		c.rec(i+1, r)
		break
	}
	c.postorders[c.i] = root
	c.i++
}
func joinint(a []int, sep string) string {
	n := len(a)
	ss := make([]string, n)
	for i := 0; i < n; i++ {
		ss[i] = fmt.Sprintf("%d", a[i])
	}
	return strings.Join(ss, sep)
}




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

int a[333][333], b[333];
int main() {
    int h, w, k, x = 0;
    cin >> h >> w >> k;
    for(int i = 0; i < h; i++) {
        string s;
        cin >> s;
        for(int j = 0; j < w; j++)
            if(s[j] == '#')
                a[i][j] = ++x, b[i] = 1;
    }
    for(int i = 0; i < h; i++) {
        if(!b[i])
            continue;
        for(int j = 0; j < w; j++) {
            if(a[i][j])
                continue;
            if(j)
                a[i][j] = a[i][j - 1];
        }
        for(int j = w; j--;) {
            if(a[i][j])
                continue;
            if(j + 1 < w)
                a[i][j] = a[i][j + 1];
        }
    }
    for(int i = 0; i < h; i++) {
        if(b[i])
            continue;
        for(int j = 0; j < w; j++) {
            if(a[i][j])
                continue;
            if(i)
                a[i][j] = a[i - 1][j];
        }
    }
    for(int i = h; i--;) {
        if(b[i])
            continue;
        for(int j = 0; j < w; j++) {
            if(a[i][j])
                continue;
            if(i + 1 < h)
                a[i][j] = a[i + 1][j];
        }
    }
    for(int i = 0; i < h; i++) {
        for(int j = 0; j < w; j++)
            cout << a[i][j] << ' ';
        cout << '\n';
    }
    cout << flush;
    return 0;
}


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

int main() {
        int N, A[10101];
        cin >> N;
        for(int i = 0; i < N; i++) cin >> A[i];
        int ans = 0;
        for(int i = 0; i < N; i++ ) {
                while (A[i] % 2 == 0) {
                        A[i] /= 2;
                        ans++;
                }
        }
        cout << ans << endl;
}


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

#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define endl '\n'

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

const int INF = 1e9;
const int MAXN = 3e5 + 5;
const int MOD = 1e9 + 7;

int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	ll x; cin >> x;
	ll ans = 0;
	ans += (ll)(x / 500) * 1000;
	x %= 500;
	ans += (ll)(x / 5) * 5;
	cout << ans;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using ll=long long;
using ld=long double;
//#define int long long
#define _CRT_SECURE_NO_WARNINGS
#define rep(i, n) for (int i = 0; i < n; i++)
#define _GLIBCXX_DEBUG
const int MOD = 1e9 + 7;
const int INF = 1e18 + 9;
constexpr long double pi = 3.141592653589793238462643383279;
int fact(int i) {
    if (i == 0) return 1;
    return (fact(i - 1)) * i;
}
int gcd(int a, int b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
int keta(int n) {
    if (n == 0) return 1;
    int count = 0;
    while (n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
int ketasum(int n) {
    int sum = 0;
    while (n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
char toSmall(char c) { // 大文字を小文字へ
    return (c + 0x20);
}
char toLarge(char c) { // 小文字を大文字へ
    return (c - 0x20);
}
float myPower(int a, int n) { // aのn乗の計算
    float x = 1;
    while (n > 0) { // 全てのbitが捨てられるまで
        if (n & 1) { // 一番右のbitが１のとき
            x *= a;
        }
        a *= a;
        n >>= 1; // bit全体を右に1つシフトして一番右を捨てる
    }
    return x;
}
bool is_prime(const unsigned n) {
    switch (n) {
    case 0: // fall-through
    case 1: return false;
    case 2: // fall-through
    case 3: return true;
    } // n > 3 が保証された

    if (n % 2 == 0 || n % 3 == 0) return false;
    // n は 2 と 3 のいずれの倍数でもないことが保証された
    // これより n は (6の倍数)-1 か (6の倍数)+1 である
    // 6の倍数前後の数を使って試し割りをする
    for (unsigned i = 5; i * i <= n; i += 6) {
        if (n % i == 0) return false; // (6の倍数)-1
        if (n % (i + 2) == 0) return false; // (6の倍数)+1
    }
    return true;
}
int main(void){
    string a, b;
    cin >> a >> b;
    if (a.size() > b.size()) {
        cout << "GREATER" << endl;
        return(0);
    }
    else if (a.size() < b.size()) {
        cout << "LESS" << endl;
        return(0);
    }
    else {
        for (int i = 0; i < a.size(); i++) {
            if (a[i] > b[i]) {
                cout << "GREATER" << endl;
                return(0);
            }
            if (a[i] < b[i]) {
                cout << "LESS" << endl;
                return(0);
            }
        }
    }
    cout << "EQUAL" << endl;
    return 0;
}

Measured memory_bytes: 3548
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pi 3.141592653589793238
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define bg begin()
#define end end()
#define sz size()
#define vi vector<int>
#define vl vector<long long int>
int main(){
	fast;
	char a;
	cin>>a;
	if(a>=65 &&a<=90 )
		cout<<"A";
	else
		cout<<"a";
	return 0;
}



Measured memory_bytes: 3648
import java.io.File;
import java.io.FileInputStream;
import java.util.NoSuchElementException;
import java.util.Scanner;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;

public class Main {
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		
		long A = sc.nextLong();
		String op = sc.next();
		long B = sc.nextLong();
		System.out.println(op.equals("+") ? A+B : A-B);
	}
}

Measured memory_bytes: 23124
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF=2147483647;
inline ll read(){
	ll x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){
		if(ch=='-') f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	return x*f;
}
string s;
int main(){
	cin>>s;
	if(s[1]=='B') printf("ARC\n");
	else printf("ABC\n");
	return 0;
}


Measured memory_bytes: 3624
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
const int maxn = 100005;
int N, a[maxn];
int main() {
	scanf("%d", &N);
	int mx = 0, mn = N;
	for(int i=1; i<=N; ++i) {
		scanf("%d", a+i);
		mx = max(mx, a[i]);
		mn = min(mn, a[i]);
	}
	if(mx-mn>1 || mx>N) {
		puts("No"); return 0;
	}
	int cx = 0, cn = 0;
	for(int i=1; i<=N; ++i) {
		cx += a[i] == mx;
		cn += a[i] == mn;
	}
	if(mx==mn) {
		if(mx==N-1) puts("Yes");
		else if(N%mx==0) puts("Yes");
		else puts("No");
		return 0;
	}
	if(cn+cx/2<mx || cn+1>mx) puts("No");
	else puts("Yes");
	return 0;
}

Measured memory_bytes: 512
# from .myutil import Combination
from math import factorial

MOD = 10 ** 9 + 7
def Combination2(n, r):
    ret = 1
    for i in range(r):
        ret = ret * (n - i) % MOD
    return ret * pow(factorial(r), MOD - 2, MOD) % MOD

n, a, b = map(int, input().split())

total = pow(2, n, MOD) - Combination2(n, a) - Combination2(n, b) - 1
total %= MOD

print(total)


Measured memory_bytes: 73180
#include <iostream>
#include <string>
#include <stdio.h>
#include <math.h>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <vector>
using namespace std;
vector < int > V;
vector < int > P;
int main()
{
    int a,b;
    char c;
    cin>>a>>c>>b;
    if(c=='+')
    {
        cout<<(a+b)<<"\n";
    }
    else
    {
        cout<<(a-b)<<"\n";
    }
}


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

typedef long long ll;
 
int main(){
  int a, b, c;
  cin >> a >> b >> c;
  string ans;
  if(a<=c && c<=b) ans = "Yes";
  else ans = "No";
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int ans =0;
		for (int i = 1; i <= N; i++) {
			int target = i;
			int sum = 0;
			while (target >0) {
				sum+=target%10;
				target=target/10;
			}
			if (sum >= A && sum <=B) {
				ans+=i;
			}
		}
		System.out.println(ans);
	}
}



Measured memory_bytes: 35840
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

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

    vector<string> sub(s.size() * k, "zzzzz");
    for (int i = 0; i < static_cast<int>(s.size()); i++) {
        for (int j = 0; i + j < static_cast<int>(s.size()) && j < k; j++) {
            sub[i * k + j] = s.substr(i, j + 1);
        }
    }

    sort(sub.begin(), sub.end());
    sub.erase(unique(sub.begin(), sub.end()), sub.end());

    cout << sub[k - 1] << endl;
}


Measured memory_bytes: 1664
#include<stdio.h>
int main(void){
	int x,y,z,p,c,t;
	t=0;
	c=0;
			scanf("%d %d %d",&x,&y,&z);
		for(p=0;c<y;p++){
			c=x;
			c+=p;
			if(z%c==0){
			t++;
}}
	printf("%d\n",t);
	return 0;
}

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

#define ull unsigned long long int
#define ll long long int
#define vll vector<ll>
#define vi vector<int>
#define pll pair<long long, long long>
#define vpll vector < pair<long long,long long> >
#define itr vll::iterator
#define all(c) c.begin(),c.end()
#define pb push_back
#define f first
#define s second
#define mod 1000000007
#define inf 1000000000000000001

#define rep(i, n)      for(ll i = 0; i <  n; ++i)
#define repA(i, a, n)  for(ll i = a; i <= n; ++i)
#define repD(i, a, n)  for(ll i = a; i >= n; --i)

using namespace std;

bool func(const pll &a, const pll &b){
    return a.s < b.s;
}

ll power(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll modInverse(ll a){return power(a,mod-2);}

void solve(){
    ll n, k;
    cin >> n >> k;
    vll v(n, 0);
    rep(i, k){
    	ll d; cin >> d;
    	rep(j, d){
    		ll tmp;
    		cin >> tmp;
    		v[tmp-1]++;
    	}
    }
    ll cnt = 0;
    rep(i, n) if(!v[i]) cnt++;
    cout << cnt;
}

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

    int t, tmp = 0;
    // cin >> t;
    t = 1;
    while(t--){
        // cout << "Case #" << ++tmp << ": ";
        solve();
        if(t) cout << "\n";
    }
    cerr << "Time : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n";
    return 0;
}

Measured memory_bytes: 3848
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(10)

using namespace std;

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

    int n;

    cin >> n;

    map<int, int> cnt0;
    map<int, int> cnt1;

    REP(i, n) {
        int a;
        cin >> a;
        if (i % 2 == 0) {
            cnt0[a]++;
        } else {
            cnt1[a]++;
        }
    }

    int maxf0 = 0;
    int maxs0 = 0;
    int cntf0 = 0;
    int cnts0 = 0;
    for (auto kv : cnt0) {
        if (kv.second > cntf0) {
            maxs0 = maxf0;
            cnts0 = cntf0;
            maxf0 = kv.first;
            cntf0 = kv.second;
        } else if (kv.second > cnts0) {
            maxs0 = kv.first;
            cnts0 = kv.second;
        }
    }

    int maxf1 = 0;
    int maxs1 = 0;
    int cntf1 = 0;
    int cnts1 = 0;
    for (auto kv : cnt1) {
        if (kv.second > cntf1) {
            maxs1 = maxf1;
            cnts1 = cntf1;
            maxf1 = kv.first;
            cntf1 = kv.second;
        } else if (kv.second > cnts1) {
            maxs1 = kv.first;
            cnts1 = kv.second;
        }
    }

    if (maxf0 != maxf1) {
        cout << n - (cntf0 + cntf1) << endl;
    } else {
        if (cntf0 + cnts1 > cnts0 + cntf1) {
            cout << n - (cntf0 + cnts1) << endl;
        }
        else {
            cout << n - (cnts0 + cntf1) << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 6528
import Control.Monad

main = do
  [x,n] <- map read . words <$> getLine :: IO [Int]
  ps <- map read . words <$> getLine :: IO [Int]
  print $ head (run x x ps)
  return ()

 where
  run :: Int -> Int -> [Int] -> [Int]
  run number1 number2 ps =
    if number1 `elem` ps && number2 `elem` ps
       then run (number1-1) (number2+1) ps 
       else if not (number1 `elem` ps || number2 `elem` ps)
        then [number1, number2]
        else if not (number1 `elem` ps) && number2 `elem` ps
        then [number1]
        else if number1 `elem` ps && not (number2 `elem` ps)
        then [number2]
        else error "no"

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

#define int long long
#define pb push_back
int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
    int n,k;
    cin>>n>>k;
    
    int a[n];
    for(int i=0;i<n;i++)
        cin>>a[i];
    unordered_map<int,bool> m;
    
    for(int i=0;i<k;i++)
    {
        int x,y;
        cin>>x>>y;
        
        x--;
        y--;
        int maxi=min(a[x],a[y]);
        if(maxi==a[x])
            m[x]=1;
        if(maxi==a[y])
            m[y]=1;
    }
    int cnt=0;
    for(int i=0;i<n;i++)
    {
        if(!m[i])
            cnt++;
    }
    cout<<cnt;
}
      
       

Measured memory_bytes: 8136