akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include <math.h>

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



int ASCttenannoryaku(const void *a,const void *b) {
	return *(int *)a - *(int *)b;
}
int main(void)
{
	int n, num[] = { 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 
		1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51 };
	scanf("%d",&n);
	printf("%d",num[n-1]);

	return 0;
}


Measured memory_bytes: 128
import java.util.*;

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

        int x_i = x_2000;
        for (int i=1; i<11; i++) {
            x_i = r*x_i - D;
            System.out.println(x_i);
        }
    }
}


Measured memory_bytes: 21716
//header{{{
#include<bits/stdc++.h>
  
using namespace std;
 
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define Fixed fixed << setprecision(12)
#define int int64_t
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod = 1e9+7; 
constexpr int MOD = 998244353;

template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

template <class T> using min_heap = priority_queue<T,vector<T>,greater<T> >;
template <class T> using max_heap = priority_queue<T>;
template <class A, class B> using umap = unordered_map<A,B>;
  
int gcd(int a,int b){ return b ? gcd(b,a % b) : a;}
int lcm(int a,int b){ return a / gcd(a,b) * b;}

constexpr int dx[] = {1,0,-1,0,1,1,-1,-1};
constexpr int dy[] = {0,-1,0,1,1,-1,-1,1};
//}}}

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

    string s,t;
    cin >> s >> t;

    int n = s.size(),m = t.size();
    char z = 'z'+1;
    string minv;
    minv += z;

    for(int i = 0;i <= n - m;++i){
        int ng = false;
        rep(j,m){
            if(s[i+j] != '?' && s[i+j] != t[j]){
                ng = true;
            }
        }
        if(ng) continue;
        string tmp;
        rep(j,n){
            if(j < i || j >= m + i){
                if(s[j] == '?'){
                    tmp += "a";
                }else{
                    tmp += s[j];
                }
            }else{
                tmp += t[j-i];
            }
        }
        chmin(minv,tmp);
    }

    if(minv == "{") cout << "UNRESTORABLE\n";
    else cout << minv << '\n';

    return 0;
}

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

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  
  if (a + b == c + d)
    cout << "Balanced" << endl;
  else if (a + b < c + d)
    cout << "Right" << endl;
  else
    cout << "Left" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

int main()
{
	ll x; cin >> x;
	ll ans = ((x + 10) / 11) * 2;
	if (x % 11 <= 6 && x % 11 != 0) ans--;
	cout << ans << endl;
}

Measured memory_bytes: 256
#define MYDEBUG
/*
 * C.cpp
 *
 *  Created on: 2017/08/09
 *      Author: jln
 */

#include <bits/stdc++.h>
#ifdef MYDEBUG
#define dbp(x) cout<<#x<<": "<<x<<endl
#define dbp2(x,y) cout<<#x<<","<<#y<<": "<<x<<","<<y<<endl
#define dbp3(x,y,z) cout<<#x<<","<<#y<<","<<#z<<": "<<x<<","<<y<<","<<z<<endl
#define dbp4(w,x,y,z) cout<<#w<<","<<#x<<","<<#y<<","<<#z<<": "<<w<<","<<x<<","<<y<<","<<z<<endl
#define ifcin(x) std::ifstream cin(x)
#else
#define dbp(x)
#define dbp2(x,y)
#define dbp3(x,y,z)
#define dbp4(w,x,y,z)
#define ifcin(x)
#endif
#define ll long long
#define all(x) x.begin(), x.end()
#define rep(i, from, to) for(int i=from; i<to; ++i)
#define REP(i, from, to) for(int i=from; i<=to; ++i)
using namespace std;
template<typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
	out << "[";
	size_t last = v.size() - 1;
	for (size_t i = 0; i < v.size(); ++i) {
		out << v[i];
		if (i != last) {
			out << ",";
		}
	}
	out << "]";
	return out;
}
template<typename T>
ostream& operator<<(ostream& out, const vector<vector<T> >& v) {
	out << endl;
	for (size_t i = 0; i < v.size(); ++i) {
		out << v[i] << endl;
	}
	return out;
}
template<typename T1, typename T2>
ostream& operator<<(ostream& out, const pair<T1, T2>& p) {
	out << "{" << p.first << "," << p.second << "}";
	return out;
}
struct edge {
	int from, to, cost;
	edge(int f, int t, int c) {
		from = f;
		to = t;
		cost = c;
	}
	edge() {
		from = -1;
		to = -1;
		cost = -1;
	}
	bool operator<(const edge& e) const {
		return cost < e.cost;
	}
};
struct vertex {
	int id, val1, val2;
	vertex(int id_, int val1_, int val2_) {
		id = id_;
		val1 = val1_;
		val2 = val2_;
	}
	vertex() {
		id = 0;
		val1 = val2 = 0;
	}
};
ostream& operator<<(ostream& out, const edge& e) {
	out << "(";
	out << e.from << "->" << e.to << ": ";
	out << e.cost;
	out << ")";
	return out;
}
ostream& operator<<(ostream& out, const vertex& v) {
	out << "<";
	out << v.id << ": ";
	out << v.val1 << ", "; //なにかの要素，値
	out << v.val2; //なにかの要素，値
	out << ">";
	return out;
}
typedef struct edge edge;
typedef struct vertex vertex;
static const int MAX_V = 200010;
vector<int> G[MAX_V];
int n, m;

bool dfs(int now, int rest) {
	if (rest == 0) {
		return now == n;
	}
	rep(i,0,(int)G[now].size())
	{
		if (dfs(G[now][i], rest - 1)) {
			return true;
		}
	}
	return false;
}

void solve() {
	scanf("%d %d", &n, &m);
	rep(i,0,m)
	{
		int a, b;
		scanf("%d %d", &a, &b);
		G[a].push_back(b);
		G[b].push_back(a);
	}
	cout << (dfs(1, 2) ? "POSSIBLE" : "IMPOSSIBLE") << endl;
}
int main() {
	solve();
}


