akhauriyash/Code-Regression huggingface dataset:
n = int(input())
a = []
for _ in range(n):
    m = int(input())
    a.append([list(map(int, input().split())) for _ in range(m)])

ans = 0
for i in range(2**n):
    for j in range(n):
        if ((i >> j) & 1) == 1:
            for k,l in a[j]:
                if ((i >> (k-1)) & 1) != l:
                    break
            else:
                continue
            break
    else:
        ans = max(ans,bin(i).count('1'))
print(ans)

Measured memory_bytes: 3064
# -*- coding:utf-8 -*-

line = input()
line = line.split(" ")
N, Y = int(line[0]), int(line[1])

for x in range(0, Y//10000+1):
    for y in range(0, (Y-10000*x)//5000+1):
        if x + y > N:
            break
        if 9000*x + 4000*y == Y-1000*N:
            print(x, y, N-x-y)
            exit()
print(-1, -1, -1)

Measured memory_bytes: 3064
S = input()
a = "Yes"
for i in range(len(S)):
    if (i+1) % 2 == 0 and S[i] in["L", "U", "D"]:

        pass
    elif (i+1) % 2 == 1 and S[i] in["R", "U", "D"]:

        pass
    else:
        a = "No"
print(a)


Measured memory_bytes: 3060
//prepared by dumb
#include<bits/stdc++.h>
using namespace std;
#define   ll long long int
#define   dl double  
#define   llu unsigned long long int
#define   scll(x) scanf("%lld",&x)
#define   scdl(x) scanf("%lf",&x)
#define   scull(x) scanf("%llu",&x)
#define   scch(x) scanf(" %c",&x)
#define   pb(x) push_back(x)
#define   pf(x) push_front(x)
#define   ppb() pop_back()
#define   ppf() pop_front()
#define   Pi acos(-1.0)
#define   INF 1000000000000000000
#define   mod 1000000007
#define   ff first
#define   ss second
#define   mpr make_pair
#define   debug(x) cout<<x<<'\n';
//sin((x*pi)/180.0)[x in degree]
//sin(x)[x in radian]
//asin(x)[radian]
//(asin(x)*180)/pi[degree]
//or(|)//and(&)//xor(^)//not(~)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
ll a, b, c, d, e, f = 0, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z;
ll cnt = 0, ans = 0, l1, l2, l3, c1 = 0, c2 = 0, c3 = 0, mx = 0, mn = 0;
ll prevsum = 0, ans1 = 0, ans2 = 0, odd = 0, even = 0, hh, mm;
    string str, str1, str2;

    scll(n);
    vector<ll>coun(n+1,0);
   for(i=1;i<=n;i++)
   {
   	for(j=i;j<=n;j+=i)
   	  coun[j]++;
   }
    

    for(i=1;i<=n;i++)
    	ans+=i*coun[i];
    cout<<ans;


return 0;
}

Measured memory_bytes: 81424
#include<stdio.h>
#define H 250
int main()
{
  int a,i,A[H];
  scanf("%d",&a);
  for(i=1;i<=a;i++){
    scanf("%d",&A[i]);
  }
  for(i=1;i<=a;i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(i/2>=1) printf("parent key = %d, ",A[i/2]);
    if(2*i<=a) printf("left key = %d, ",A[2*i]);
    if(2*i+1<=a) printf("right key = %d, ",A[2*i+1]);
    printf("\n");
  }
  return 0;
}



Measured memory_bytes: 2080
a,b,c_deg=map(float,input().split())

import  math
c_rad=math.radians(c_deg)

c=math.sqrt(a**2+b**2-2*a*b*math.cos(c_rad))
l=a+b+c
h=math.sin(c_rad)*b
s=a*h/2
print('{:.5f}'.format(s))
print('{:.5f}'.format(l))
print('{:.5f}'.format(h))



Measured memory_bytes: 5696
import sys
input = sys.stdin.readline
def main():
    A, B = map(int, input().split())
    ans = 0
    for i in range(2):
        ans += max(A,B)
        B = min(A,B)
        A = ans - 1
    print(ans)

if __name__ == '__main__':
    main()

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

using namespace std;

using int64 = long long;
//const int mod = (int) (1e9 + 7);
const int mod = 998244353;

const int64 infll = (1LL << 60) - 1;
const int inf = (1 << 30) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;


template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 > &p) {
  os << p.first << " " << p.second;
  return os;
}

template< typename T1, typename T2 >
istream &operator>>(istream &is, pair< T1, T2 > &p) {
  is >> p.first >> p.second;
  return is;
}

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

template< typename T >
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}

template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

template< typename T = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

template< typename T, typename... Ts >
auto make_v(size_t a, Ts... ts) {
  return vector< decltype(make_v< T >(ts...)) >(a, make_v< T >(ts...));
}

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

template< typename F >
struct FixPoint : F {
  FixPoint(F &&f) : F(forward< F >(f)) {}

  template< typename... Args >
  decltype(auto) operator()(Args &&... args) const {
    return F::operator()(*this, forward< Args >(args)...);
  }
};

template< typename F >
inline decltype(auto) MFP(F &&f) {
  return FixPoint< F >{forward< F >(f)};
}


int main() {
  int N;
  cin >> N;
  vector< int > S(N);
  cin >> S;
  int P = 0;
  for(int i = 0; i < N; i++) P ^= S[i];
  for(int i = 0; i < N; i++) S[i] ^= P;
  cout << S << "\n";
}

Measured memory_bytes: 3956
import itertools
import math
def gcd(a,b):
    r = a % b
    if r == 0:
        return b
    return gcd(b,r)

def lcm(a,b):
    return (a * b)//gcd(a,b)

N = int(input())
temp = 1
for _ in range(N):
    num = int(input())
    temp = lcm(temp,num)
print(temp)

Measured memory_bytes: 3064
#include <string>
#include <vector>
#include <deque>
#include <map>
#include <set>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <iostream>
#include <utility>
#include <sstream>
#include <cstring>
#include <bitset>
#include <climits>
 
using namespace std;
#define  AS(arr)  (sizeof(arr)/sizeof(arr[0]))
#define ALL(c) (c).begin(),(c).end() 
#define SIZE(a) int((a).size())
#define EACH(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define REP(i,n) for(int i=0;i<(int)n;++i)
typedef vector<int> VI;
typedef vector<string> VS;
typedef long long LL;

