akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>

using namespace std;

#define FOR(i, j, k, in) for (int i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for (int i=j ; i>=k ; i-=in)
#define REP(i, j) FOR(i, 0, j, 1)
#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define MP make_pair
#define PB push_back
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
const double pi=acos(-1.0);
typedef pair<int, int> PII;
typedef long int int32;
typedef unsigned long int uint32;
typedef long long int int64;
typedef unsigned long long int  uint64;


#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

#define int long long
int n, k;
int W[100000+1];
int v[100000+1];

int dp[100000+10][100];
int ant(int w, int i)
{
    if(w==0)    return 0;
    if(w<0 || i<0) return LONG_LONG_MAX;
    if(dp[w][i]!=-1)   return dp[w][i];
    dp[w][i]=0;
    //if(W[i] > w){dp[w][i]= ant(w,i-1); return dp[w][i];}
    if(ant(w-v[i], i-1)==LONG_LONG_MAX)
        dp[w][i] = ant(w, i-1);
    else
    {
        if(ant(w, i-1) == LONG_LONG_MAX)
            dp[w][i] = ant(w-v[i],i-1)+W[i];
        else
            dp[w][i]= min(ant(w-v[i],i-1)+ W[i], ant(w, i-1));
    }

    // cout << w << " " << i << " " <<dp[w][i] << "\n";
    return dp[w][i];
}

signed main()
{
    IOS
    cin >> n >> k;
    REP(i, n)
        cin >> W[i] >> v[i];
    REP(i,100010)
        REP(j,n)
        dp[i][j]=-1;
    
    int maxans = 0;

    REP(i, 100010)
    {
        ant(i, n-1);
        REP(j, n)
            if(dp[i][j] <= k && dp[i][j]>0)
                maxans = i;
    }
    cout << maxans;
    
}

Measured memory_bytes: 78464
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String sub;
		int max = -1;
		sub = s.substring(s.indexOf("A"), s.lastIndexOf("Z") + 1);
		max = sub.length();
		System.out.println(max);
	}
}


Measured memory_bytes: 27832
N, M, K = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(M)]
CD = [list(map(int, input().split())) for _ in range(K)]

root = [i for i in range(N + 1)]
size = [1] * (N + 1)
 
def find(x):
  y = root[x]
  if x == y:
    return x
  else:
    z = find(y)
    root[x] = z
    return z

def union(x, y):
  rx = find(x)
  ry = find(y)
  sx = size[rx]
  sy = size[ry]
  if rx == ry:
    return 0
  else:
    if sx >= sy:
      root[ry] = rx
      size[rx] = sx + sy
    else:
      root[rx] = ry
      size[ry] = sx + sy
    return sx * sy
    
for a, b in AB:
    union(a, b)

answer = []
for i in range(N + 1):
    answer.append(size[find(i)] - 1)

for a, b in AB:
    if find(a) == find(b):
        answer[a] -= 1
        answer[b] -= 1
for c, d in CD:
    if find(c) == find(d):
        answer[c] -= 1
        answer[d] -= 1
        
print(*answer[1:])

Measured memory_bytes: 115416
using System;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            long N = long.Parse(Console.ReadLine());

            long[] T = new long[5];

            long Min = long.MaxValue;

            for (int i = 0; i < 5; i++)
            {
                T[i] = long.Parse(Console.ReadLine());
                if(T[i] < Min)
                {
                    Min = T[i];
                }
            }

            long Total = (N - 1) / Min + 5; 

            Console.WriteLine(Total.ToString());
        }
    }
}


Measured memory_bytes: 13140
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int D = sc.nextInt();
        sc.close();

        boolean isWin = false;
        boolean isTakahashiTurn = true;
        while (true) {
            if (isTakahashiTurn) {
                C -= B;
                isTakahashiTurn = false;
            } else {
                A -= D;
                isTakahashiTurn = true;
            }
            if (A <= 0) {
                break;
            } else if (C <= 0) {
                isWin = true;
                break;
            }
        }
        if (isWin) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }

    }

}


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

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var abc = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var set = new HashSet<int>();
            set.Add(abc[0]);
            set.Add(abc[1]);
            set.Add(abc[2]);
            Console.WriteLine(set.Count);
        }
    }
}


Measured memory_bytes: 11360
import java.util.*;

public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String S = sc.next();
		int count = 0;
		char c = ' ';
		
		for(int i = 0; i < N; i++){
			char x = S.charAt(i);
			if(c != x){
				c = x;
				count++;
			}
		}
		System.out.println(count);
	}
}


Measured memory_bytes: 24148
use proconio::{input, fastout};

#[fastout]
fn main() {
    input! {
        n: i32,
        x: i32,
        t: i32,
    }

    let mut ans = n / x;
    if n % x != 0 {
        ans += 1;
    }
    ans *= t;

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


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

int main() {
	string s, t;
	cin >> s >> t;
	sort(s.begin(), s.end());
	sort(t.rbegin(), t.rend());
	if (s < t)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
n = int(input())
#a(i)とa(i+1)について、
#(1)二つとも偶数
#一つが4の倍数
#1,4,3,4,2,2,4,5
#2の個数はなんでも良いが、4でそのまとまりを挟む必要がある
#端に2をおけばあまり困らない
count4 = 0
count2 = 0
count_odd = 0
num_list = list(map(int, input().split()))
for i in num_list:
    if i % 4 == 0:
        count4 += 1
    elif i % 4 == 2:
        count2 += 1
    if i % 2 == 1:
        count_odd += 1
if count2 >= 1:
    real_count2 = 1
else:
    real_count2 = 0    
if count_odd == 0:
    print("Yes")
else:
    if count4 >= count_odd + real_count2 - 1:
        print("Yes")    
    else:
        print("No")

Measured memory_bytes: 14480
n = int(input())
ab = [input() for i in range(n)]

from collections import Counter
count = Counter(ab)

ac = count["AC"]
wa = count["WA"]
tle =count["TLE"]
re = count["RE"]

print("AC x " + str(ac))
print("WA x " + str(wa))
print("TLE x " + str(tle))
print("RE x " + str(re))

Measured memory_bytes: 16528
r, D, x_2000 = map(int, raw_input().split())
x_list = [0] * 11
x_list[0] = x_2000

def output(r, D, x):
    x_plus = r * x - D
    return x_plus

for i in range(10):
    x_list[i+1] = output(r, D, x_list[i])
    print x_list[i+1]

Measured memory_bytes: 2568
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int a[] = new int[N];

		int min = 1000000000;
		int max = 0;

		for (int i = 0; i < N; i++) {
			a[i] = sc.nextInt();

			if (a[i] < min) {
				min = a[i];
			}

			if (a[i] > max) {
				max = a[i];
			}

		}
		sc.close();

		System.out.print(max - min);

	}
}