Measured memory_bytes: 12016
import sys, math, itertools, collections, heapq
sys.setrecursionlimit(10 ** 7)
pinf = float("inf")
ninf = -float("inf")
n, m = map(int, input().split())
edge = [[] for _ in range(n)]
for _ in range(m):
    a, b = map(int, input().split())
    edge[a - 1].append(b - 1)
    edge[b - 1].append(a - 1)
ans = "IMPOSSIBLE"
n -= 1
for e in edge[0]:
    if n in edge[e]:
        ans = "POSSIBLE"
print(ans)


Measured memory_bytes: 38648
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const animals = parseInt(arg[0].split(" ")[0]);
    const legs = parseInt(arg[0].split(" ")[1]);
    
    if(legs / 2 === animals) {
        console.log("Yes");
        return;
    }
    
    if(legs / 4 === animals) {
        console.log("Yes");
        return;
    }
    
    for(let i=0; i<animals; i++) {
        const tsuru = i;
        const kame = animals - i;
        
        if((tsuru * 2) + (kame * 4) === legs) {
            console.log("Yes");
            return;
        }
    }
    
    console.log("No");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

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

public class Main {

    public static void main(String[] args) {
        int num = GetInput.getInt();
        long count = 0;
        for (int i = 1; i <= num; i++){
            for (int j =1 ; j <= num; j++){
                for (int k = 1; k <= num; k++){
                    count += gcd(i, gcd(j, k));
                }
            }
        }
        System.out.println(count);
    }

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


class GetInput {
    static BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));

    static char[] getCharArray() {
        char[] charArray;
        try {
            StringBuilder string = getInputString();
            charArray = new char[string.length()];
            for (int i = 0; i < string.length(); i++) {
                charArray[i] = string.charAt(i);
            }
            return charArray;
        } catch (Exception e) {
            e.printStackTrace();
        }
        charArray = new char[0];
        return charArray;
    }

    static int[] getArrayInt() {
        String[] string;
        int[] array;
        try {
            string = bufferedReader.readLine().split("\\s+");
            array = new int[string.length];
            for (int i = 0; i < string.length; i++) {
                array[i] = Integer.parseInt(string[i]);
            }
            return array;
        } catch (IOException e) {
            e.printStackTrace();
        }

        int[] arra = new int[2];
        return arra;
    }

    static int getInt() {
        try {
            String string = bufferedReader.readLine();
            return Integer.parseInt(string);
        } catch (IOException e) {
            e.printStackTrace();
        }

        return 0;
    }

    static StringBuilder getInputString() {
        try {
            StringBuilder string = new StringBuilder();
            string.append(bufferedReader.readLine());
            return string;
        } catch (IOException e) {
            e.printStackTrace();
        }
        return new StringBuilder();
    }

    static long getLongInput() {
        try {
            String string = bufferedReader.readLine();
            return Long.parseLong(string);
        } catch (IOException e) {
            e.printStackTrace();
        }

        return 0;
    }

    static long[] getLongArrayInput() {
        String[] string;
        long[] array;
        try {
            string = bufferedReader.readLine().split("\\s+");
            array = new long[string.length];
            for (int i = 0; i < string.length; i++) {
                array[i] = Long.parseLong(string[i]);
            }
            return array;
        } catch (IOException e) {
            e.printStackTrace();
        }

        long[] arra = new long[2];
        return arra;
    }
}


Measured memory_bytes: 32648
#include <bits/stdc++.h>
#define DEBUG fprintf(stderr, "Passing [%s] line %d\n", __FUNCTION__, __LINE__)
#define File(x) freopen(x".in","r",stdin); freopen(x".out","w",stdout)

using namespace std;

typedef long long LL;
typedef pair <int, int> PII;
typedef pair <int, PII> PIII;

template <typename T>
inline T gi()
{
	T f = 1, x = 0; char c = getchar();
	while (c < '0' || c > '9') {if (c == '-') f = -1; c = getchar();}
	while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return f * x;
}

const int INF = 0x3f3f3f3f, N = 100003, M = N << 2;

char s[N];
int cnt;

int main()
{
	//File("");
	scanf("%s", s + 1);
	int n = strlen(s + 1);
	for (int i = 2; i <= n; i+=1) if (s[i] != s[i - 1]) ++cnt;
	printf("%d\n", cnt);
	return 0;
}


Measured memory_bytes: 3868
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List<Integer> heights = new ArrayList<>();

        for (int i = 0; i < 10; i++) {
            heights.add(Integer.parseInt(sc.next()));
        }

        Collections.sort(heights, (o1, o2) -> {
            if (o1 > o2) {
                return -1;
            }
            if (o1 < o2) {
                return 1;
            }
            return 0;
        });

        for (int i = 0; i < 3; i++) {
            System.out.println(heights.get(i));
        }
    }
}

Measured memory_bytes: 31864
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  // int a, b; -> つまり、intで計算した(a + b)/2は自動的にintになる！(doubleだとうまくいった）
  double a, b, x_double, x_dec;
  int x_int, x;
  cin >> a >> b;
  
  x_double = (a + b) / 2;
  x_int = x_double;
  x_dec = x_double - x_int;
  x = x_double + x_dec;
  
  cout << x << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
        #include<string.h>
         
        int main(void)
        {
           char a[11], b[11], c[11];
         
           scanf("%s%s%s" , a, b, c);
           if ((a[strlen(a) - 1] == b[0])&&(b[strlen(b) - 1] == c[0])) printf ("YES\n");
           else printf ("NO\n");
           return 0;
        }

Measured memory_bytes: 128
// ~/Remember,remember the 6th of March

#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
const double PI = acos(-1.0);
const double  EPS = 1e-9;
const ll MOD = 1e9 + 7;
using namespace std;
int main()
{
    int n,c=0;
    cin>>n;
    vector<int>arr(n+1),ans(n+1);
    for(int i=1; i<=n; i++)
        cin>>arr[i];
    for(int i=n; i>0; i--)
    {
        int cnt=0;
        for(int j=i; j<=n; j+=i)
            cnt+=ans[j];
        if(cnt%2!=arr[i])
            ans[i]=1,c++;
    }
    cout<<c<<endl;
    for(int i=1; i<=n&&c>0; i++)
        if(ans[i])
            cout<<i<<" ";
    return 0;
}