int main(void){
    int a, b;
    cin >> a >> b;
    if(a == 0 || b == 0)
    {
        cout << "Zero" << endl;
    }
    else if(a <= 0 && b >= 0)
    {
        cout << "Zero" << endl;
    }
    else if(a > 0)
    {
        cout << "Positive" << endl;
    }
    else if(b < 0)
    {
        if((b - a) % 2 == 0)
            cout << "Negative" << endl;
        else
            cout << "Positive" << endl;
    }
    else
    {
        if(b % 2 == 0)
            cout << "Negative" << endl;
        else
            cout << "Positive" << endl;
    }

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int answer_(vector<int> arr,int n,int k)
{
vector<int>dp(n+1);

        dp[1]=0;
        for(int i =2;i<=n;i++)
        {
            dp[i]=INT_MAX;
            for(int j =i-1;j>=1  &&  (i-j)<=k; j--)
            {
                dp[i] = min(dp[i],abs(arr[i]-arr[j])+dp[j]);
            }
        }
        return dp[n];
}
int main() {
    int n,k;
    cin>>n>>k;
    vector<int> arr(n+1);
    for(int i=1;i<=n;i++)
    {
        cin>>arr[i];
    }
    cout<<answer_(arr,n,k)<<endl;
}


Measured memory_bytes: 4280
#include<bits/stdc++.h>
using namespace std;
int a[11],n;
inline void Print(){
	for(int i=1;i<=n;++i)cout<<(char)(a[i]+'a');
	cout<<'\n';
}
int main(){
	ios_base::sync_with_stdio(false);
	cin>>n;
	for(;;){
		if(a[1]==1)break;
		Print();
		++a[n];
		int t=n;
		int pm[11];
		pm[1]=0;
		for(int i=2;i<=n;++i)pm[i]=max(pm[i-1],a[i]);
		for(int i=n;i>1;--i){
			if(a[i]>pm[i-1]+1){
				++a[i-1];
				t=i-1;
			}
		}
		if(t==1)break;
		for(int i=t+1;i<=n;++i)a[i]=0;
	}
}

Measured memory_bytes: 1536
#include<stdio.h>

int main(){
	
	int pointA,pointB,cardA[10001],cardB[10001],a,i;
	
	while(1){
	
	pointA=0;
	pointB=0;
	scanf("%d",&a);
	
		if(a==0){
			break;
		}
		
	for(i=0;i<a;i++){
		scanf("%d %d",&cardA[i],&cardB[i]);
		
		if(cardA[i]>cardB[i]){
			pointA+=cardA[i]+cardB[i];
		}else if(cardA[i]<cardB[i]){
			pointB+=cardA[i]+cardB[i];
		}else{
			pointA+=cardA[i];
			pointB+=cardB[i];
		}
		
	}
		printf("%d %d\n",pointA,pointB);
	}
return 0;
}

Measured memory_bytes: 676
#include <stdio.h>

int main(void)
{
	int coin[6];
	int i;
	int total;
	
	for (i = 0; i < 6; i++){
		scanf("%d", &coin[i]);
	}
	
	total = coin[0] + (coin[1] * 5) + (coin[2] * 10) + (coin[3] * 50) + (coin[4] * 100) + (coin[5] * 500);
	if (total >= 1000){
		printf("1\n");
	}
	else {
		printf("0\n");
	}
	
	return (0);
}

Measured memory_bytes: 584
#include <stdio.h>
int sum(int N);

int main(void)
{
	int N;
	
	scanf("%d", &N);

	while(N != 0){
		printf("%d\n", sum(N));
		scanf("%d", &N);
	}
	return 0;
}

int sum(int N)
{
	int count;
	int i, k;
	int s;
	count = 0;
	
	for(i = 1; i < N; i++) {
		s = 0;
		for(k = i; k <= N; k++) {
			s = s + k;
			
			if(s == N) {
				count++;
			}
				
			if(s > N) {
				break;
			}
		}
	}
	
	return count;
}

Measured memory_bytes: 1028
#include <iostream>
#include <vector>
#include <array>
#include <set>
#include <cmath>
#include <string>
#include <sstream>
#include <queue> 
#include <list>
#include <stack>
#include <unordered_map>
#include <algorithm> 
#include <numeric>  
#include <functional>
#include <cassert>
#include <bitset>
#include <cctype>  
#include <iomanip> 
#include <limits>  
#include <regex>
// std::numeric_limits<int>::max(), min()
// std::setprecision(X)
// std::islower(), std::isupper(), std::tolower, std::toupper
// std::accumulate(m.begin(), m.end(), 0LL);
// std::sort(begin(),end()) // 0, 1, 2, 3 ,4 (default, less);
// std::priority_queue<int, vector<int>, less<int>> que; // 4, 3, 2, 1 (defualt, less) : 
// if ( std::regex_match(S, std::regex("(dream|dreamer|erase|eraser)*")) ) std::cout << "YES" << std::endl;

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

using ll = long long;

ll gcd ( ll a, ll b ) { if ( b == 0 ) return a; else return gcd ( b, a%b ); }
ll lcm ( ll a, ll b ) { return a * b / gcd(a, b); }

int main (void) {
  std::cin.tie(0);  std::ios::sync_with_stdio(false);
  char c; std::cin >> c;
  if ( std::islower(c) ) std::cout << "a" << std::endl;
  else std::cout << "A" << std::endl;
  return 0;
}



Measured memory_bytes: 3644
/* ex4_1.c Golden Apple
    dada__              */
#include<stdio.h>

int main(void){
    int tree_num, d;

    scanf("%d %d", &tree_num, &d); //木の本数，dの入力
    
    if(tree_num % (2*d+1) == 0){ //木の本数と監視の範囲による場合分け
        printf("%d", tree_num / (2*d +1));
    }else{printf("%d", tree_num / (2*d +1) +1 );
    }

    return 0;
}

Measured memory_bytes: 128
#![allow(non_snake_case)]
use proconio::input;
// use std::collections::HashMap;

fn main() {
    input! {
        N: usize,
        Hs: [i64; N],
    }

    // 足場dp_cost[i] : 足場(i+1)に到達するのに必要な最小のコスト
    let mut dp_cost = vec![0i64; N];

    for j in 1..N {
        let cand1 = dp_cost[j - 1] + (Hs[j] - Hs[j - 1]).abs();
        let cand2 = if j as i64 - 2 >= 0 {
            dp_cost[j - 2] + (Hs[j] - Hs[j - 2]).abs()
        } else {
            std::i64::MAX
        };
        dp_cost[j] = std::cmp::min(cand1, cand2);
    }

    let ans = dp_cost[N - 1];
    println!("{}", ans);
}


Measured memory_bytes: 3920
package main

import "fmt"

func isPalindrome(s string) bool {
	for i := 0; i < len(s); i++ {
		if s[i] != s[len(s)-i-1] {
			return false
		}
	}
	return true
}

func main() {
	var s, s1, s2 string
	fmt.Scanf("%s", &s)
	n := len(s)
	s1 = s[:(n-1)/2]
	s2 = s[(n+1)/2:]
	// fmt.Println(s1, s2)
	if isPalindrome(s) && isPalindrome(s1) && isPalindrome(s2) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 512
#include <algorithm>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <thread>
#include <tuple>
#include <type_traits>
#include <vector>


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

using namespace std;
using ll = long long;

#define M (1'000'000'007)

int main() {
    ios::sync_with_stdio(false);
    long long n, d;
    cin >> n >> d;
    long long x, y;

    int ans = 0;

    for (int i = 0; i < n; i++) {
        cin >> x >> y;
        if ((x * x + y * y) <= (d * d))
            ans++;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3164
#include <iostream>

using namespace std;

using ll = long long;
const int AMAX = 100000;
ll cnt[AMAX + 1];

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

	for (int i = 0; i < N; ++i) {
		int A, B;
		cin >> A >> B;
		cnt[A] += B;
	}

	for (int ans = 1; ans <= AMAX; ++ans){
		if (K <= cnt[ans]) {
			cout << ans << endl;
			break;
		}
		K -= cnt[ans];
	}
	return 0;
}

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

int main(){
    int h, m, s;
    while (1){
	cin >> h >> m >> s;
	if (h == -1 && m == -1 && s == -1) break;

	int rest = 3600*2;
	int rest2 = 3600*2;
	rest = rest - (h * 3600 + m * 60 + s);
	rest2 = rest * 3;

	printf("%02d:%02d:%02d\n", rest / 3600, (rest % 3600) / 60, rest % 60);
	printf("%02d:%02d:%02d\n", rest2 / 3600, (rest2 % 3600) / 60, rest2 % 60);
    }
}

Measured memory_bytes: 1160
import sys


a = list(map(int, input().split()))
K, A, B = a[0], a[1], a[2]

bis = 1
money = 0
sub_K = A + 2 # adを得るまでの動作回数
# 初期状態
ad = B - A
if ad <= 2 or K < sub_K - 1:
  print(1+K)
  sys.exit()

else:
  bis = B
  K -= sub_K - 1

exchange = 2 # 錬金するのに必要な回数

mult = K // exchange
bis += ad * mult

remain = K % exchange
bis += remain

print(bis)

Measured memory_bytes: 3064
#include <iostream>

int main() {
    int a, b, c, d;
    std::cin >> a >> b >> c >> d;

    if(a + b > c + d) {
        std::cout << "Left" << std::endl;
    } else if(a + b < c + d) {
        std::cout << "Right" << std::endl;
    } else {
        std::cout << "Balanced" << std::endl;
    }
}

Measured memory_bytes: 256
counter = 0
text = input()
if len(text) % 2 != 0:
    left = int(len(text)/2) + 1
    right = len(text) - int(len(text)/2)-1
else:
    left = int(len(text)/2)
    right = len(text) - int(len(text)/2)
left_p = text[:right]
right_p = text[left:]
for i in range(0, len(left_p)):
    if (left_p[i] != right_p[len(right_p)-i-1]):
        counter += 1
print(counter)


Measured memory_bytes: 3064
use std::io::{Read, Write, stdin, stdout};
use std::iter::{once, repeat};

fn solve<R: Read, W: Write>(mut input: R, mut output: W) {
    let mut s = String::new();
    input.read_to_string(&mut s).unwrap();
    let mut split = s.split_whitespace();
    // Magically inverted
    let sy: i64 = split.next().unwrap().parse().unwrap();
    let sx: i64 = split.next().unwrap().parse().unwrap();
    let ty: i64 = split.next().unwrap().parse().unwrap();
    let tx: i64 = split.next().unwrap().parse().unwrap();
    let out = repeat("U")
        .take((tx - sx) as usize)
        .chain(repeat("R").take((ty - sy) as usize))
        .chain(repeat("D").take((tx - sx) as usize))
        .chain(repeat("L").take((ty - sy) as usize))
        .chain(once("L"))
        .chain(repeat("U").take((tx - sx + 1) as usize))
        .chain(repeat("R").take((ty - sy + 1) as usize))
        .chain(once("D"))
        .chain(once("R"))
        .chain(repeat("D").take((tx - sx + 1) as usize))
        .chain(repeat("L").take((ty - sy + 1) as usize))
        .chain(once("U"))
        .collect::<String>();
    writeln!(output, "{}", out).unwrap();
}

fn main() {
    solve(stdin(), stdout());
}

#[cfg(test)]
mod tests {
    fn test(input: &str, output: &str) {
        let mut v = Vec::<u8>::new();
        ::solve(input.as_bytes(), &mut v);
        assert_eq!(String::from_utf8(v).unwrap(), output);
    }
    #[test]
    fn case1() {
        test("0 0 1 2\n", "UURDDLLUUURRDRDDDLLU\n");
    }
    #[test]
    fn case2() {
        test("-2 -2 1 1\n", "UURRURRDDDLLDLLULUUURRURRDDDLLDL\n");
    }
}

Measured memory_bytes: 508
#include <stdio.h>
#include <stdlib.h>
#define N 100

void swap(int *,int *);
void BubbleSort(int *,int);

int main(){
  int a,*number,i;
  scanf("%d",&a); 

  number = (int*)malloc(a*sizeof(int));
  for(i = 0;i < a;i++){
    scanf("%d",&number[i]);
  }
  BubbleSort(number,a);
  free(number);
  return 0;
}

void swap(int *a,int *b){
  int temp;
  
  temp = *a;
  *a = *b;
  *b = temp;
}

void BubbleSort(int *num,int a){
  int i,j,cnt=0;

  for(i = 0;i < a-1;i++){
    for(j = a-1;j > i;j--){
      if(num[j-1] > num[j]){
	swap(&num[j],&num[j-1]);
	cnt++;
      }
    }
    printf("%d ",num[i]);
  }
  printf("%d\n",num[a-1]);
  printf("%d\n",cnt); 
}

Measured memory_bytes: 600
#include <iostream>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <algorithm>
#include <iomanip>
#include <string.h>

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

typedef long long lint;

using namespace std;

int main(){
  int A[3];
  cin>>A[0]>>A[1]>>A[2];;
  sort(A,A+3);
  cout<<10*A[2]+A[1]+A[0]<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
int main() {
	
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	char N[4] = { 0 }, M;

	scanf("%c%c%c", &N[0], &N[1], &N[2]);
	for (int i = 0; i < 3; i++) {
		if (N[i] == '9') {
			printf("1");
		}
		else {
			printf("9");
		}
	}
}

Measured memory_bytes: 128
int main( void )
{
  	int x;
    scanf("%d",&x);
  	int a=360%x;
  	if(a!=0)
    {
	  for(int p=1; ; p++)
      {
        if((360*p)%x==0)
        {
        	printf("%d",(360*p)/x);
  	        return 0;
        }
      }
    }
    printf("%d",360/x);
  	return 0;
}

Measured memory_bytes: 1684
using System;
using System.Collections.Generic;
using System.Text;

namespace AtCoder
{
  class Program
  {
    static void Main(string[] args)
    {
      int N = int.Parse(Console.ReadLine());
      List<int> ns = new List<int>();
      for(int i = 0; i < N; i++)
        ns.Add(int.Parse(Console.ReadLine()));
      ns.Sort();
      int current = 200;
      int c = 0;
      for(int i = N - 1; i >= 0; i--)
      {
        if(ns[i] < current)
        {
          current = ns[i];
          c++;
        }
      }
      Console.WriteLine(c);
      Console.ReadLine();
    }

  }
}

Measured memory_bytes: 27760
#include<iostream>
#include<map>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
  int n,f;
  int num=0;
  map<string,int>mp;
  int con[1001][1001]={};
  cin >> n >> f;
  string str[1001];
  for(int i=0;i<n;i++){
    int m;
    cin >> m;
    vector<string>it(m);
    
    for(int j=0;j<m;j++){
	cin >> it[j];	
    	if(!mp[it[j]]){
	  num++;
	  mp[it[j]]=num;
	  str[num]=it[j];
	}
    }
    for(int j=0;j<m;j++){
      for(int k=m-1;k>=0;k--){
	if(j==k)continue;
	if(it[j]>it[k])continue;
	con[mp[it[j]]][mp[it[k]]]++;
      }
    }
  }
  vector< pair<string,string> > ans;
  pair<string,string>abuf;
  int anum=0;
  for(int i=1;i<=num;i++){
    for(int j=0;j<=num;j++){
      if(con[i][j]>=f){
	abuf.first=str[i];
	abuf.second=str[j];
	ans.push_back(abuf);
	anum++;
      }
    }
  }
  sort(ans.begin(),ans.end());
  cout << anum << endl;
  for(int i=0;i<anum;i++){
    cout << ans[i].first << " "<< ans[i].second<<endl;
  }
  return 0;
}

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



signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);
    
    int n;
    cin>>n;
    int a[n][n];
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cin>>a[i][j];
        }
    }
    ll mod = 1e9+7;
    ll dp[1<<n]={};
    dp[0]=1;
    for(int i=0;i<(1<<n)-1;i++){
        int cnt=0;
        for(int j=0;j<n;j++){
            if(i & (1<<j)) cnt++;
        }
        for(int j=0;j<n;j++){
            if(!(i&(1<<j)) && a[cnt][j]){
                int ret = i + (1<<j);
                dp[ret] += dp[i];
                dp[ret] %= mod;
            }
        }
    }
    cout << dp[(1<<n)-1] << endl;
}