Measured memory_bytes: 23764
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <cmath>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <deque>
#define SIZE 100005

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

char str[SIZE];

int main()
{
	scanf("%s",&str);
	int n=strlen(str);
	if(str[n-1]==str[0])
	{
		if(n%2==1) puts("Second");
		else puts("First");
	}
	else
	{
		if(n%2==1) puts("First");
		else puts("Second");
	}
	return 0;
}


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

int main(){
  int num[3],c;
  cin >> c;
  for(int j=0; j<c;j++){
    for(int i=0; i<3;i++){
    cin >> num[i];
    }

  sort(num,num+3);
  if(pow(num[0],2)+pow(num[1],2)==pow(num[2],2))
    cout << "YES" <<endl;
  else
    cout <<"NO" << endl;
  }
}

Measured memory_bytes: 1168
N=int(input())
S=list(input())
alphabets=list(str("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"))
a=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
narabikae=alphabets[N:N+26]
print("".join([narabikae[a.index(thing)] for thing in S]))

Measured memory_bytes: 3188
import java.util.Scanner;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		while(true){
			int h = scan.nextInt();
			int w = scan.nextInt();

			if(h == 0 && w == 0){
				break;
			}else{
				for(int a = 0; a < h; a++){
					for(int b = 0; b < w; b++){
						System.out.print("#");
					}
					System.out.println();
				}
				System.out.println();
			}
		}
	}
}

Measured memory_bytes: 36768
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep1(i, n) for (ll i = 1; i <= (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
#define to_s to_string
#define len(v) (int)v.size()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define print(x) cout << (x) << '\n'
#define debug(x) cout << #x << ": " << (x) << '\n'
using namespace std;
using ll = long long;
typedef pair<ll, ll> P;
ll MOD = 1e9 + 7;
ll devc(ll x, ll y) { return 1 + (x - 1) / y; }

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);

    ll N, M;
    cin >> N >> M;

    ll X = 1;
    rep(i,N) X *= 10;
    --X;

    vector<ll> s(M), c(M);

    rep(i, M) cin >> s[i] >> c[i];

    if(N == 1 && M == 0){
        print(0);
        return 0;
    }

    if(N == 1){
        bool f = true;
        rep(i, M) if(c[i] != 0) f = false;
        if(f){
            print(0);
            return 0;
        }
    }


    for (int i = X/10 + 1; i <= X; ++i){
        string XX = to_string(i);
        bool flag = true;

        rep(j, M){
            flag = flag && XX[s[j] - 1] - '0' == c[j];
        }
        if(flag){
            print(i);
            return 0;
        }
    }

    print(-1);

    return 0;
}

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

namespace AtCoderbeginner109
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            Int32.TryParse(Console.ReadLine(), out n);
            var ret = new B(n).Do();
            Console.WriteLine(ret ? "Yes" : "No");
        }
    }

     class B
    {
        private List<string> words;
        private int n;
        public B(int n)
        {
            this.n = n;
            words = new List<string>();
        }

        public bool Do()
        {
            for(int i=0;i < n; i++)
            {
                var word = Console.ReadLine();
                if (words.Contains(word))
                {
                    return false;
                }
                if(words.Any() && word[0] != words.Last().Last())
                {
                    return false;
                }
                words.Add(word);
            }

            return true;
        }
    }
}

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

using namespace std;
#define N 200200

int curr, i;
string s;
int main(){
    cin >> s;
    curr = 0;
    for (i = 0; i < s.size(); ++i) {
        curr += s[i] - '0';
    }
    if (curr % 9 == 0)
        cout << "Yes";
    else
        cout << "No";
    return 0;
}


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

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

    string S;
    cin >> S;

    int a = (S[0]-'0')*10 + (S[1]-'0');
    int b = (S[2]-'0')*10 + (S[3]-'0');

    bool ym = false;
    bool my = false;

    if (0 <= a && a <= 99 && 1 <= b && b <= 12) {
        ym = true;
    }
    if (1 <= a && a <= 12 && 0 <= b && b <= 99) {
        my = true;
    }

    string ans = "";
    if (ym && my) ans = "AMBIGUOUS";
    else if (ym && !my) ans = "YYMM";
    else if (!ym && my) ans = "MMYY";
    else ans = "NA";

    cout << ans << endl;

    return 0;
}

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

using namespace std;

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

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

  int ans = 0;
  while (true) {
    int ok = all_of(va.begin(), va.end(), [] (int a) { return a % 2 == 0; });
    if (!ok) {
      break;
    }
    
    for (auto &a : va) {
      a /= 2;
    }
    
    ans++;
  }

  cout << ans << '\n';
}

Measured memory_bytes: 3624
package main

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

const (
	initialBufSize = 100000
	maxBufSize     = 1000000
)

var sc *bufio.Scanner