Measured memory_bytes: 2432
#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>
#include <iomanip>
typedef long long int ll;
typedef long double ld;
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
const ll MOD=1000000007;
const ll MAX_N=500010;
const ll INF=999999999999;

int main(){
    int a,b,c,d,e;
    cin>>a>>b>>c>>d>>e;
    int ans=(c-a)*60+d-b-e;
    cout<<ans<<endl;
}

Measured memory_bytes: 3604
package main

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

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)

	N := scanInt()
	p := make([]int, N+1)
	for i := 1; i <= N; i++ {
		p[i] = scanInt()
	}

	ans := 0
	for i := 1; i < N; i++ {
		if p[i] == i {
			ans++
			p[i], p[i+1] = p[i+1], p[i]
		}
	}
	if p[N] == N {
		ans++
	}

	fmt.Println(ans)
}


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

int main() {
  int a, b, c, n;

  cin >> n;
  while(n-- > 0) {
    cin >> a >> b >> c;

    int array[3] = { a, b, c };
    sort(array, array+3);

    if(array[0]*array[0] + array[1]*array[1] == array[2]*array[2]) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }

  }
  return 0;
}

Measured memory_bytes: 1168
#include <stdio.h>

int main(void){
 int n,i,top = 0,innum = 0,top1,count = 0,innum1 = 0;
  
  scanf("%d",&n);
  
  for(i = 1;i <= n;i++){
    innum = i;
    count = 0;
   while(innum != 0){
     innum1 = innum % 2;
     innum = innum / 2;
     if(innum1 == 0){
      count++;
     }else{
      break;
     }
   }
     if(top <= count){
       top = count;
      top1 = i;
    }
  }
  
  printf("%d\n",top1);
  return 0;
}

Measured memory_bytes: 128
package main

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

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func ceil(a, b int) int {
	if a%b == 0 {
		return a / b
	} else {
		return a/b + 1
	}
}

// Sort
type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

// Main
func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	N, M := sc.nextInt(), sc.nextInt()

	if N == M {
		fmt.Fprintln(wtr, "Yes")
	} else {
		fmt.Fprintln(wtr, "No")
	}
	wtr.Flush()
}


Measured memory_bytes: 640
fun main(args : Array<String>) {
    val n = readLine()!!.toInt()
    val aa = readLine()!!.split(" ").map { it.toInt() }
    val bb = readLine()!!.split(" ").map { it.toInt() }
    val diff = mutableListOf<Diff>()

    for (i in 0 until n) {
        diff.add(Diff(i, (aa[i]-bb[i]).toLong()))
    }

    var ans = diff.count { it.diff < 0L }

    if (ans == 0) {
        println(0)
        return
    }

    var negSum = diff.fold(0L) { acc, diff ->
        if (diff.diff < 0L) acc + diff.diff else acc
    }

    val pos = diff.filter { it.diff > 0 }.sortedByDescending { it.diff }

    for (i in pos.indices) {
        ans++
        negSum += pos[i].diff
        if (negSum >= 0) {
            println(ans)
            return
        }
    }

    println(-1)
}

data class Diff(val idx: Int, val diff: Long)

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

int main() {
  int a[5];
  for(int i=0;i<5;i++) cin >>a[i];
  int r[5];
  for(int i=0;i<5;i++) r[i]=(a[i]-1)%10+1;

  //cout<<r[0]<<endl;
  for(int i=0;i<5;i++) a[i]-=r[i];
  sort(r,r+5);
  int ans=50;
  for(int i=0;i<5;i++) ans+= a[i];
  cout<<ans-(10-r[0])<<endl;
  }


Measured memory_bytes: 256
#include <stdio.h>
#define REP(i, n) for(i = 0; i < n; ++i)
#define FOR(i, a, b) for(i = a; i < b; ++i)