Measured memory_bytes: 16640
#include<cstdio>
#include<cmath>
#include<vector>
#include<string>
#include<algorithm>

using namespace std;

int main()
{
	int n;
	int input, prev = -1;
	int i;

	scanf("%d", &n);

	for (i = 0; i < n; i++)
	{
		scanf("%d", &input);

		if (input > prev)
		{
			input--;
		}

		else if (input < prev)
		{
			printf("No\n");

			return 0;
		}

		prev = input;
	}

	printf("Yes\n");

	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;
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;
}
const long long INF = 1LL << 60;

//入力
int N;
long long h[100010];

//DPテーブル
long long dp[100010];

int main()
{
    int N;
    cin >> N;
    for (int i = 0; i < N; ++i)
    {
        cin >> h[i];
    }

    //初期化(最小化問題なので、INFに初期化する)
    for (int i = 0; i < 100010; ++i)
        dp[i] = INF;

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

    //ループ
    for (int i = 0; i < N; ++i)
    {
        chmin(dp[i + 1], dp[i] + abs(h[i] - h[i + 1]));
        chmin(dp[i + 2], dp[i] + abs(h[i] - h[i + 2]));
    }
    //答え
    cout << dp[N - 1] << endl;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define INF (1<<30)
#define MOD 1000000007
#define l_ength size
using ll = long long;
using namespace std;

ll bound;
int cnt = 0;

void dfs( ll n, int k ){
	if( n > 1000000000 ){
		return;
	}
	if( k == 7 && n <= bound ) ++cnt;
	dfs( n*10 + 3, k | 1 );
	dfs( n*10 + 5, k | 2 );
	dfs( n*10 + 7, k | 4 );
}

int main(){
	cin >> bound;
	dfs( 0, 0 );
	cout << cnt << endl;
	return 0;
}

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

namespace Graph_I
{
    class Breadth_First_Search
    {

        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var G = new bool[n][];

            for (int i = 0; i < n; i++)
            {
                var token = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
                var row = token[0] - 1;
                G[row] = new bool[n];
                for (int j = 0; j < token[1]; j++)
                    G[row][token[2 + j] - 1] = true;
            }

            for (int i = 0; i < n; i++)
            {
                Console.WriteLine("{0} {1}", i + 1, BreadthFirstSearch(G, i));
            }
        }

        static int BreadthFirstSearch(bool[][] graph, int destination)
        {
            var n = graph.Length;
            var done = new bool[n];
            var dist = new int[n];
            var queue = new Queue<int>();

            done[0] = true;
            dist[0] = 0;
            queue.Enqueue(0);

            while (queue.Count > 0)
            {
                var r = queue.Dequeue();
                if (r == destination) return dist[r];
                for (int i = 0; i < n; i++)
                {
                    if (graph[r][i] && !done[i])
                    {
                        done[i] = true;
                        dist[i] = dist[r] + 1;
                        queue.Enqueue(i);
                    }
                }
            }

            return -1;

        }
    }
}