func initScanner(r io.Reader) *bufio.Scanner {
	buf := make([]byte, initialBufSize)

	sc := bufio.NewScanner(r)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords) // bufio.ScanLines
	return sc
}

func main() {
	sc = initScanner(os.Stdin)
	fmt.Println(resolve(parseProblem()))
}

func parseProblem() int {
	ts := nextIntSlice(sc, 5)
	min := math.MaxInt32
	for p := range permutations(5) {
		t := 0
		for _, i := range p {
			t = (t + 9) / 10 * 10
			t += ts[i]
		}
		if min > t {
			min = t
		}
	}
	return min
}

func permutations(l int) chan []int {
	ch := make(chan []int)
	go func() {
		dfsPermutations(0, make([]bool, l), []int{}, func(perm []int) bool {
			p := make([]int, len(perm))
			copy(p, perm)
			ch <- p
			return false
		})
		close(ch)
	}()
	return ch
}

func dfsPermutations(pos int, used []bool, perm []int, atLeaf func(perm []int) (halt bool)) (halt bool) {
	l := len(used)
	if pos == l {
		if atLeaf(perm) {
			return true
		}
	}

	for i := 0; i < l; i++ {
		if used[i] {
			continue
		}
		used[i] = true
		if dfsPermutations(pos+1, used, append(perm, i), atLeaf) {
			return true
		}
		used[i] = false
	}
	return false
}

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	a, _ := strconv.Atoi(sc.Text())
	return int(a)
}

func nextString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

func nextIntSlice(sc *bufio.Scanner, n int) (a []int) {

	a = make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt(sc)
	}
	return a
}

func resolve(n int) int {
	return n
}

// snip-scan-funcs
func scanInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return int(i)
}
func scanString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}


Measured memory_bytes: 1808
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 1;
        int x = 0;
        int[] ary = new int[a];
        for (int i = 0; i < a; i++) {
        	ary[i] = sc.nextInt();
        }
        for (int i = 0; i < a; i++) {
        	x += ary[i];
        	if (x <= b) {
            	ans++;
        	}
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 21972
#include<bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define sort(v) sort(all(v))
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int main()
{
    IOS
    int t=1;
    //cin>>t;
    while(t--) 
    {
        int n;
        cin>>n;
        ll ans=0;
        for(int i=1;i<=n;i++)
        {
            if(i%3 && i%5) ans+=i;
        }
        cout<<ans;
    }
    return 0;
}

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

int A[2005];

bitset<4000005> possible;

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

    int sum = 0;
    for(int i = 0; i < N; i ++){
        scanf("%d", &A[i]);
        sum += A[i];
    }
    int halfSum = (sum+1)/ 2;

    possible[0] = 1;
    for(int i = 0; i < N; i ++){
        possible |= (possible << A[i]);
    }

    /*for(int i = 0; i <= sum; i ++){
        printf("%d", (int)possible[i]);
    }
    printf("\n");*/

    int ans3 = 0;
    for(int i = halfSum; i <= sum; i ++){
        if(possible[i]){
            printf("%d", i);
            ans3 = i;
            break;
            //return 0;
        }
    }

    return 0;
    printf("\nAns: %d\n", ans3);

    vector<int> ans;
    for(int i = 0; i < (1<<N); i ++){
        int temp = 0;
        for(int j = 0; j < N; j ++){
            if(i&(1<<j)){
                temp += A[j];
            }
        }
        ans.push_back(temp);
    }

    sort(ans.begin(), ans.end());
    /*for(int i: ans){
        printf("%d ", i);
    }
    printf("\n");*/
    printf("Correct ans: %d\n", ans[1<<(N-1)]);
    printf("%d %d %d\n", ans[(1<<(N-1))-1], ans[(1<<(N-1))], ans[(1<<(N-1))+1]);
    printf("HalfSum: %d\n", ans[(1<<N)-1]/2);
    return 0;
}


Measured memory_bytes: 1664
#include <iostream>
#include <vector>
#include <string>
#include <string.h>
#include <algorithm>
#include <cmath>

using namespace std;

int main()
{
    int n;
    cin >> n;
    string a[n];
    for (int i=0; i<n; i++) {
        cin >> a[i];
    }
    char prev = a[0][a[0].length()-1];
    for (int i=0; i<n; i++) {
        string s = a[i];
        for (int j=i+1; j<n; j++) {
            if (s == a[j]) {
                cout << "No\n";
                return 0;
            }
        }
    }
    for (int i=1; i<n; i++) {
        if (prev != a[i][0]) {
            cout << "No\n";
            return 0;
        }
        prev = a[i][a[i].length()-1];
    }
    cout << "Yes\n";
    return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T, class U> using Pa = pair<T, U>;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S;
    cin >> S;
    int N = S.size();
    if(N%2==1) cout << "No\n";
    else{
        for(int i=0;i<N;i+=2){
            if(S.substr(i,2)!="hi"){
                cout << "No\n";
                return 0;
            }
        }
        cout << "Yes\n";
    }
}

Measured memory_bytes: 256
// Problem : B - Go to Jail
// Contest : AtCoder - AtCoder Beginner Contest 179
// URL : https://atcoder.jp/contests/abc179/tasks/abc179_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#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 = 103, M = N << 1;

int n, a[N], b[N];

int main()
{
    //File("");
    n = gi <int> ();
    for (int i = 1; i <= n; i+=1) a[i] = gi <int> (), b[i] = gi <int> ();
    for (int i = 1; i < n - 1; i+=1) 
    {
    	if (a[i] == b[i] && a[i + 1] == b[i + 1] && a[i + 2] == b[i + 2])
    	{
    		puts("Yes");
    		return 0;
    	}
    }
    puts("No");
    return 0;
}

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