void yes_or_no(char boolean){
    if(boolean){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
}

int main(){
    int N, Y;
    scanf("%d %d", &N, &Y);
    Y /= 1000;
    int m = Y - N;
    int l; int ansl = 100000;
    if(10 * N < Y){
        printf("-1 -1 -1\n");
    }else{
        for(l = -m - 1; l <= m + 1; l++){
            int x = 4 * l + m, y = -9 * l - 2 * m;
            if(N - x - y >= 0 && x >= 0 && y >= 0){
                ansl = l;
                break;
            }
        }
        int x = 4 * ansl + m, y = -9 * ansl - 2 * m;
        if(ansl != 100000){
            printf("%d %d %d\n", x, y, N - x - y);
        }else{
            printf("-1 -1 -1\n");
        }
    }
    return 0;
}

/*
x + y + z = N
10x + 5y + z = Y
x, y, z >= 0
なる整数の組(x, y, z)があるかという問題.
9x + 4y = Y - N =: m を考えよう.
9x + 4y = 1の解として, (x, y) = (1, -2)があるから, 解空間は
x = 4k + 1 y = -9k - 2
よって, x = m(4k + 1), y = m(-9k -2). l := mkとおけばこれが整数であればよくて,
x = 4l + m, y = -9l - 2m (lは整数).
*/

Measured memory_bytes: 128
import Data.Array.ST (STUArray, runSTUArray, newArray, writeArray, getBounds)
import Data.Array.Unboxed
import Data.Ix (range)
import Control.Monad.ST (ST,runST)
import Control.Monad
import Control.Applicative

type PosXY = (Int,Int)
type Board = UArray PosXY Char
type STBoard s = ST s (STUArray s PosXY Char)

readDigits = map read <$> words <$> getLine :: IO [Int]
readDigits' = map read <$> lines <$> getContents :: IO [Int]

mkCheckBoard :: Int -> Int -> Board
mkCheckBoard w h =
    runSTUArray $ do
        box <- newArray ((1,1),(w,h)) '.' :: STBoard s
        rng <- range <$> getBounds box
        forM_ rng $ \idx@(y,x) -> do
            let c = if even (y+x) then '#' else '.'
            writeArray box idx c
        return box

main :: IO ()
main =
    loop
    where
    loop = do
        [h,w] <- readDigits
        unless (h == 0 && w == 0) $ do
            let box = mkCheckBoard w h
            let ((sx,sy), (ex,ey)) = bounds box
            putStrLn $ unlines [[box!(x,y) | x<-[sx..ex]] | y<-[sy..ey]]
            loop

Measured memory_bytes: 5140
#include <iostream>
using namespace std;
int main()
{
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	while (1)
	{
		c -= b;
		if (c <= 0)
		{
			cout << "Yes\n";
			break;
		}
		a -= d;
		if (a <= 0)
		{
			cout << "No\n";
			break;
		}
	}
}

Measured memory_bytes: 3132
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ for(auto it : P) { s << "<" << it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ for(auto it : P) { s << "<" << it.first << "->" << it.second << "> "; } return s << endl; }



string S;
long long solve() {
    int N = S.size();
    vector<long long> val(2020, 0);
    long long fac = 1;
    long long cur = 0;
    val[cur]++;
    for (int i = 0; i < N; ++i) {
        long long add = S[N-1-i] - '0';
        cur = (cur + fac * add) % 2019;
        fac = (fac * 10) % 2019;
        val[cur]++;
    }

    //COUT(val);

    long long res = 0;
    for (int i = 0; i < val.size(); ++i) {
        res += val[i] * (val[i] - 1) / 2;
    }
    return res;
}

int main() {
    while (cin >> S) {
        cout << solve() << endl;
    }
}









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

using namespace std;

int64_t convert_base4_to_int64(vector<int64_t> const& a) {
	int64_t i, k, sum = 0;

	for (i = a.size() - 1; i >= 0; i--) {
		sum *= 10;

		if (a[i] == 0) {
			k = 0;
		}

		if (a[i] == 1) {
			k = 3;
		}

		if (a[i] == 2) {
			k = 5;
		}

		if (a[i] == 3) {
			k = 7;
		}

		sum += k;
	}

	return sum;
}

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

	int64_t i, target, value, count = 0;
	cin >> target;

	//
	//  a は 4進数の bit を格納するvector(15桁)
	//  x は 4進数の bit の数を数えるためのvector 
	//  reset は純粋に x を reset するための 0埋め済み vector
	//
	const int size = 15;
	vector<int64_t> a(size, 0), x(4, 0), reset(4, 0);
	a[0] = 1;   //  まずは4進数の1から始める 

	while (true) {
		value = convert_base4_to_int64(a);  // 4進数 を10進数に変換

		if (value <= target) {
			//  4進数のbit(= 3, 5, 7)の数を数える
			x = reset;
			for (i = 0; i < size; i++) {
				x[a[i]]++;
			}

			//  3, 5, 7 がひとつ以上存在した場合
			if (x[1] > 0 && x[2] > 0 && x[3] > 0) {

				//  bit が0でなくなる箇所を調べる
				for (i = size - 1; i >= 0; i--) {
					if (a[i] != 0) {
						break;
					}
				}
				//  0 の bit が存在していてはいけない
				for (; i >= 0; i--) {
					if (a[i] == 0) {
						goto NEXT;   // ハズレ
					}
				}

				count++;
			}

		} else {
			break;  // おしまい
		}

	NEXT:
		// 4進数のvectorをインクリメントし、
		// 必要に応じて桁上げ
		a[0]++;
		for (i = 0; i < size; i++) {
			if (a[i] == 4) {
				a[i] = 0;
				a[i + 1]++;
			}
		}
	}
	
	cout << count << endl;

	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define Rep(i,n) for(int i=0;i<n;i++)
#define For(i,n1,n2) for(int i=n1;i<n2;i++)
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define put(a) cout<<a<<endl;
#define all(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define TDARRAY(int,a,n,m) vector<vector<int>> a(n,vector<int>(m,0));
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

int n;

int main() {
    cin >> n;
    vector<double> p(n);
    REP(i,n){
        cin >> p[i];
    }
    TDARRAY(double, dp, n+1, n+1);
    dp[0][0]=(double)1;
    REP(i,n){
        REP(j,n){
            dp[i+1][j+1]+=dp[i][j]*p[i];
            dp[i+1][j]  +=dp[i][j]*(1-p[i]);
        }
    }
    double res = 0;
    FOR(j,n/2+1,n+1){
        res+=dp[n][j];
    }
    cout << setprecision(10) << res << endl;
    return 0;
}




Measured memory_bytes: 70784
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {

     static Scanner scanner;

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

         int N=gi();
         long[] a=new long[N];
         boolean[] f=new boolean[1000001];
         for (int i=0; i<N;i++) {
        	 a[i]=gl();
         }
         Arrays.parallelSort(a);

         String ans="not coprime";
         long gcd=uclid(a[0], a[1]);
         for (int i=2; i<N;i++) {
        	 if(gcd==1) break;
        	 gcd=uclid(gcd, a[i]);
         }
         if(gcd==1) {
        	 ans="setwise coprime ";
         } else {
        	 System.out.println(ans);
        	 return;
         }

         for (int i=0; i<N;i++) {
        	 List<Long> l=yaku(a[i]);
        	 for (int j=0; j<l.size();j++) {
        		 long v=l.get(j);
        		 if(f[(int)v] && v!=1) {
        			 System.out.println(ans);
        			 return;
        		 } else {
        			 f[(int)v]=true;
        		 }
        	 }
         }


         System.out.println("pairwise coprime");

     }

  // 素因数分解
     public static List<Long> yaku(long n) {
         List<Long> l=new ArrayList<Long>();
         for(long i=1; i*i<=n;i++) {
        	 if(n%i==0) {
        		 l.add(i);
        		 if(i!=n/i) l.add(n/i);
        	 }
         }
          return l;
      }

     // ユークリッドの互除法
     public static long uclid(long m, long n) {
         if (m<n) {
             m^=n;
             n^=m;
             m^=n;
         }

         while(true) {
             long t=m%n;
             if (t==0) {
                 return n;
             } else {
                 m=n;
                 n=t;
             }
         }
     }
     // 文字列として入力を取得
     public static String gs() {
          return scanner.next();
     }

     // intとして入力を取得
     public static int gi() {
          return Integer.parseInt(scanner.next());
     }

     // longとして入力を取得
     public static long gl() {
          return Long.parseLong(scanner.next());
     }

     // doubleとして入力を取得
     public static double gd() {
          return Double.parseDouble(scanner.next());
     }
}

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