Measured memory_bytes: 10640
# python 3.4.3
import sys
input = sys.stdin.readline
import numpy as np

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
N,K = map(int,input().split())
S = input().rstrip() + "x"

# 連続する0,1の数を調べる
A = []
cnt = 1
for i in range(N):
    if S[i] == S[i+1]:
        cnt += 1
    else:
        A.append(cnt)
        cnt = 1

# 両端が1だと計算が楽、端が1でない場合、[0] を加えることで「偶数番目は1」になるようにする
if S[0] != "1":
    A = [0] + A
if S[N-1] != "1":
    A = A + [0]

for i in range(len(A)-1):
    A[i+1] += A[i]

if 2*K+1 > len(A):
    print(A[-1])
else:
    si = 2*K
    ans = A[si]
    for i in range(2,len(A)-si,2):
        ans = max(ans, A[si+i]-A[i-1])
    print(ans)

Measured memory_bytes: 16456
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <iomanip>
using namespace std;
#define int long long

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

    int n; cin >> n;
    vector<int> a(n),b(n);
    for(int i = 0;i < n;i ++) cin >> a.at(i);
    for(int i = 0;i < n;i ++) cin >> b.at(i);

    int asum = 0, bsum = 0;
    for(int i = 0;i < n;i ++){
        asum += a.at(i);
        bsum += b.at(i);
    }

    if(asum < bsum){
        cout << -1 << endl;
        return 0;
    }

    vector<int> x(n);
    for(int i = 0;i < n;i ++) x.at(i) = a.at(i) - b.at(i);

    vector<int> y(n);

    sort(x.begin(),x.end());

    for(int i = 0;i < n;i ++) y.at(i) = x.at(i);


    int l = 0,r = n-1;
    
    while(x.at(l) < 0){
        int ido = min(abs(x.at(l)),x.at(r));
        x.at(l) += ido;
        x.at(r) -= ido;

        if(x.at(l) == 0) l ++;
        if(x.at(r) == 0) r --;
    }

    int ans = 0;

    for(int i = 0;i < n;i ++){
        if(x.at(i) != y.at(i)) ans ++;
    }

    cout << ans << endl;

}