int main() {
  int a,b;
  string c;
  cin>>a>>b>>c;
    if(c.at(b-1)=='A'){
      c.at(b-1)='a';
    }
    else if(c.at(b-1)=='B'){
      c.at(b-1)='b';
      
    }
    else if(c.at(b-1)=='C'){
      c.at(b-1)='c';
    }
  cout <<c<<endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000

pair<int, int> small[110], big[110];
bool used[110];
int ans;
int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    
    rep(i, N) cin >> small[i].second >> small[i].first;
    rep(i, N) cin >> big[i].second >> big[i].first;
    sort(big, big + N);
    rep(i, N) {
        int x = -1;
        int p = -1;
        for(int j = 0; j < N; j++) {
            if (used[j]) continue;
            if (big[i].first <= small[j].first) continue;
            if (big[i].second <= small[j].second) continue;
            if (x < small[j].second) {
                x = small[j].second;
                p = j;
            }
        }
        if (p == -1) continue;
        ans++;
        used[p] = true;
        //cout << i << ":" << big[i].second << " " << big[i].first << "<->" << small[i].second << " " << small[i].first << endl;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
/*
 * b.cc: 
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

const int SN = 4;
const int RN = 13;

const char scs[] = {'S', 'H', 'C', 'D'};

/* typedef */

/* global variables */

bool cs[SN][RN];

/* subroutines */

/* main */

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

  for (int i = 0; i < n; i++) {
    char sc;
    int s, r;
    cin >> sc >> r;

    switch (sc) {
    case 'S': s = 0; break;
    case 'H': s = 1; break;
    case 'C': s = 2; break;
    case 'D': s = 3; break;
    }

    cs[s][r - 1] = true;
  }

  for (int s = 0; s < SN; s++)
    for (int r = 0; r < RN; r++)
      if (! cs[s][r]) printf("%c %d\n", scs[s], r + 1);
  return 0;
}

Measured memory_bytes: 1144
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
const double pi = atan(1.0) * 4.0;

int main() {
  double r;
  cin >> r;
  cout << fixed << setprecision(8);
  cout << pi * r * r << " " << 2 * pi * r << endl;
}

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

struct edge {
  int to, cost;
};

const int MAX_V = 101010;
const int INF = 1e18;

int K, V;
vector<edge> G[MAX_V];

struct Dijkstra {
  int d[MAX_V];

  void dijkstra(int s) {
    using P = pair<int, int>;
    priority_queue<P, vector<P>, greater<P>> que;
    fill(d, d + V, INF);
    d[s] = 0;
    que.push(P(0, s));

    while (!que.empty()) {
      P p = que.top();
      que.pop();
      int v = p.second;
      if (d[v] < p.first)
        continue;
      for (int i = 0; i < G[v].size(); i++) {
        edge e = G[v][i];
        if (d[e.to] > d[v] + e.cost) {
          d[e.to] = d[v] + e.cost;
          que.push(P(d[e.to], e.to));
        }
      }
    }
  }
};

signed main() {
  cin >> K;
  V = K;
  for (int i = 0; i < K; i++) {
    G[i].push_back({(i + 1) % K, 1});
  }
  for (int i = 1; i < K; i++) {
    G[i].push_back({(i * 10) % K, 0});
  }

  Dijkstra dij;
  dij.dijkstra(1);

  cout << dij.d[0] + 1LL << endl;
  return 0;
}


Measured memory_bytes: 9336
#include <stdio.h>

int check3(n){
    while(1){
        if(n % 10 == 3){
            return 1;
        }
        n /= 10;
        if(n == 0){
            return 0;
        }
    }
}

int main(){
    int n;
    scanf("%d", &n);
    for(int i = 1; i < n + 1; i++){
        if(i % 3 == 0 || check3(i)){
            printf(" %d", i);
        }
    }
    printf("\n");
    return 0;
}


Measured memory_bytes: 2140
#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <map>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()

int main() {
    vector<string> words;
    string s;
    while(cin >> s) words.push_back(s);
    string longest;
    int longestlen = 0;
    REP(i,words.size()) {
        if (words[i].size() > longestlen) {
            longest = words[i];
            longestlen = words[i].size();
        }
    }
    
    map<string, int> mp;
    string frequent;
    int frequency = 0;
    REP(i,words.size()) {
        mp[words[i]] = 0;
    }
    REP(i,words.size()) {
        mp[words[i]]++;
        if (mp[words[i]] > frequency) {
            frequent = words[i];
            frequency = mp[frequent];
        }
    }
    
    cout << frequent << " " << longest << endl;

    return 0;
}

Measured memory_bytes: 1204
#include<stdio.h>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>
#include<assert.h>
#include<set>
#include<cmath>
#include<queue>
#include<cstdlib>
#include<iostream>
#include<bitset>
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
#define rep(i,j,k) for(int i=(int)(j);i<=(int)(k);i++)
#define per(i,j,k) for(int i=(int)(j);i>=(int)(k);i--)
using namespace std;
typedef long long LL;
typedef double db;
const int inf=1e9;
namespace h{
	const int N=43*43*4;
	int head[N],np[N*20],p[N*20],flow[N*20],tot;
	int S,T;
	void init(int n){
		S=n+1;
		T=n+2;
		rep(i,1,T)head[i]=0;
		rep(i,1,tot){
			p[i]=np[i]=flow[i]=0;
		}
		tot=1;
	}
	void add(int a ,int b,int c){
		++tot;p[tot]=b;np[tot]=head[a];head[a]=tot;flow[tot]=c;
		++tot;p[tot]=a;np[tot]=head[b];head[b]=tot;flow[tot]=0;
	}
	void ax(int x,int a){
		//贡献 ax
		add(S,x,a);
	}
	void a1_x(int x,int a){
		//贡献 a(1-x)
		add(x,T,a);
	}
	void cx1_y(int x,int y,int c){
		//贡献 cx(1-y)
		add(y,x,c);
	}
	int q[N],dis[N];
	int bfs(){
		rep(i,1,T)dis[i]=-1;
		q[q[0]=1]=S;
		dis[S]=0;
		rep(i,1,q[0]){
			int x=q[i];
			for(int u=head[x];u;u=np[u])if(dis[p[u]]==-1)if(flow[u]){
				dis[p[u]]=dis[x]+1;
				q[++q[0]]=p[u];
			}
		}
		return dis[T];
	}
	int dinic(int x,int ff){
		int res=0;
		if(x==T)return ff;
		for(int u=head[x];u;u=np[u])if(dis[p[u]]==dis[x]+1)if(flow[u]){
			int ret=dinic(p[u],min(ff,flow[u]));
			flow[u]-=ret;
			flow[u^1]+=ret;
			ff-=ret;
			res+=ret;
			if(!ff)break;
		}
		if(!res)dis[x]=-1;
		return res;
	}
	int calc(){
		int ans=0;
		while(bfs()!=-1)ans+=dinic(S,1e9);
		return ans;
	}
};
const int N=45;
int n,m,ca,cb,cc;
char s[N][N];
int bh[N][N],_wh[N][N],_bv[N][N],wv[N][N];
int t;
void Main(){
	scanf("%d%d%d%d%d",&n,&m,&ca,&cb,&cc);
	rep(i,1,n)scanf("%s",s[i]+1);
	t=0;
	rep(i,1,n)rep(j,1,m){
		bh[i][j]=++t;
		wv[i][j]=++t;
		_wh[i][j]=++t;
		_bv[i][j]=++t;
	}
	h::init(t);
	//cost of paint h or v
	rep(i,1,n)rep(j,1,m){
		h::ax(bh[i][j],ca);
		h::ax(wv[i][j],ca);
		h::a1_x(_wh[i][j],ca);
		h::a1_x(_bv[i][j],ca);

		if(j+1<=m){
			h::cx1_y(bh[i][j],bh[i][j+1],cb);
			h::cx1_y(_wh[i][j+1],_wh[i][j],cb);
		}
		else{
			h::ax(bh[i][j],cb);
			h::a1_x(_wh[i][j],cb);
		}

		if(i+1<=n){
			h::cx1_y(wv[i][j],wv[i+1][j],cb);
			h::cx1_y(_bv[i+1][j],_bv[i][j],cb);
		}
		else{
			h::ax(wv[i][j],cb);
			h::a1_x(_bv[i][j],cb);
		}
	}
	//cost of paint single dot
	rep(i,1,n)rep(j,1,m){
		if(s[i][j]=='#'){
			//black
			
			//前面不能往这里涂白，只要涂白就是inf
			h::ax(wv[i][j],inf);
			h::a1_x(_wh[i][j],inf);
			//如果没被涂过，就要 c 的代价
			h::cx1_y(_bv[i][j],bh[i][j],cc);
		}
		else{
			//white

			//涂了黑且没涂白就要 c 的代价，因为同一个格子不可能被hh,vv，所以只有两种情况
			h::cx1_y(bh[i][j],wv[i][j],cc);
			h::cx1_y(_wh[i][j],_bv[i][j],cc);
			//涂了两次黑，就是inf
			h::cx1_y(bh[i][j],_bv[i][j],inf);
		}
	}
	printf("%d\n",h::calc());
}
int main(){
	int t=1;
	while(t--)Main();
	return 0;
}








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

int main() {
  int A, B, C;
  cin >> A >> B;
  
  if (A == 1){
    if (B == 2){
      C = 3;
    } else {
      C = 2;
    }
  }

  if (A == 2){
    if (B == 1){
      C = 3;
    } else {
      C = 1;
    }
  }

  if (A == 3){
    if (B == 2){
      C = 1;
    } else {
      C = 2;
    }
  }
  
  cout << C << endl;
}

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

namespace Practice
{
    class Program
    {
        static void Main(string[] args)
        {
            Solve();
        }
        private const long MOD = 1000000007;
        
        static void Solve()
        {
            var o = ReadAndParseIntArr();
            int s0 = o[0] * o[1];
            int s1 = o[2] * o[3];
            int ans = Math.Max(s0, s1);
            Console.WriteLine(ans);
        }
        #region よく使う便利関数
        private static bool isPrime(long x)
        {
            if (x == 2) { return true; }
            if (x < 2 || x % 2 == 0) { return false; }
            long i = 3;
            while (i * i <= x)
            {
                if (x % i == 0) { return false; }
                i = i + 2;
            }
            return true;
        }
        private static long lcm(long x, long y)
        {
            return x / gcd(x, y) * y;
        }
        private static long gcd(long x, long y)
        {
            return y > 0 ? gcd(y, x % y) : x;
        }
        private static long pow(long x, long n)
        {
            if (n == 0) { return 1; }
            long res = pow(x * x % MOD, n / 2);
            if (n % 2 == 1)
            {
                res = res * x % MOD;
            }
            return res;
        }
        private static int ReadAndParseInt()
        {
            return int.Parse(Console.ReadLine());
        }
        private static int[] ReadAndParseIntArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
        }
        private static long ReadAndParseLong()
        {
            return long.Parse(Console.ReadLine());
        }
        private static long[] ReadAndParseLongArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);
        }
        #endregion
    }
}