bool check(ll n)
{
    ll cnt = 0;
    while(n)
    {
        n /= 10;
        cnt++;
    }
    if(cnt%2)   return true;
    return false;
}

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

    ll cnt = 0;
    for(ll i=1;i<=n;i++)
    {
        if(check(i))    cnt++;
    }
    cout<<cnt;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
 
int main(){
	ll N, M, a, b;
	cin >> N >> M;
	vector<int> check(200005, -1);
	
	for(int i=0; i<M; i++){
		cin >> a >> b;
		
		if(a==1){
			if(check[b]==1){
				cout << "POSSIBLE" << endl;
				return 0;
			}
			check[b]=1;
		}
		
		if(b==N){
			if(check[a]==1){
				cout << "POSSIBLE" << endl;
				return 0;
			}
			check[a]=1;
		}
	}
	
	cout << "IMPOSSIBLE" << endl;
	return 0;
	
}

Measured memory_bytes: 1024
/*
 * wafuIroha.cpp
 *
 *  Created on: 2020/02/23
 *      Author: black
 */
#include <iostream>
using namespace std;

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

	if (x < 1200){
		cout << "ABC" << endl;
	}
	else{
		cout << "ARC" << endl;
	}

	return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] str = br.readLine().split(" ");
		int x=Integer.parseInt(str[0]);
		int y=Integer.parseInt(str[1]);
		System.out.println(x*y + " " + (2*x+2*y));
	}
}

Measured memory_bytes: 24180
#include <stdio.h>
int main(void){
	int i,j,H,W;
	while(1){
		scanf("%d %d",&H,&W);
		if(H==0 && W==0){
			break;
		}
		for(i=1;i<=H;i++){
			for(j=1;j<=W;j++){
				printf("#");
			}
			puts("");
		}
		puts("");
	}
	return 0;
}

Measured memory_bytes: 588
#include "bits/stdc++.h"

#define ll          long long
#define pb          push_back
#define pii         pair<ll int,ll int>
#define vpii        vector< pii >
#define vi          vector<ll int>
#define vs			vector< string >
#define vvi         vector< vector< ll > >
#define inf			1'010'000'000'000'000'017LL
#define all(it,a)   for(auto it=(a).begin();it!=(a).end();it++) 
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define repr(i,a,b) for(ll int i=a;i>b;i--)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define mp          make_pair
#define whatis(x)   cout << #x << " is " << x << "\n";
#define graph(n)    adj(n,vector< ll > () )

using namespace std;


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


void Main()
{
	int N, K;
	cin >> N >> K;
	vi H(N + 10, 0);
	for (size_t i = 0; i < N; i++)
	{
		cin >> H[i];
	}
	vi dp(N + 10, inf);
	dp[0] = 0;

	for (size_t i = 0; i < N; i++)
	{
		for (size_t h = 1; h <= K; h++)
		{
			chmin(dp[i + h], dp[i] + abs(H[i] - H[i + h]));
		}
	}

	cout << dp[N - 1] << endl;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);

	Main();
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define arep(i,x,n) for(int i=int(x);i<(int)(n);i++)
#define rep(i,n) for(long long i = 0;i < n;++i)
#define rrep(i,n) for(int i=int(n);i>0;i--)
#define fs first
#define sc second
#define all(x) (x).begin(), (x).end()
#define pi 3.141592653589793
#define eps 0.00000001
#define INF 1e9+5  
using ll = long long; 
using P=pair<int,int>;
using lP=pair<ll,ll>;
using fP=pair<double,double>;
using PPI=pair<P,int>;
//ll const mod=998244353;
ll const mod=1e9+7;
const ll MAX=1000005;
using vi=vector<int>;
using vl=vector<ll>;
using vc=vector<char>;
using vd=vector<double>;
using vs=vector<string>;
using vp=vector<P>;
using vb=vector<bool>;
using vvi =vector<vector<int>>;
using vvl =vector<vector<ll>>;
using vvd=vector<vector<double>>;
using vvc=vector<vector<char>>;
using vvp =vector<vector<P>>;
using vvb=vector<vector<bool>>;
template <typename T>
bool chmax(T &a, const T b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T b){if(a > b){a = b; return true;} return false;}


//////////////////////////////////////

vi f(int n){
    int keta=0;
    int tmp=n;
    int t=2;

    vi cnt(20);
    rep(i,20){
        int a=(n+1)/t;
        cnt[i]+=a;
        if(n%t>=t/2){
            cnt[i]+=(n%t-t/2);
        }
        cnt[i]%=2;
        t*=2;
    }
    return cnt;
}

int main(){
    int n;
    cin>>n;
    vi a(n);
    rep(i,n)cin>>a[i];
    int ori=0;

    rep(i,n)ori^=a[i];
    vi ans;
    rep(i,n){
        int res=ori^a[i];
        ans.push_back(res);
    }
    rep(i,n)cout<<ans[i]<<endl;
    return 0;
}

Measured memory_bytes: 5100
#include <iostream>

using namespace std;

int main()
{
	long a, b;
	long r, gcm, tmp;
	cin >> a >> b;
	gcm = b;
	r = a % b;
	
	while (r != 0) {
		tmp = r;
		r = gcm % r;
		gcm = tmp;
	}

	cout << a*b / gcm;
	return 0;
}

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