Measured memory_bytes: 6304
fun main(args: Array<String>) {
    var (N, W) = pairIntLong()
    val WV = Array(N) { pairIntLong() }
    val WVs = Array(4) { mutableListOf<Long>() }
    val baseW = WV[0].first.toLong()
    WV.forEach { wv -> WVs[wv.first - WV[0].first].add(wv.second) }
    WVs.forEach {
        val w = it.sorted().toList()
        it.clear(); it.add(0L)
        for (n in w.indices.reversed()) it.add(w.subList(n, w.size).sum())
    }
    var ans = 0L
    for (n0 in (0 until WVs[0].size).reversed()) {
        val w0 = (baseW + 0) * n0
        for (n1 in (0 until WVs[1].size).reversed()) {
            val w1 = (baseW + 1) * n1
            for (n2 in (0 until WVs[2].size).reversed()) {
                val w2 = (baseW + 2) * n2
                for (n3 in (0 until WVs[3].size).reversed()) {
                    val w3 = (baseW + 3) * n3
                    if (w0 + w1 + w2 + w3 > W) continue
                    val v0 = WVs[0][n0]
                    val v1 = WVs[1][n1]
                    val v2 = WVs[2][n2]
                    val v3 = WVs[3][n3]
                    ans = Math.max(ans, v0 + v1 + v2 + v3)
                }
            }
        }
    }
    println(ans)
}
fun pairIntLong(offset: Pair<Int, Long> = Pair(0, 0L)) = listOfLong().let { Pair(it[0].toInt() + offset.first, it[1] + offset.second) }

fun next() = readLine()!!
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map(String::toInt)
fun listOfLong() = listOfString().map(String::toLong)


Measured memory_bytes: 40652
#include <bits/stdc++.h>
#define FOR(i,n) for(int i=0;i<(int)(n);i++)
#define FORR(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define pb(a) push_back(a)
#define mp(x,y) make_pair(x,y)
#define ALL(a) a.begin(),a.end()
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,-1,sizeof(a))
#define len(a) sizeof(a)
#define ll long long
#define pii pair<int,int>
#define INF 1<<29
#define MAX 
using namespace std;

int n,m,a,b,x;
vector<vector<int>> imos;

void solve(){
 scanf("%d%d",&n,&m);
 imos.resize(n+2);
 FOR(i,n+2) imos[i].assign(i+2,0);
 FOR(i,m){
  scanf("%d%d%d",&a,&b,&x);
  a--; b--;
  imos[a][b]++;
  imos[a][b+1]--;
  imos[a+x+1][b]--;
  imos[a+x+2][b+1]++;
  imos[a+x+1][b+x+2]++;
  imos[a+x+2][b+x+2]--;
 }
 FOR(i,n) FOR(j,i+1) imos[i][j+1]+=imos[i][j];
 FOR(i,n) FOR(j,i+1) imos[i+1][j]+=imos[i][j];
 FOR(i,n) FOR(j,i+1) imos[i+1][j+1]+=imos[i][j];
 int ct=0;
 FOR(i,n) FOR(j,i+1) if(imos[i][j]) ct++;
 printf("%d\n",ct);
}

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

Measured memory_bytes: 51920
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<algorithm>
using namespace std;

int main() {
  int cnt=-1;
  int A, B, C;

  cin >> A >> B >> C;

  while(B>=0){
    B = B - A;
    cnt++;
  }

  if(cnt > C){
    cnt = C;
  }

  cout << cnt << endl;

}


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

int main() {

  int N;
  int K;

  cin >> N >> K;

  int i = 0;
  int D = 0;

  // Balls
  for (i = 0 ; i < N ; i++) {
    int x;
    cin >> x;

    // Type A
    int AD = x * 2;

    // Type B
    int BD = (K - x) * 2;

    if (AD > BD) {
      D += BD;
    } else {
      D += AD;
    }
  }

  cout << D << endl;

}