Measured memory_bytes: 13140
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF=(ll)1e18;
const ll MOD=2019;

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);
    string s;cin>>s;
    map<ll,ll>mp;
    ll x=0,pow=1;
    for(ll i=s.size()-1;i>=0;i--){
        x+=(s[i]-'0')*pow;
        pow*=10;
        x%=MOD;pow%=MOD;
        mp[x]++;
    }
    ll counter=0;
    for(auto a:mp){
        counter+=(a.second*(a.second-1))/2;
    }
    counter+=mp[0];
    cout<<counter<<"\n";
}




Measured memory_bytes: 3740
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cmath>
#include <limits.h>
 
#define YesNo(b) ((b) ? "Yes" : "No")
#define YESNO(b) ((b) ? "YES" : "NO")

using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;



int main()
{
    int N, M;
    cin >> N >> M;
    vi A(M);
    for (int i = 0; i < M; i++)
        cin >> A[i];

    int sumA = accumulate(begin(A), end(A), 0);
    int ans = (N >= sumA) ? N - sumA : -1;
    cout << ans << endl;
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
typedef  long long int ll;
typedef  long double ld;
#define sync ios_base::sync_with_stdio(false); cin.tie(NULL) 
#define input(arr,n) for(ll i1=0;i1<n;i1++ )cin>>arr[i1]
#define mod 1000000007
#define F first
#define S second 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
//recursions\
#pragma comment(linker, "/stack:200000000")
//loops\
#pragma GCC optimize("unroll-loops")
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>//s.order_of_key(val) *s.find_by_order(ind)
using namespace std;

vector<string> split(const string& s, char c) {
    vector<string> v; stringstream ss(s); string x;
    while (getline(ss, x, c)) v.push_back(x); return move(v);
}
template<typename T, typename... Args>
inline string arrStr(T arr, int n) {
    stringstream s; s << "[";
    for(int i = 0; i < n - 1; i++) s << arr[i] << ",";
    s << arr[n - 1] << "]";
    return s.str();
}
#define EVARS(args...) {__evars_begin(__LINE__); __evars(split(#args, ',').begin(), args);}
inline void __evars_begin(int line) { cerr << "#" << line << ": "; }
template<typename T> inline void __evars_out_var(vector<T> val) { cerr << arrStr(val, val.size()); }
template<typename T> inline void __evars_out_var(T* val) { cerr << arrStr(val, 10); }
template<typename T> inline void __evars_out_var(T val) { cerr << val; }
inline void __evars(vector<string>::iterator it) { cerr << endl; }
template<typename T, typename... Args>
inline void __evars(vector<string>::iterator it, T a, Args... args) {
    cerr << it->substr((*it)[0] == ' ', it->length()) << "=";
    __evars_out_var(a);
    cerr << "; ";
    __evars(++it, args...);
}
const int N = 1e6 + 5;

int main()
{
	sync;
    string s, t;
    cin >> s  >> t;
    ll ans = t.length();
    for(ll i = 0; i + t.length() - 1 < s.length(); i++)
    {
        ll cnt = 0;
        for(ll j = 0; j < t.length(); j++)
            if(s[i + j] != t[j])
                cnt++;
        ans = min(ans, cnt);
    }
    cout << ans;
}

Measured memory_bytes: 3664
#include <iostream>
#include <algorithm>
#include <bitset>
#include <math.h>
#include <string>
#include <map>
#include <vector>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define LargeNum 1000000007
typedef pair <double, double> P;

int main(){
    int N, time;
    cin >> N;
    int C[N-1], S[N-1], F[N-1];
    rep(i, N-1) cin >> C[i] >> S[i] >> F[i];
    rep(j, N){
        time = 0;
        for (int i=j; i<N-1; i++){
            if (time < S[i]) time = S[i];
            else {
                while(time % F[i] != 0) time ++;
            }
            time += C[i];
        }
        cout << time << endl;
    }
    return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var m1, m2, d1, d2 int
	fmt.Scan(&m1, &d1, &m2, &d2)

	ans := func() int {
		if d2 != 1 {
			return 0
		}

		if m1+1 == m2 {
			return 1
		}
		return 0
	}()

	fmt.Println(ans)
}


Measured memory_bytes: 512
import java.io.*;
import java.util.*;

public class Main{
  public static void main(String[] args){
    try {
      Scanner sc = new Scanner(System.in);
      int n;
      n=Integer.parseInt(sc.next());
      double[] x = new double[n];
      for(int i=0; i<n; i++){
        x[i]=Double.parseDouble(sc.next());
        String u=sc.next();
        if(u.equals("BTC")){
          x[i]=x[i]*380000;
        }
      }

      double ans=0;
      for(int i=0; i<n; i++){
        ans=ans+x[i];
      }

      System.out.println(ans);
      
      }catch (Exception e) {
      System.out.println("out");
    }
  }
}


Measured memory_bytes: 21716
function main()
    const lines=readlines()
    state=0
    input()=lines[state+=1]
    int(s::String)=parse(Int,s)
    intSub(s::SubString{String})=parse(Int,s)
    intLine(s::Array{SubString{String},1})=map(intSub,s)
    const INF=2^60
    a,b,q=input()|>split|>intLine
    s=Array{Int}(a+2)
    s[1],s[a+2]=-INF,INF
    for i in 2:a+1
        s[i]=int(input())
    end
    t=Array{Int}(b+2)
    t[1],t[b+2]=-INF,INF
    for i in 2:b+1
        t[i]=int(input())
    end
    for _ in 1:q
        x=int(input())
        m=INF
        i=searchsortedlast(s,x)
        j=searchsortedlast(t,x)
        for v in view(s,i:i+1)
            for w in view(t,j:j+1)
                m=min(m,abs(x-v)+abs(v-w),abs(x-w)+abs(w-v))
            end
        end
        println(m)
    end
end
main()

Measured memory_bytes: 176152
#include <iostream>

using namespace std;

int main(void){
    int a,b;
    char c;
    while(1){
        cin >> a >> c >> b;
        if(c == '?')break;
        else if(c == '+')cout << a+b << endl;
        else if(c == '-')cout << a-b << endl;
        else if(c == '*')cout << a*b << endl;
        else if(c == '/')cout << a/b << endl;
    }
    return 0;
}


Measured memory_bytes: 3088
A = [[0 for x in range(1)]for y in range(3)]
one_count = 0
two_count = 0
three_count = 0
four_count = 0
for i in range(3):
     A[i] = [int(x) for x in input().split()]

     if(A[i][0]==1 or A[i][1]==1):
         one_count += 1
     if(A[i][0]==2 or A[i][1]==2):
         two_count += 1
     if(A[i][0]==3 or A[i][1]==3):
         three_count += 1
     if(A[i][0]==4 or A[i][1]==4):
         four_count += 1

if(one_count >= 3 or two_count >= 3 or three_count >= 3 or four_count >= 3):
    print("NO")
else:
    print("YES")



Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Math;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            A();
        }

        static void A()
        {
            var N = ReadInt();
            var S = Read();
            foreach (var s in S)
            {
                var a = s + N;
                if (a > 90)
                    a = 64 + (a - 90);

                Print((char)(a));
            }
        }

        static List<long> ReadLines(long n)
        {
            var l = new List<long>();
            for (long i = 0; i < n; i++)
            {
                l.Add(ReadLong());
            }
            return l;
        }

        static void YESOrNO(bool e) => Println(e ? "YES" : "NO");

        static void YesOrNo(bool e) => Println(e ? "Yes" : "No");

        static IEnumerable<int> Range(int start, int stop)
        {
            if (start < 0 || stop < 0 || start > stop || (start <= 0 && stop <= 0))
                return new List<int>();

            return Enumerable.Range(start, stop - start);
        }

        static bool IsDigit(string str)
        {
            var i = 0;
            return int.TryParse(str, out i);
        }

        static int SumDigits(long num)
        {
            return num.ToString().Select(x => x.ToString()).Sum(int.Parse);
        }

        static int[] ToIntArray(string str)
        {
            return str.Select(x => x.ToString()).Select(int.Parse).ToArray();
        }

        static long Gcd(long a, long b) => b == 0 ? a : Gcd(b, a % b);
        static long Lcm(long a, long b) => a / Gcd(a, b) * b;

        static bool IsPrime(int x)
        {
            if (x <= 1 || (x != 2 && x % 2 == 0)) return false;
            if (x == 2) return true;

            for (int i = 3; i < x; i += 2)
                if (x % i == 0) return false;

            return true;
        }

        static string Read() => Console.ReadLine();
        static int ReadInt() => int.Parse(Read());
        static long ReadLong() => long.Parse(Read());

        static List<string> ReadSplit() => Read().Split().ToList();
        static List<int> ReadSplitInt() => Read().Split().Select(int.Parse).ToList();
        static List<long> ReadSplitLong() => Read().Split().Select(long.Parse).ToList();

        static void Print(object value) => Console.Write(value.ToString());
        static void Println(object value) => Console.WriteLine(value.ToString());
        static string Join<T>(IEnumerable<T> list) => string.Join("", list);
    }

    public static class MyExtensions
    {
        public static string Slice(this string str, int start = 0, int stop = 0)
        {
            if (start > str.Length || stop > str.Length || start < 0 || stop < 0)
                return "";

            if (stop == 0) stop = str.Length;
            return str.Substring(start, stop - start);
        }
    }
}