typedef vector<int> vi;
typedef vector<bool> vb;
typedef pair<int,int> pii;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<bool> > vvb;
typedef map<int, bool> mib;

typedef long long ll;
typedef vector<long long> vl;
typedef pair<long long,long long> pll;
typedef vector<pair<long long,long long> > vpll;

typedef vector<string> vs;

typedef long double ld;

#define _GLIBCXX_DEBUG

#define REP(i,n) for (int i = 0; i < (n); ++i)
#define REPD(i,n) for (int i = (n-1); i >= 0; --i)
#define FORE(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORED(i, s, n) for (int i = (s); i >= (int)(n); i--)
#define debug(x) cerr << #x << ": " << x << '\n'
#define debug2(x, y) cerr << #x << ": " << x << ", " << #y << ": " << y << '\n'
#define debug3(x, y, z) cerr << #x << ": " << x << ", " << #y << ": " << y << ", " << #z << ": " << z << '\n'
#define debugs(s) cerr << s << "\n"
#define hyphen() cerr << "--\n"

#define ALL(vec) (vec).begin(), (vec).end()
#define REVALL(vec) (vec).rbegin(), (vec).rend()

static const int dy[4] = {0,1,0,-1}, dx[4] = {1,0,-1,0};

#define fst first
#define snd second
#define pb push_back
#define mk(x,y) make_pair((x),(y))

// http://ehafib.hatenablog.com/entry/2015/12/23/164137
int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a;a=1ll*a*a;}while(b>>=1);return ans;}
int qpm(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
// gcd : O(logN)
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a, int b) { return a / gcd(a, b) * b; }

#define sz(v) int(v.size())

// x1, x2ライブラリとの被りを避ける
#define x1 x192837465
#define x2 x123456789
#define y1 y192837465
#define y2 y123456789

// typo
#define itn int
#define reutrn return
#define reutnr return
#define srting string

#define make(type, x) type x; cin>>x;
#define make2(type, x, y) type x, y; cin>>x>>y;
#define make3(type, x, y, z) type x, y, z; cin>>x>>y>>z;
#define make4(type, x, y, z, t) type x, y, z, t; cin>>x>>y>>z>>t;

int ctoi(const char c){
    if('0' <= c && c <= '9') return (c-'0');
    return -1;
}

#define uniq(v) (v).erase(unique(ALL((v))), (v).end());

// area of (0, 0)(a, b)(c, d)
double area(double a, double b, double c, double d){
    return abs(a * d - b * c) / 2.0;
}

const int PREC = 10;
#define coutf(val) cout << fixed << setprecision(PREC) << (val) << endl;

const int MOD = (int)1e9 + 7;
const int INF = numeric_limits<int>::max();

string sweep(const string S) {
    // STの組を一掃する
    int scnt = 0;
    int tcnt = 0;

    string ans = "";

    for(auto c : S) {
        if (c == 'S') {
            scnt++;
        } else {
            // c == 'T'

            // Sが残っている場合は消費
            if (scnt > 0) {
                scnt--;
            } else {
                // 消し尽くしている場合はansに追加
                ans += 'T';
            }
        }
    }

    // 残っているscntを清算
    ans += string(scnt, 'S');

    return ans;
}

signed main() {
    make(string, S);

    debug(S);
    S = sweep(S);
    debug(S);

    int ans = S.size();
    cout << ans << endl;
}


Measured memory_bytes: 4144
#include<stdio.h>
int main(void){
  int n;
  scanf("%d", &n);
  int i, j;
  int sum=0;
  for( i=0; i<30; i++){
    for( j=0; j<30; j++){
      if(n==i*4+j*7){
        puts("Yes");
        return 0;
      }
    }
  }
  puts("No");
  return 0;
}

Measured memory_bytes: 256
use std::io;
use std::io::Read;

#[macro_export]
macro_rules! input {
  ($s:expr=>$($t:tt)*) => {
    let mut lines=$s.split("\n");
    $(
        line_parse!(lines,$t);
    )*
  };
}

macro_rules! line_parse {
  ($lines:expr,($($name:ident:$t:tt)*)) => {
    let mut line=$lines.next().unwrap().split_whitespace();
    $(value_def!(line,$name,$t);)*
  };

  //複数行
  ($lines:expr,{$n:expr;$name:ident:$t:tt}) => {
    values_def!($lines,$n,$name,$t);
  };
}

macro_rules! value_def {
    ($line:expr, $name:ident, $t:tt) => {
        let $name = value!($line, $t);
    };
}

macro_rules! values_def {
    ($lines:expr, $n:expr, $name:ident, $t:tt) => {
        let $name = {
            let mut vec = Vec::new();
            for i in 0..$n {
                let mut next = $lines.next().unwrap().split_whitespace();
                vec.push(value!(next, $t));
            }
            vec
        };
    };
}

macro_rules! value {
  //配列
  ($line:expr,[$t:tt]) => {
    $line.map(|x|{
      let mut iter=::std::iter::once(x);
      value!(iter,$t)
    }).collect::<Vec<_>>()
  };
  //タプル
  ($line:expr,($($t:tt),*)) => {
    ($(value!($line,$t),)*)
  };
  //文字列
  ($line:expr,#) => {
    $line.next().unwrap()
  };
  //インデックス(-1)
  ($line:expr,@) => {
    $line.next().unwrap().parse::<usize>().unwrap()-1
  };
  //単一値
  ($line:expr,$t:ty) => {
    $line.next().unwrap().parse::<$t>().unwrap()
  };
}

fn main() {
    let text = {
        let mut s = String::new();
        io::stdin().read_to_string(&mut s).unwrap();
        s
    };
    input!(text =>
        (a:u64 b:u64 k:u64)
    );
    let a_end = if a > k { a - k } else { 0 };
    let b_end = if a > k {
        b
    } else if a + b > k {
        b + a - k
    } else {
        0
    };
    println!("{} {}", a_end, b_end);
}