Measured memory_bytes: 3500
import java.util.ArrayDeque;
import java.util.Scanner;

public class Main {


    private Scanner sc;

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

    private void solve() {
        sc = new Scanner(System.in);
        java.util.Queue<q1_3> queue = new ArrayDeque<q1_3>();
        int n = sc.nextInt();
        int q = sc.nextInt();

        for (int i = 0; i < n; i++) {
            queue.offer(new q1_3(sc.next(), sc.nextInt()));
        }
        int sum = 0;
        while (!queue.isEmpty()) {
            q1_3 now = queue.poll();
            int d = Math.min(q, now.time);
            now.time -= d;
            sum += d;
            if (now.time > 0) {
                queue.offer(now);
            } else {

                System.out.println(now.name + " " + sum);
            }
        }
    }
}

class q1_3 {
    String name;
    int time;

    public q1_3(String name, int time) {
        super();
        this.name = name;
        this.time = time;
    }

}

Measured memory_bytes: 73048
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
    int a,b,c,n,m,temp,total=0,flag=0;
    double menkan;
    string s,daan;
    cin>>n>>m;
    vector<int> all;
    for(int i = 1;i<=n;i++)
    {
        cin>>temp;
        total+=temp;
        all.push_back(temp);
    }
    menkan=total/(4.0*m);
    //cout<<menkan<<endl;
    for(int i = 0;i<n;i++)
    {
        if(all.at(i)>=menkan)
            flag++;
    }
    if(flag>=m)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
// Author: Vamsi Krishna Reddy Satti
// With love for Competitive Programming!

#include <bits/stdc++.h>
using namespace std;

#define fast_io ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define cout_precision cout.setf(ios::fixed); cout.precision(32);

using ll = int64_t; using vll = vector<ll>; using vvll = vector<vll>;
using pll = pair<ll, ll>; using vpll = vector<pll>; using vvpll = vector<vpll>;

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

const ll MOD = 998244353, N_MAX = 2e6;

ll n, m;
vll fac, inv_fac;

ll bin_exp(ll b, ll e, ll mod = MOD) {
    ll ret = 1;
    while (e > 0) {
        if (e & 1) {
            (ret *= b) %= MOD;
        }
        (b *= b) %= MOD;
        e >>= 1;
    }
    return ret;
}

void init() {
    fac.resize(N_MAX);
    fac[0] = 1;
    for (ll i = 1; i <= N_MAX; i++) {
        fac[i] = fac[i - 1] * i % MOD;
    }
    inv_fac.resize(N_MAX);
    inv_fac[N_MAX] = bin_exp(fac[N_MAX], MOD - 2);
    for (ll i = N_MAX; i >= 1; i--) {
        inv_fac[i - 1] = inv_fac[i] * i % MOD;
    }
}

ll nCr(ll n, ll r) {
    if (r > n) {
        return 0;
    }
    return fac[n] * inv_fac[n - r] % MOD * inv_fac[r] % MOD;
}

void func() {
    cin >> n >> m;
    ll ans = 0;
    for (ll i = m; i >= 0; i -= 2) {
        (ans += (nCr(n, i) * nCr((3 * m - i) / 2 + n - 1, n - 1)) % MOD) %= MOD;
    }
    ll rem = 0;
    for (ll i = 2 * m + 1; i <= 3 * m; i++) {
        (rem += nCr(3 * m - i + n - 2, n - 2)) %= MOD;
    }
    (rem *= n) %= MOD;
    (ans += MOD - rem) %= MOD;
    cout << ans << endl;
}

int main() {
    fast_io; cout_precision;
    init();
    ll t = 1; // cin >> t;
    for (ll i = 1; i <= t; i++) {
        func();
    }
}


Measured memory_bytes: 31488
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
#include<stack>
#include<cmath>
#include<iomanip>
#include<set>
#include<numeric>
#include<sstream>
#include<random>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
using pii = pair<int, int>;
const int inf = 1e9 + 7;
int dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int dx[] = {1, -1, 0, 0, -1, 1, 1, -1};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s; cin >> s;
    sort(s.begin(), s.end());
    if (s == "abc") cout << "Yes" << endl;
    else cout << "No" << endl;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

class ModTools:
    """ 階乗たくさん使う時用のテーブル準備 """

    def __init__(self, MAX, MOD):
        """ MAX：階乗に使う数値の最大以上まで作る """
        
        MAX += 1
        self.MAX = MAX
        self.MOD = MOD
        # 階乗テーブル
        factorial = [1] * MAX
        factorial[0] = factorial[1] = 1
        for i in range(2, MAX):
            factorial[i] = factorial[i-1] * i % MOD
        # 階乗の逆元テーブル
        inverse = [1] * MAX
        # powに第三引数入れると冪乗のmod付計算を高速にやってくれる
        inverse[MAX-1] = pow(factorial[MAX-1], MOD-2, MOD)
        for i in range(MAX-2, 0, -1):
            # 最後から戻っていくこのループならMAX回powするより処理が速い
            inverse[i] = inverse[i+1] * (i+1) % MOD
        self.fact = factorial
        self.inv = inverse
    
    def nCr(self, n, r):
        """ 組み合わせの数 (必要な階乗と逆元のテーブルを事前に作っておく) """

        if n < r: return 0
        # 10C7 = 10C3
        r = min(r, n-r)
        # 分子の計算
        numerator = self.fact[n]
        # 分母の計算
        denominator = self.inv[r] * self.inv[n-r] % self.MOD
        return numerator * denominator % self.MOD

    def nHr(self, n, r):
        """ 重複組み合わせ """

        # r個選ぶところにN-1個の仕切りを入れる
        return self.nCr(r+n-1, r)

N, K = MAP()

mt = ModTools(N*2, MOD)
ans = 0
for i in range(min(K+1, N)):
    ans += mt.nCr(N, i) * mt.nHr(N-i, i)
    ans %= MOD
print(ans)


Measured memory_bytes: 34676
const input = require("fs").readFileSync("/dev/stdin", "utf8")
let cin = input.split(/ |\n/), cid = 0
const next = () => cin[cid++]
const nexts = (n) => cin.slice(cid, cid+=n).map(i=>parseInt(i))

const [X, N] = nexts(2)
const p = nexts(N)