Measured memory_bytes: 11184
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll const mod = 1e9+7; 
ll n,m;
ll p[12000],ans = 0, top = 0;

ll read()
{
	ll x = 0,f = 1;
	char ch= getchar();
	while(ch<'0' || ch>'9')
	{
		if(ch == '-')
			f=-1;
		ch = getchar();
	} 
	while(ch>='0' && ch<='9')
	{
		x = (x<<1) + (x<<3) + ch-'0';
		ch = getchar();
	}
	return x*f;
}

void _prime()
{
	ll temp = m; 
	for(ll i=2;i<=sqrt(1.0*m);i++)
	{
		if(temp % i == 0)
		{
			top++;
			while(temp%i == 0)
				temp/=i,p[top]++;
		}
		if(temp == 1)
			break;
	}
	if(temp > 1)
		p[++top] = 1;
		
}

ll inv(ll x)
{return x == 1 ? 1:(mod - mod/x)*inv(mod%x)%mod;}

ll c(ll x, ll y)
{
	if(y<0 || x<y)
		return 0;
	if(y > x-y) y = x-y;
	ll zi = 1,mu = 1;
	for(ll i = 0;i < y;i++)
	{
		zi = zi*(x-i)%mod;
		mu = mu*(i+1)%mod;
	}
	return zi * inv(mu)%mod;
}