Measured memory_bytes: 4352
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

int main()
{
    string S;
    cin >> S;
    if (S[0] != 'A')
    {
        cout << "WA" << endl;
        return 0;
    }

    int cnt = 0;
    for (int i = 1; i < S.length(); ++i)
    {
        if (i >= 2 && i < S.length() - 1)
        {
            if (S[i] == 'C')
            {
                ++cnt;
                if (cnt > 1)
                {
                    break;
                }
            }
            else
            {
                if (S[i] >= 'A' && S[i] <= 'Z')
                {
                    cout << "WA" << endl;
                    return 0;
                }
            }
        }
        else
        {
            if (S[i] >= 'A' && S[i] <= 'Z')
            {
                cout << "WA" << endl;
                return 0;
            }
        }
    }
    if (cnt != 1)
    {
        cout << "WA" << endl;
        return 0;
    }
    cout << "AC" << endl;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

#define N 100000

int main(){

  int input_m[N], serch_m[50000], m, n, i, j, Le, Mi, Ri, c=0, f;

  scanf("%d", &n);

  for( i = 0; i < n; i++)scanf("%d", &input_m[i]);

  scanf("%d",&m);

  for( i = 0; i < m; i++)scanf("%d", &serch_m[i]);

  for( j = 0; j < m; j++){
    f = 0;
    Le = 0;
    Ri = n;
    while(Le < Ri){
      Mi = (Le + Ri) / 2;

      if( input_m[Mi] == serch_m[j]){
	c++;
	break;
      }

      if ( input_m[Mi] < serch_m[j]){
	Le = Mi + 1;
      }

      else if( input_m[Mi] > serch_m[j]){
	Ri = Mi;
      }
    }
  }

  printf("%d\n", c);

return 0;
    }

Measured memory_bytes: 1184
#include <bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define ll long long
#define mp make_pair
using namespace std;
int main(){
	string s;
	cin>>s;
	ll n=s.size();
	ll ans = n;
	for(int i=0;i<n-1;i++){
		if( s[i] != s[i+1]){
			ll tmp = max((ll)i+1, n-i-1);
			if(ans>tmp)ans=tmp;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int x, a, b;
  cin >> x >> a >> b;
  if (a >= b)
    cout << "delicious" << endl;
  else if (b - a <= x)
    cout << "safe" << endl;
  else
    cout << "dangerous" << endl;
}


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

void output(string S, bitset<3> op){
   rep(i,3){
      cout << S.at(i);
      if(op.test(i)) cout << '+';
      else cout << '-';
   }
   cout << S.at(3) << "=7" << endl;
}

int main() {
   string S;
   cin >> S;

   rep(i,1<<3) {
      bitset<3> op(i);
      int ans = S.at(0) - '0';
      rep(j,3) {
         if(op.test(j)) ans += S.at(j+1)-'0';
         else ans -= S.at(j+1)-'0';
      }
      if(ans == 7) {
         output(S,op);
         return 0;
      }
   }


   cout << "Wrong code! NO ANSWER is founded." << endl;
   return 0;
}

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

int main(){
  int N, M;
  cin >> N >> M;
  vector<P> v;
  int a, b;
  for(int i = 0; i < M; i++){
    cin >> a >> b;
    v.push_back(P(b, a));
  }
  sort(v.begin(), v.end());
  int ans = 0;
  int last = 0;
  for(int i = 0; i < M; i++){
    if(v[i].second >  last){
      ans++;
      last = v[i].first -1;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1400
#include <bits/stdc++.h>
#include<unordered_map>
#define _CRT_SECURE_NO_WARNINGS
#define ll long long
#define BUF 50
using namespace std;
ll MOD = 1e9 + 7;
ll A, B, C, D, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
ll ans = 0;

int main() {
	cin >> N;
	cout << (N < 1000 ? "ABC" : "ABD");
}


Measured memory_bytes: 256
#include <stdio.h>

typedef long long ll;

ll max(ll a, ll b){
	if(a>b){return a;}
	else{return b;}
}

int main(){

	ll X,Y;

	scanf("%lld %lld",&X,&Y);

	if(max(X-Y,Y-X)<=1ll){
	printf("Brown\n");
	}
	else{
	printf("Alice\n");
	}

	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  if(s[2]==s[3] && s[4]==s[5])
  {
    cout<<"Yes"<<endl;
    return 0;
  }
  cout<<"No"<<endl;
  return 0;
}

Measured memory_bytes: 256
N=int(input())
S=[]
for i in range(0,N):
    S.append(input())
namedata=[0,0,0,0,0]
for i in range(0,N):
    if S[i][0]=='M':
        namedata[0]+=1
    elif S[i][0]=='A':
        namedata[1]+=1
    elif S[i][0]=='R':
        namedata[2]+=1
    elif S[i][0]=='C':
        namedata[3]+=1
    elif S[i][0]=='H':
        namedata[4]+=1
ans=0
for i in range(0,3):
    for j in range(i+1,4):
        for k in range(j+1,5):
            ans+=namedata[i]*namedata[j]*namedata[k]
print(ans)

Measured memory_bytes: 9776
r = []
s = []
t = 0
for i in range(1,7):
    if i <= 4:
        a = int(input())
        r.append(a)
    else:
        b = int(input())
        s.append(b)
l = min(r)
L = min(s)
r.remove(l)
s.remove(L)
for j in range(3):
    t += r[j]
t += s[0]
print(t)


Measured memory_bytes: 5600
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <sstream>
#include <string>
#include <map>
#include <set>
using namespace std;

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


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

	int ans = 0;
	int mx_cnt = 0;
	for (int i = 1; i <= N; i++) {
		int cnt = 0;
		bool flg = true;
		int num = i;
		while (num%2==0) {
			cnt++;
			num /= 2;
		}
		if (cnt>=mx_cnt) {
			mx_cnt = cnt;
			ans = i;
		}
	}
	cout << ans << endl;
}

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

int main(){
  long int n;
  cin >> n;
  vector<long long int> h(n),a(n);
  rep(i,n){
    cin >> h[i];
  }
  int min = h[n-1];
  for(int i = n-1; i > 0; i--){
    if(min > h[i]){
      min = h[i];
    }
    if(h[i-1] > h[i]){
      h[i-1]--;
      if(h[i-1] > h[i] or h[i-1] > min){
        cout << "No";
        return 0;
      }
    }
  }
  cout << "Yes";
  return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
#include <string>
#include <sstream>
#include <iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
 
#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif


double deg2rad(int deg){
	return M_PI * deg / 180;
}

int main(int argc, char **argv){
	int d = 0;
	int a = 0;
	char tmp = 0;
	double x = 0;
	double y = 0;
	int theta = 90;

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
#endif

	for(;;){
#if INPUT_FROM_FILE
		ifs >> d >> tmp >> a;
#else
		std::cin >> d >> tmp >> a;
#endif
		if(d == 0 && a == 0) { break; }

		x += d * cos(deg2rad(theta));
		y += d * sin(deg2rad(theta));

		theta -= a;
	}
	std::cout << int(x) << std::endl;
	std::cout << int(y) << std::endl;
	return 0;
}


Measured memory_bytes: 3296
class dice:
    def __init__(self, li = [0] * 6):
        self.men = [0] + li
    def move0(self, a, b, c, d):
        self.men[a], self.men[b], self.men[c], self.men[d] = self.men[b], self.men[c], self.men[d], self.men[a]
    def move(self, h):
        if h == "N":
            self.move0(1, 2, 6, 5)
        elif h == "S":
            self.move0(1, 5, 6, 2)
        elif h == "W":
            self.move0(1, 3, 6, 4)
        elif h == "E":
            self.move0(1, 4, 6, 3)
        elif h == "O":
            self.men[1], self.men[6], self.men[2], self.men[5] = self.men[6], self.men[1], self.men[5], self.men[2]
        elif h == "L":
            self.move0(2, 3, 5, 4)
        elif h == "R":
            self.move0(2, 4, 5, 3)
        elif h == "B":
            self.men[3], self.men[4], self.men[2], self.men[5] = self.men[4], self.men[3], self.men[5], self.men[2]
        else:
            print("▲err")
    def move2(self, a, b):
        if self.men[1] != a:
            for i, s in [(2, "N"), (3, "W"), (4, "E"), (5, "S"), (6, "O")]:
                if self.men[i] == a:
                    self.move(s)
                    break
        if self.men[2] != b:
            if b == self.men[3]:
                self.move("L")
            elif b == self.men[4]:
                self.move("R")
            else:
                self.move("B")
n = int(input())
cnt = 0
ans = set()
for _ in range(n):
    li = list(map(int, input().split()))
    SET = set()
    for i in range(6):
        saikoro3 = dice(li)
        if i:
            saikoro3.move("_SWENO"[i])
        SET.add(tuple(saikoro3.men))
        for _ in range(3):
            saikoro3.move("L")
            SET.add(tuple(saikoro3.men))
    ans |= SET
    cnt += len(SET)
print("Yes" if len(ans) == cnt else "No")



Measured memory_bytes: 5976
#pragma warning(disable:4996)
//#define _CRT_NONSTDC_NO_WARNINGS
#include <bits/stdc++.h>

 
using namespace std;
typedef long long ll;
typedef long double ld;
                        
#define all(x)   (x).begin(), (x).end()           /*sorting STL */
#define fastio	 ios_base::sync_with_stdio(0);  cin.tie(nullptr);  cout.tie(nullptr)
 
#define TRIPmin(a, b, c) 	min(a, min(b, c))
#define TRIPmax(a, b, c)    max(a, max(b, c))
#define fillchar(a,x) 		memset(a, x, sizeof (a))
 
const ll maxn = 2*1e6;
int main() {
    ll n, demw = 0, ans = 0;
    char c[maxn];
    cin >> n;
    for(ll i = 1; i <= n; i++) {
        cin >> c[i];
        if(c[i] == 'W') demw++;
    }
    if(demw == n || demw == 0) {
        cout << 0;
        return 0;
    }
    ll j = n;
    for(ll i = 1; i <= n-demw; i++) {
        if(c[i] == 'W') {
            while(j > n-demw) {
                if(c[j] == 'R') {
                    swap(c[i], c[j]);
                    break;
                }
                j--;
            }
            ans++;
        }
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 3748
#include<cstdio>
#include<vector>

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

using namespace std;

typedef	vector<int>	vi;

int main(){
	const int Ne=30100;
	static bool er[Ne+1]; er[0]=er[1]=true;
	for(int i=2;i*i<=Ne;i++) if(!er[i]) for(int j=i*i;j<=Ne;j+=i) er[j]=true;
	vi p; rep(i,Ne+1) if(!er[i]) p.pb(i);

	for(int len;scanf("%d",&len),len;){
		int cnt=0;
		rep(j,p.size())rep(i,j+1){
			// a <= b <= c
			int a=p[i],b=p[j],c=len-a-b;
			if(c<a+b && b<=c && !er[c])	cnt++;
		}
		printf("%d\n",cnt);
	}

	return 0;
}

Measured memory_bytes: 872
#include <iostream>
using namespace std;
int main() {
    string x, y;
    cin >> x >> y;
    int a, b;
    a = stoi(x, nullptr, 16);
    b = stoi(y, nullptr, 16);
    if(a>b) cout << ">" << endl;
    else if(a<b) cout << "<" << endl;
    else cout << "=" << endl;
    return 0;
}

Measured memory_bytes: 384
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#define printjudge(cond) {if(cond) printf("Yes\n"); else printf("No\n");}
#define printans(ans) {printf("%d\n", (ans));}
typedef int* intarray;
typedef char* chararray;

int main(){
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    printf("%d %d %d %d\n", x2-(y2-y1), y2+(x2-x1), x1-(y2-y1), y1+(x2-x1));
    return 0;
}

Measured memory_bytes: 128