for (let i = 0; i < 100; i++) {
    if (!p.includes(X)) return console.log(X)
    if (!p.includes(X-i)) return console.log(X-i)
    if (!p.includes(X+i)) return console.log(X+i)
}


Measured memory_bytes: 29656
#include <iostream>
#include <sstream>
#include <vector>

using namespace std;

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

	int num = n;
	int dev = 0;
	for (int i = 0; i < 8; ++i) {
		dev += num % 10;
		num /= 10;
	}

	if ((n % dev) == 0) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long
#define endl "\n"
using namespace std;


int32_t main() {

    fast
    string s;
    cin >> s;
    if(s.back()=='s'){
        cout<<s+"es"<<endl;
    }
    else{
        cout<<s+"s"<<endl;
    }



    return 0;
}



Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for(int i = 0; i < int(n); i++)
#define fore(i, l, r) for(int i = int(l); i < int(r); i++)
#define pb push_back
#define deb(x) cout<<#x<<" "<<x<<endl;
#define deb2(x, y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define deb3(x, y, z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;
#define all(x) x.begin(), x.end()
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> pii;
const int mod = 1e9 + 7;
template<class T, class U> inline void add_self(T &a, U b){a += b;if (a >= mod) a -= mod;if (a < 0) a += mod;}
template<class T, class U> inline void min_self(T &x, U y) { if (y < x) x = y; }
template<class T, class U> inline void max_self(T &x, U y) { if (y > x) x = y; }

template <typename T>void print(T v, bool show_index = false){int w = 2;if(show_index){for(int i=0; i<v.size(); i++)cout<<setw(w)<<i<<" ";cout<<endl;}for(auto i= v.begin(); i!=v.end(); i++)cout<<setw(w)<<*i<<" ";cout<<endl;}
template <typename T>void print_vv(T v){if(v.size()==0) {cout<<"Empty"<<endl; return;} int w = 3;cout<<setw(w)<<" ";for(int j=0; j<v[0].size(); j++)cout<<setw(w)<<j<<" ";cout<<endl;for(auto i= 0; i<v.size(); i++){cout<<i<<" {";for(auto j = 0; j!=v[i].size(); j++){cout<<setw(w)<<v[i][j]<<",";}cout<<"},"<<endl;}cout<<endl;}
template <class T, class U> void print_m(map<T,U> m, int w=3){if(m.empty()){cout<<"Empty"<<endl; return;}for(auto x: m)cout<<"("<<x.first<<": "<<x.second<<"),"<<endl;cout<<endl;}

int main(){
    int n;
    while(cin>>n){
        vvi a(3, vi(n));
        forn(i,n)
            cin>>a[0][i]>>a[1][i]>>a[2][i];

        vvl dp(3, vl(n));
        forn(j,3)
            dp[j][0] = a[j][0];
    
        // print_vv(dp);
        
        forn(i,n-1){
            max_self(dp[0][i+1], max(dp[1][i], dp[2][i]) + a[0][i+1]);
            max_self(dp[1][i+1], max(dp[0][i], dp[2][i]) + a[1][i+1]);
            max_self(dp[2][i+1], max(dp[1][i], dp[0][i]) + a[2][i+1]);
        }
        // print_vv(dp);
        cout<<max({dp[0][n-1], dp[1][n-1], dp[2][n-1]})<<endl;
    }
    return 0;
}

Measured memory_bytes: 4600
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
#include<queue>
#include<functional>
#include<map>
#include<set>
#include<cstring>
#include<string>
#include<stack>
#include<stdlib.h>
#include<math.h>
using namespace std;
#define int long long
typedef pair<int, int> pii;
typedef pair<int, char> pic;
typedef priority_queue<pii, vector<pii>, greater<pii> > RPQ;
#define mk make_pair
#define INF (1 << 30)
#define INFL (1ll << 60ll)
#define mod 1000000007

int N;
struct edge{
    int to;
    int cost;
};
vector<edge> G[100100];
int color[100100];

void dfs(int v, int p, int c){
    color[v] = c;
    for(int i = 0; i < (int)G[v].size(); i++){
        edge to = G[v][i];
        if(to.to != p){
            if(to.cost % 2){
                dfs(to.to, v, (c + 1) % 2);
            }
            else dfs(to.to, v, c);
        }
    }
}

signed main(){
    cin >> N;
    for(int i = 0; i < N - 1; i++){
        int a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        G[a].push_back({b, c});
        G[b].push_back({a, c});
    }
    dfs(0, -1, 0);
    for(int i = 0; i < N; i++){
        printf("%lld\n", color[i]);
    }

    return 0;
}
/*



*/

Measured memory_bytes: 11776
import java.util.Scanner;

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

	void solve() {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		sc.close();

		for(int i=a;i<=a+k-1&&i<=b;i++) {
			System.out.println(i);
			if(i==a+k-1||i==b) {
				i++;
				for(int j=Math.max(i,b-k+1);j<=b;j++)System.out.println(j);
			}
		}
	}
}

Measured memory_bytes: 22868
n = int(input())
d = []
count = 0
for i in range(0,n):
	d.append(list(map(int,input().split())))

for i in range(0,n):
	d[i] = set(d[i])

for i in range(0,n-2):
	if len(d[i]) == 1 and len(d[i+1]) == 1 and len(d[i+2]) == 1:
		count = count + 1

if count == 0:
  print("No")
else:
  print("Yes")

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

int main() {
	int a,b;
	cin >>a>>b;
	if (a<b) {
		cout << "a < b" <<endl;
	} else if (a>b) {
		cout << "a > b" <<endl;
	} else {
		cout << "a == b" <<endl;
	}
}



Measured memory_bytes: 3080
//  ____            _                  _                       _       _
// |  _ \ _   _ ___| |_    ___ _ __   | |_ ___ _ __ ___  _ __ | | __ _| |_ ___
// | |_) | | | / __| __|  / __| '_ \  | __/ _ \ '_ ` _ \| '_ \| |/ _` | __/ _ \
// |  _ <| |_| \__ \ |_  | (__| |_) | | ||  __/ | | | | | |_) | | (_| | ||  __/
// |_| \_\\__,_|___/\__|  \___| .__/___\__\___|_| |_| |_| .__/|_|\__,_|\__\___|
//                            |_| |_____|               |_|

//https://github.com/manta1130/Competitive_Programming_Template_Rust