int main()
{
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	n = read() , m = read();
	_prime(); 
	ll sum =1;
	for(int i=1;i<=top;i++)
	{
		sum *=c(p[i]+n-1,n-1);
		sum %= mod;
	}
	printf("%lld", sum);
	return 0;
} 

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int arr[3], one = 0 , two = 0;
  for(auto &x : arr) { cin >> x ; if (x == 5 ) one++; if( x == 7) two++;}
  if(one == 2 and two == 1)
    cout << "YES" << endl ;
  else
    cout << "NO" << endl; 
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>
#include <cassert>
#include <functional>
#include <set>
#include <deque>
using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;
#define LNF __LONG_LONG_MAX__
const ll MOD = 1000000007;
const int MAX = 200000;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
// 法mでのaの逆元を計算
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
//最大公約数
int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }
//最小公倍数
int lcm(int x, int y) { return x / gcd(x, y) * y; }
// nが大きく,kが10^7程度の時の二項係数
long long com[200005];
void combination(long long n,long long k){
    com[0] = 1;
    for(int i=1;i<=k;i++){
        com[i] = (com[i-1]*(n-i+1)%MOD)*modinv(i,MOD)%MOD;
    }
}

int main(){
    int R; cin >> R;
    cout << 2.0*M_PI*R << endl;
    return 0;
}