#[macro_use]
mod input {

    use std;
    use std::io;

    const SPLIT_DELIMITER: char = ' ';

    #[macro_export]
    #[allow(unused_macros)]
    macro_rules! input {
    ( $($x:expr ),*) => {
        {
            let temp_str = input_line_str();
            let mut split_result_iter = temp_str.split_whitespace();
                $(
                let buf_split_result = split_result_iter.next();
                let buf_split_result = buf_split_result.unwrap();
                    ($x) = buf_split_result.parse().unwrap();
                )*
        }
    };
}

    #[allow(dead_code)]
    pub fn input_line_str() -> String {
        let mut s = String::new();
        io::stdin().read_line(&mut s).unwrap();
        s.trim().to_string()
    }

    #[allow(dead_code)]
    pub fn p<T>(t: T)
    where
        T: std::fmt::Display,
    {
        println!("{}", t);
    }

    #[allow(dead_code)]
    pub fn input_vector2d<T>(line: usize) -> Vec<Vec<T>>
    where
        T: std::str::FromStr,
    {
        let mut v: Vec<Vec<T>> = Vec::new();

        for _ in 0..line {
            let vec_line = input_vector();
            v.push(vec_line);
        }
        v
    }

    #[allow(dead_code)]
    pub fn input_vector<T>() -> Vec<T>
    where
        T: std::str::FromStr,
    {
        let mut v: Vec<T> = Vec::new();

        let s = input_line_str();
        let split_result = s.split(SPLIT_DELIMITER);
        for z in split_result {
            let buf = match z.parse() {
                Ok(r) => r,
                Err(_) => panic!("Parse Error"),
            };
            v.push(buf);
        }
        v
    }

    #[allow(dead_code)]
    pub fn input_vector_row<T>(n: usize) -> Vec<T>
    where
        T: std::str::FromStr,
    {
        let mut v = Vec::with_capacity(n);
        for _ in 0..n {
            let buf = match input_line_str().parse() {
                Ok(r) => r,
                Err(_) => panic!("Parse Error"),
            };
            v.push(buf);
        }
        v
    }

    pub trait ToCharVec {
        fn to_charvec(&self) -> Vec<char>;
    }

    impl ToCharVec for String {
        fn to_charvec(&self) -> Vec<char> {
            self.to_string().chars().collect::<Vec<_>>()
        }
    }
}

use input::*;

fn main() {
    let mut q = input_vector::<usize>();
    q.sort();
    q.reverse();
    let k: usize;
    input!(k);
    for _ in 0..k {
        q[0] *= 2;
    }
    println!("{}", q.iter().sum::<usize>());
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define itrfor(itr,A) for(auto itr = A.begin(); itr !=A.end();itr++)
typedef long long llong;
char moji[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char moji2[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char moji3[10]={'0','1','2','3','4','5','6','7','8','9'};
#define Sort(a) sort(a.begin(),a.end());
#define Reverse(a) reverse(a.begin(),a.end());
#define print(a) cout << a << endl;
#define n_max int(1e5 +5)


int main(){
    int n;
    llong x;
    cin >> n >> x;
    int A[n_max]={};
    FOR(i,1,n+1){
        scanf("%d",&A[i]);
    }

    llong tmp;
    llong ans=0;
    FOR(i,1,n+1){
        tmp=A[i] + A[i-1];
        A[i] -= max(llong(0),(tmp-x));
        ans += max(llong(0),(tmp-x));
    }

    cout << ans << endl;
}

Measured memory_bytes: 640
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
#define Nmax 200010
#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
typedef long long ll;

int main() {
	int a[3]={};
	cin >> a[0] >> a[1] >> a[2];
	sort(a,a+3);
	int ans=a[0]+a[1];
	cout<<ans<<endl;
	
	return 0;
}

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

using namespace std;
using ll = long long;


int main()
{
    ll n; cin >> n;
    vector<ll> a(3 * n);
    for(ll i = 0; i < n * 3; i++)cin >> a[i];
    priority_queue<ll, vector<ll>, greater<ll>> front;

    ll sumf = 0, sumb = 0;
    for(ll i = 0; i < n; i++){ 
        front.push(a[i]);
        sumf += a[i];
    }
    vector<pair<ll,ll>> b;
    vector<bool> seen(n * 3);
    for(ll i = n; i < 3 * n; i++) b.emplace_back(a[i], i);
    sort(b.begin(), b.end());
    for(ll i  = 0; i < n; i++) {
        seen[b[i].second] = true;
        sumb += b[i].first;
    }

    vector<pair<ll,ll>> que;
    for(ll i = n; i < 2 * n; i++)que.push_back(b[i]);
    reverse(que.begin(), que.end());

    ll res = sumf - sumb;
    //cerr <<res << endl;
    for(ll i = n; i < 2 * n; i++) {
        //cerr << sumf << " :: " << sumb << endl;
        sumf += a[i];
        front.push(a[i]);
        sumf -= front.top();
        front.pop();
        //ここまでは正しい
        

        if(seen[i] && que.size()) {
            sumb -= a[i];
            while(que.back().second < i)que.pop_back();
            sumb += que.back().first;
            seen[que.back().second] = true;
            que.pop_back();
        }
        //cerr << sumf << " :::: " << sumb << endl;
        res = max(res, sumf - sumb);

    }
    cout << res << endl;
}

Measured memory_bytes: 10988
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication58
{
    class Program
    {
        static void Main()
        {   List<string> s = new List<string>();
            string a = "";
            while (true)
            {
                char b =(char) Console.Read();
                if (b == '\n') {
                    if (a.Length > 2 && a.Length < 7) s.Add(a);break;}
                if (b == ',' || b == '.' || b == ' ') {if( a.Length > 2 && a.Length < 7) s.Add(a); a = ""; }
                else a += b;
            }
            for(int m = 0; m < s.Count-1; m++)
            {
                Console.Write(s[m]+" ");
            }
            Console.WriteLine(s[s.Count-1]);
        }
    }
}

Measured memory_bytes: 8832
n, h=gets.split.map &:to_i
a, b=$<.map{|e|e.split.map &:to_i}.transpose

a=a.max
t=0; b=[0]+b.sort.reverse.map{|e|t+=e}

p (0..n).map{|i| x=h-b[i]; x<0 ? i : (x+a-1)/a+i}.min

Measured memory_bytes: 15604