Measured memory_bytes: 3792
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		String a = scan.next();
		String b = scan.next();
		String nS = a+b;
		int n = Integer.parseInt(nS);
		double nh = Math.sqrt((double)n);
		if(nh-(int)nh==0) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}

}


Measured memory_bytes: 21844
const chunks = [];
process.stdin.on("data", (chunk) => {
  chunks.push(chunk);
});
process.stdin.on("end", () => {
  const data = Buffer.concat(chunks).toString("utf8");
  const [X, Y] = data
    .trim()
    .split(" ")
    .map((s) => parseInt(s, 10));
  console.log(solve(X, Y) ? "Yes" : "No");
});

// Y min = X * 2
// Y max = X * 4
function solve(X, Y) {
  if (Y % 2 !== 0) return false;
  if (Y < 2 * X) return false;
  if (Y > 4 * X) return false;
  return true;
}


Measured memory_bytes: 29856
N = int(input())
L = list(map(int,input().split()))

ans = 0
D = {}

for i in L:
    if i in D.keys():
        D[i] += 1
    else:
        D[i] = 1

# print(D)

# judge triangle
def judge_triangle(x,y,z):
    m = max(x,y,z)
    if m < x + y + z - m:
        return True
    else:
        return False

K = list(D.keys())

if len(K) <= 2:
    print(0)
    exit(0)

for i in range(len(K)-2):
    for j in range(i+1,len(K)-1):
        for k in range(j+1,len(K)):
            if(judge_triangle(K[i],K[j],K[k])):
                ans += D[K[i]] * D[K[j]] * D[K[k]]

print(ans)

Measured memory_bytes: 9248
import java.math.BigDecimal;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        sc.close();

        BigDecimal X = BigDecimal.valueOf(x);
        for (int a = -200; a <= 200; a++) {
            BigDecimal A = BigDecimal.valueOf(a);
            BigDecimal A5 = A.pow(5);

            for (int b = -200; b <= 200; b++) {
                BigDecimal B = BigDecimal.valueOf(b);
                BigDecimal B5 = B.pow(5);
                
                if(A5.subtract(B5).equals(X)) {
                    System.out.println(String.format("%d %d\n", a, b));
                    return;
                }
            }
        }
    }
}


Measured memory_bytes: 55896
S = input().strip()

def check(S):
	if len(S) % 2 == 0:
		for i in range(0, len(S), 2):
			if S[i] != "h" or S[i + 1] != "i":
				return False
		return True
	else:
		return False

print("Yes" if check(S) else "No")



Measured memory_bytes: 2940
#include<stdio.h>
int main()
{
  int a,b,i,j;
  while(1)
	   {
  scanf("%d%d",&a,&b);
  if(a==0&&b==0){break;}

  for(i=1;i<=a;i++)
    {
      for(j=1;j<=b;j++)
	{
	  if(j%2==1)
	    {
	      if(i%2==1)printf("#");
	      else printf(".");
	    }
	  else 
	    {
              if(i%2==1)printf(".");
	      else printf("#");
	    }
	}
      printf("\n");
    }
  printf("\n");
    
	   }
  return 0;
}



Measured memory_bytes: 2060
#include<cstdio>
using namespace std;
int a,b;
int main(){
    scanf("%d%d",&a,&b);
    if(a>0)puts("Positive");              
    else if(b>=0)puts("Zero");          
    else if((a&1)^(b&1))puts("Positive");  
    else puts("Negative");
    return 0;
}

Measured memory_bytes: 128
using System;

namespace ITP1_6_B
{
    class Program
    {
        static void Main()
        {
            int x = int.Parse(Console.ReadLine());
            bool [,] y = new bool[4,13];
            //boolでtrueとfalseに分けて、falseの時に出力させる
            
            string[] s = {"S", "H", "C", "D"};
            
            for (int i = 0; i < x; i++)
            {
                string[] S = Console.ReadLine().Split(' ');
                for (int j = 0; j < 4; j++)
                {
                    if (S[0] == s[j])
                    {
                        int k = int.Parse(S[1]) - 1; //bool型では初期値はfalseになるからあえて1を引く
                        y[j ,k] = true; 
                        break;
                    }
                }
            }
            
            for (int l = 0; l < 4; l ++)
            {
                for (int m = 0; m < 13; m ++)
                {
                    if (y[l, m] == false)
                    {
                        Console.WriteLine(s[l] + " " + (m + 1));
                    }
                }
            }
        }
    }
}


Measured memory_bytes: 15932
#include<iostream>
using namespace std;
int main(){
    int A,B,c,d;
    double k;
    cin>>A>>B;
    k=(A-B)/2;
    if(k<0){
        k=-k;
        d=k+A;
    }
    else
        d=A-k;
    c=A-B;
    if(c%2==0)
        cout<<d;
    else
        cout<<"IMPOSSIBLE";
    return 0;
}

Measured memory_bytes: 256
use std::io::prelude::*;
use std::io::stdin;
use std::str::FromStr;
use std::collections::HashMap;

fn main() {
    let n: usize = read();
    let mut map = HashMap::new();
    for _ in 0..n {
        *map.entry(read::<i64>()).or_insert(0) +=1;
    }
    println!("{}", map.iter().filter(|&(_,v)| v % 2 == 1).count());
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|b| b.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}


Measured memory_bytes: 12540
n = int(input())
a = [int(input()) for i in range(n)]
b = a[0]
c = 1
d = set()
while b != 2:
    b = a[b - 1]
    if b in d:
        print(-1)
        break
    else:
        d.add(b)
        c += 1
else:
    print(c)

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

int main(){
	double a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		double y=(a*f-d*c)/(a*e-d*b);
		double x=(c-b*y)/a;
		
		cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;
	}
	return 0;
}

Measured memory_bytes: 3272