akhauriyash/Code-Regression huggingface dataset:
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.Set;
public class Main {
	public static void main(String[] args){
		Main main = new Main();
		main.solveB();
	}

	private void solveA() {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		if (a - b == b - c) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

	private void solveB() {
		Scanner sc = new Scanner(System.in);
		String o = sc.nextLine();
		String e = sc.nextLine();
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < e.length(); i++) {
			sb.append(o.charAt(i));
			sb.append(e.charAt(i));
		}
		if (o.length() != e.length()) {
			sb.append(o.charAt(o.length() - 1));
		}
		System.out.println(sb.toString());
	}
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pll = pair<ll, ll>;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define Rep(i, m, n) for(ll i = m; i < n; i++)
#define all(vec) vec.begin(), vec.end()
#define tmax(x, y, z) max((x), max((y), (z)))
#define tmin(x, y, z) min((x), min((y), (z)))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define ZERO(a) memset(a, 0, sizeof(a))
const ll INF = 1LL << 60;
const ll MM = 1000000000; const ll MOD = MM + 7; const ll MMM=9223372036854775807;//2^63 -1
#define ADD(a,b) a = (a + ll(b)) % MOD
#define MUL(a,b) a = (a * ll(b)) % MOD
ll GCD(ll x, ll y){ if(y == 0) return x; else return GCD(y, x % y);}
ll LCM(ll x, ll y){ return x / GCD(x, y) * y;}
template<class T> inline bool chmin(T& a, T b){ if(a > b){ a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b){ if(a < b){ a = b; return true;} return false;}
template<typename A, size_t N, typename T> void FILL(A (&array)[N], const T &val){ fill( (T*)array, (T*)(array+N), val );}
using Graph = vector<vector<ll>>;
ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
ll ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1}, ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//cout << fixed << setprecision(10);


int main(){
    ll n, x, t; cin >> n >> x >> t;
    cout << t * ((n+x-1)/x) << endl;
}


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

using namespace std;

int main() {
    string s1, s2;
    cin >> s1;
    sort(s1.begin(), s1.end());
    
    cin >> s2;
    sort(s2.begin(), s2.end());
    reverse(s2.begin(), s2.end());

    cout << ((s1 < s2) ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
n, m = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]
x.sort()

s = 0
for a, b in x:
  if m > b:
    s += a * b
    m += -b
  else:
    s += a * m
    break

print(s)

Measured memory_bytes: 27524
from collections import deque
n,m=map(int,input().split())
graph=[[] for i in range(3*n)]
for i in range(m):
    s,e=map(int,input().split())
    graph[s-1].append(e+n-1)
    graph[s+n-1].append(e+2*n-1)
    graph[s+2*n-1].append(e-1)
s,t=map(int,input().split())
s-=1;t-=1
queue=deque([s])
length=0
dist=[-1]*(3*n)
dist[s]=0
while queue:
    v=queue.popleft()
    for i in graph[v]:
        if dist[i]!=-1:continue
        dist[i]=dist[v]+1
        queue.append(i)
print(dist[t]//3)


Measured memory_bytes: 60148
import java.util.*;

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

	    while(true){
		c++;
		int n = sc.nextInt();
		if(n==0) break;
		double a[][] = new double[n][2];
		for(int i=0 ;i<n ;i++){
		    a[i][0] = sc.nextDouble(); //x
		    a[i][1] = sc.nextDouble(); //y
		}
		double s = 0;
		for(int i=0;i<n-1;i++){
		    //    s += ((a[i][0]-a[i+1][0])*(a[i][1]+a[i+1][1]))/2;
		    s += (a[i][0]*a[i+1][1]-a[i][1]*a[i+1][0])/2;
		}
		s += (a[n-1][0]*a[0][1]-a[n-1][1]*a[0][0])/2;
	
		if(s<0){
		    s*=-1;
		}
		//System.out.print("%d %.1f",c,s);
		System.out.println(c+" "+s);
	    }
    }
}

Measured memory_bytes: 12000
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
	"strings"
	"unsafe"
)

var (
	sc scanner
)

func main() {
	x, y, z := sc.nextInt(), sc.nextInt(), sc.nextInt()
	x, y = y, x
	x, z = z, x
	fmt.Printf("%d %d %d\n", x, y, z)
}

/* template functions */

func init() {
	sc = scanner{
		buf: make([]string, 0, 10000),
		cur: 0,
		r:   bufio.NewReader(os.Stdin),
	}
}

type scanner struct {
	buf []string
	cur int
	r   *bufio.Reader
}

func (s *scanner) readln() {
	rbuf := make([]byte, 0, 100)
	for {
		line, prefix, err := s.r.ReadLine()
		if err != nil {
			panic(err)
		}
		rbuf = append(rbuf, line...)
		if prefix == false {
			break
		}
	}
	s.cur = 0
	s.buf = strings.Split(*(*string)(unsafe.Pointer(&rbuf)), " ")
}

func (s *scanner) isFull() bool {
	if s.cur == len(s.buf) {
		return true
	}
	return false
}

func (s *scanner) resetCur() {
	s.cur = 0
}

func (s *scanner) next() string {
	if s.cur == 0 {
		s.readln()
	}
	res := s.buf[s.cur]
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}

func (s *scanner) nexts() []string {
	s.readln()
	s.resetCur()
	return s.buf
}

func (s *scanner) nextByte() byte {
	if s.cur == 0 {
		s.readln()
	}
	res := s.buf[s.cur][0]
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}

func (s *scanner) nextInt() int {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.Atoi(s.buf[s.cur])
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}

func (s *scanner) nextInts() []int {
	s.readln()
	res := make([]int, len(s.buf))
	for i, _ := range s.buf {
		res[i], _ = strconv.Atoi(s.buf[i])
	}
	s.resetCur()
	return res
}

func (s *scanner) nextFloat() float64 {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.ParseFloat(s.buf[s.cur], 64)
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}

func (s *scanner) nextFloats() []float64 {
	s.readln()
	res := make([]float64, len(s.buf))
	for i, _ := range s.buf {
		res[i], _ = strconv.ParseFloat(s.buf[i], 64)
	}
	s.resetCur()
	return res
}

func max(x, y int) int {
	return int(math.Max(float64(x), float64(y)))
}

func min(x, y int) int {
	return int(math.Min(float64(x), float64(y)))
}

func abs(x int) int {
	return int(math.Abs(float64(x)))
}

// Searchable
// idx := lower_bound([]int{-199, -1, 0, 2, 4, 67, 100, 8435}, 60)
// => idx = 5
//
// No present
// idx := lower_bound([]int{-199, -1, 0, 2, 4, 67, 100, 8435}, 10000)
// => idx = 8

func lower_bound(a []int, x int) int {
	return sort.SearchInts(a, x)
}

func dump(value ...interface{}) {
	for _, v := range value {
		fmt.Fprintf(os.Stderr, "%#v\n", v)
	}
}

func yes() {
	fmt.Println("Yes")
}

func no() {
	fmt.Println("No")
}


Measured memory_bytes: 640
c=[[0,0]]*6
for i in range(6):
    a,b=sorted(map(int,input().split()))
    c[i]=[a,b]
c.sort()
for i in range(0,6,2):
    if c[i]!=c[i+1]:print('no');break
else:print(['no','yes'][c[0][0]==c[2][0] and c[0][1]==c[4][0] and c[2][1]==c[4][1]])

Measured memory_bytes: 7708
import kotlin.system.exitProcess
import java.util.*

fun main(args:Array<String>) {
    val (a, b) = readLine()!!.split(" ").map(String::toDouble)
    for (x in 1..1300) {
        if (Math.floor(x * 0.08) == a && Math.floor(x * 0.1) == b) {
            println(x)
            exitProcess(0)
        }
    }
    println(-1)
}

Measured memory_bytes: 37804
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        long n = Long.parseLong(sc.next());
        sc.close();

        // 主処理
        int result = 0;
        if (n != 1) {
            List<Long> list = primeFactorization(n);
            Map<Long, Integer> map = new HashMap<>();
            for (int i = 0; i < list.size(); i++) {
                long num = list.get(i);
                if (map.containsKey(num)) {
                    map.put(num, map.get(num) + 1);
                } else {
                    map.put(num, 1);
                }
            }

            int[] count = new int[40];
            for (int i = 1; i < count.length; i++) {
                count[i] = count[i - 1] + i;
            }

            for (Long key : map.keySet()) {
                int val = map.get(key);
                for (int i = 0; i < count.length; i++) {
                    if (val < count[i]) {
                        result += i - 1;
                        break;
                    }
                }
            }
        }

        // 出力
        System.out.println(result);

    }

    public static List<Long> primeFactorization(long num) {
        List<Long> list = new ArrayList<>();
        Deque<Integer> pq = new ArrayDeque<>(primeList(1000003));
        long div = pq.pollLast();
        while (!isPrime(num)) {
            if (num % div == 0) {
                num /= div;
                list.add(div);
            } else {
                div = pq.poll();
            }
        }
        list.add(num);
        return list;
    }

    public static boolean isPrime(long num) {
        if (num == 2) {
            return true;
        } else if (num < 2 || num % 2 == 0) {
            return false;
        }
        double sqrtNum = Math.sqrt(num);
        for (long i = 3; i <= sqrtNum; i += 2) {
            if (num % i == 0) {
                return false;
            }
        }
        return true;
    }

    static List<Integer> primeList(int n) {
        List<Integer> list = new ArrayList<>();
        boolean[] prime = new boolean[n + 1];
        Arrays.fill(prime, true);
        prime[0] = false;
        prime[1] = false;
        for (int i = 2; i < Math.sqrt(n); i++) {
            if (!prime[i])
                continue;
            for (int j = 2; i * j <= n; j++) {
                prime[i * j] = false;
            }
        }
        for (int i = 0; i < prime.length; i++) {
            if (prime[i])
                list.add(i);
        }
        return list;
    }
}


Measured memory_bytes: 40448
import java.util.*;

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

		int n = sc.nextInt();
		int k = sc.nextInt();

		long[][] l = new long[n][2];
		for (int i = 0; i < n; i++) {
			int t = sc.nextInt();
			long d = sc.nextLong();
			l[i] = new long[]{d, t};
		}

		Arrays.sort(l, Comparator.comparing((i) -> -i[0]));

		Set<Long> s = new HashSet<>();

		long x = 0;
		for (int i = 0; i < k; i++) {
			x += l[i][0];
			if (s.contains(l[i][1])) {
				l[i][1] = -1;
			} else {
				s.add(l[i][1]);
				l[i][1] = -2;
			}
		}

		long answer = x + ((long) s.size() * s.size());

		int p = k;
		int dup = k - 1;

		while (true) {
			while (p < n && s.contains(l[p][1])) p++;
			if (p >= n) break;

			while (dup >= 0 && l[dup][1] != -1) dup--;
			if (dup < 0) break;

			s.add(l[p][1]);
			l[p][1] = -2;
			x = x - l[dup--][0] + l[p++][0];
			answer = Math.max(answer, x + ((long) s.size() * s.size()));
		}

		System.out.println(answer);
	}
}


Measured memory_bytes: 97816
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<ll,ll> P;

void Main() {
  ll a,b;
  cin >> a >> b;
  set<int> s;
  s.in(a);
  s.in(b);
  REP(i,1,4) {
    if(!s.count(i)) {
      pr(i);
      return;
    }
  }
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC optimize("no-stack-protector,fast-math")
#define IO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define ld long double
int main(){
    string s1="",s2="";
    cin>>s1;
    for(int i=0;i<s1.size();i++)
    {
        if(s1[i]=='0')
            s2+=s1[i];
        else if(s1[i]=='1')
            s2+=s1[i];
        else 
        {
            if(!s2.empty())
                s2.pop_back();
            else 
                continue;    
        }    
    }    
    cout<<s2<<endl;
}

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

int main() {
    int N, K;
    cin >> N >> K;
    vector<int>powers(N);

    for (int i=0; i<N; i++)cin >> powers[i];
    vector<int> last_powers(N);
    for (int i=0; i<K; i++){
        vector<int>table(N*2);
        vector<int>total(N*2);
        for (int j=0; j<N; j++){
            int dj = powers[j];
            table[max((j-dj)*2-1,0)]++;
            table[min((j+dj)*2+1,N*2-1)]--;
        }
        for (int j=0; j<N*2; j++){
            if(j>0) table[j] += table[j-1];
        }
        for (int j=0; j<N; j++)powers[j] = table[j*2];
        
        bool exit_condition = true;
        for (int j=0; j<N; j++){
            if (table[j] != N){
                exit_condition = false;
                break;
            }
        }
        if (exit_condition){
            for (int j=0; j<N;j++)cout << powers[j] << " ";
            cout << endl;
            exit(0);
        }    
    
    }

    for (int k=0; k<N; k++)cout << powers[k] << " ";
    cout << endl;
    exit(0);    
}

Measured memory_bytes: 8316
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt();
    int T = sc.nextInt();
    int A = sc.nextInt();

    int[] H = new int[N];

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

    sc.close();

    double d0 = 999999;
    int p = 0;

    for (int i = 0; i < N; i++) {

      double d1 = T - H[i] * 0.006;
      double d2 = Math.abs(A - d1);

      if (d2 <= d0){
        d0 = d2;
        p = i;
      }

    }

    System.out.println(p+1);

  }

}

Measured memory_bytes: 22484
#include <set>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

typedef long long ll;

const double EPS = 1e-9;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, 1, -1};

typedef vector<int> vi;
typedef pair<int, int> pi;

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

int main(){
  int n;
  scanf("%d",&n);
  int ans = 1;
  if(n>1){
    REP(i,7){
      if(pow(2,(i+1)) > n){
        ans = pow(2,i);
        break;
      }
    }
  }
  printf("%d\n", ans);

  return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define endl '\n'
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define mod 1000000007
#define FASTIO ios::sync_with_stdio(0); cin.tie(0);
#define REP(i,a,b) for(int i=a;i<b;i++)
#define maxx 1000001
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;

int main() {
    FASTIO
    ll a,b,c,d,d1,d2,d3,d4;
    cin>>a>>b>>c>>d;
    d1=a*c;d2=a*d;d3=b*c;d4=b*d;
    cout<<max({d1,d2,d3,d4})<<endl;
    return 0;
}


Measured memory_bytes: 3644
import java.util.*;
class Pair
{
	double x;
	double y;
	Pair(double x, double y)
	{
		this.x = x;
		this.y = y;
	}
}

public class Main 
{
	public static double helon(Pair p1, Pair p2, Pair p3)
	{
		double a = Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));
		double b = Math.sqrt((p1.x - p3.x) * (p1.x - p3.x) + (p1.y - p3.y) * (p1.y - p3.y));
		double c = Math.sqrt((p2.x - p3.x) * (p2.x - p3.x) + (p2.y - p3.y) * (p2.y - p3.y));
		double z = (a + b + c) / 2;
		return(Math.sqrt(z * (z - a) * (z - b) * (z - c)));
	}
	
	public static void main(String[] args) 
	{
		Scanner stdIn = new Scanner(System.in);
		List<Pair> list = new ArrayList<Pair>();
		while(stdIn.hasNext())
		{
			String[] str = stdIn.next().split(",");
			double x = Double.parseDouble(str[0]);
			double y = Double.parseDouble(str[1]);
			list.add(new Pair(x, y));
		}
		double sum = 0;
		for(int i = 1; i < list.size() - 1; ++i)
		{
			sum += helon(list.get(0), list.get(i), list.get(i + 1));
		}
		System.out.println(sum);
	}
}

Measured memory_bytes: 11000
#include<stdio.h>
#include<cmath>

int main(){
    int n,x[1000];
    double xa,a;
    while(scanf("%d",&n) && (n != 0)){
        for(int i=0;i < n;i++){
            scanf("%d",&x[i]);
            xa += x[i];
        }
        xa /= n;
        for(int i=0;i < n;i++){
            a += pow(xa - x[i],2);
        }
        a /= n;
        printf("%lf\n",sqrt(a));
        a = 0,xa = 0;
    }
    return 0;
}



Measured memory_bytes: 2756
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <iomanip>
using namespace std;
typedef long long int ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl

const int mod = 1000000007;
#define PI 3.14159265359;

void P(int x) {cout << x << endl;}
void P(long x) {cout << x << endl;}
void P(double x) {cout << x << endl;}
void P(ll x) {cout << x << endl;}
void P(string x) {cout << x << endl;}
void P(char x) {cout << x << endl;}

ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}


int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  P(max(a * b, c * d));
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize ("Ofast")
#pragma GCC optimization ("unroll-loops, no-stack-protector")
#pragma GCC target ("avx")
#pragma GCC target ("avx2")
#pragma GCC target ("fma")
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pci pair <char, int>
#define pld pair <ld, ld>
#define ppld pair <pld, pld>
#define ppll pair <pll, pll>
#define pldl pair <ld, ll>
#define vll vector <ll>
#define vvll vector <vll>
#define vpll vector <pll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define mll map <ll, ll>
#define fastmap gp_hash_table
#define cd complex <double>
#define vcd vector <cd>
#define PI 3.14159265358979
#define ordered_set tree <ll, null_type, less <ll>, rb_tree_tag, tree_order_statistics_node_update>
#pragma 03
using namespace std;
using namespace __gnu_pbds;
int main(){
	// Interesting problem.
	ll n; cin >> n; ll ans = 0;
	for (ll i = 1; i <= n; i++) ans += (i * (i + 1) / 2);
	for (ll i = 1; i < n; i++){
		ll u, v; cin >> u >> v; if (u > v) swap(u, v); ans -= u * (n - v + 1);
	}
	cout << ans << endl;
}

Measured memory_bytes: 3552
import bisect,collections,copy,heapq,itertools,math,numpy,string,decimal
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def SS(): return map(str,sys.stdin.readline().rstrip().split())
def II(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

s = list(S())
t = list(S())

end = t.pop()
if ord('a') <= ord(end) and ord(end) <= ord('z'):
  if "".join(s) == "".join(t):
    print("Yes")
    exit()
print("No")

Measured memory_bytes: 27220
#include <stdio.h>

int main(void){
        int a, b;
        char op;

        while(1){
                scanf("%d %c %d", &a, &op, &b);


                if( op=='?' )
                        break;


                switch(op){
                        case '+':
                                printf("%d", a + b);
                                break;

                        case '-':
                                printf("%d", a - b);
                                break;

                        case '*':
                                printf("%d", a * b);
                                break;

                        case '/':
                                printf("%d", a / b);
                                break;

                }

                putchar('\n');

        }

                return 0;

}

Measured memory_bytes: 604
import java.util.Scanner;

public class Main {
	Dice dice;
	void run(){
		Scanner s = new Scanner(System.in);
		int[] num = new int[6];
		for(int i = 0;i < num.length;i++){
			num[i] = s.nextInt();
		}
		dice = new Dice(num);
		String str = s.next();
		for(int i = 0;i < str.length();i++){
			dice.label = dice.roll(str.substring(i,i+1));
		}
		dice.printTop();
	}
	public static void main(String args[]){
		new Main().run();
	}
}

class Dice {
	static final int labelNum = 6;
	int[] label;
	Dice(int[] num){
		label = new int[labelNum];
		for(int i = 0;i < labelNum;i++)
			label[i] = num[i];
	}
	
	int[] roll(String pro){
		int[] dice = new int[labelNum];
		switch(pro.hashCode()){
			case 69://E->3
				dice[0] = this.label[3];
				dice[1] = this.label[1];
				dice[2] = this.label[0];
				dice[3] = this.label[5];
				dice[4] = this.label[4];
				dice[5] = this.label[2];
				break;
			case 78://N->5
				dice[0] = this.label[1];
				dice[1] = this.label[5];
				dice[2] = this.label[2];
				dice[3] = this.label[3];
				dice[4] = this.label[0];
				dice[5] = this.label[4];
				break;
			case 83://S->2
				dice[0] = this.label[4];
				dice[1] = this.label[0];
				dice[2] = this.label[2];
				dice[3] = this.label[3];
				dice[4] = this.label[5];
				dice[5] = this.label[1];
				break;
			case 87://W->4
				dice[0] = this.label[2];
				dice[1] = this.label[1];
				dice[2] = this.label[5];
				dice[3] = this.label[0];
				dice[4] = this.label[4];
				dice[5] = this.label[3];
				break;
			default:
				break;
		}
		return dice;
	}
	
	void print(){
		for(int i = 0;i<this.label.length;i++){
			System.out.println(this.label[i]);
		}
	}
	void printTop(){
		System.out.println(this.label[0]);
	}
}

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

const double EPS = 1e-10;
const ll INF = 100000000;
const ll MOD = 1000000007;

int n, y;

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
































Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stdio.h>
#include <cmath>
#include <cctype>

using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    int n1, n2;

    for(int i = 1; i < 1010; i++){
        if( floor((i * 8 / 100)) == a && floor((i / 10)) == b){
            cout << i << endl;
            return 0;
        } 
    }

    cout << "-1" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
        using namespace std;
        #define tani_nachi_ke  ios_base::sync_with_stdio(false); cin.tie(NULL);
        #define M_PI 3.14159265358979323846
        #define data data_
        #define ff first
        #define ss second
        #define pb push_back
        #define ld long double
        #define int long long
        #define print(t) cout << "Case #" << t << ": ";
        int32_t main()
        {
            tani_nachi_ke  
            
            
            int n;
            cin >> n;
            int sum = 0;
            for(int i = 1; i <= n; i++)
                if(i%3 != 0 && i%5 != 0)
                    sum += i;
            cout << sum << endl;




           return 0;
        }
          

Measured memory_bytes: 3648
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <numeric>
#include <chrono>
#include <bitset>
#include <tuple>
#include <queue>
#include <map>
#include <cstring>
#include <cassert>
#define pi acos(-1)
using namespace std;

const int N = 2e5 + 10, mod = 1e9 + 7;

int f(int a) {
    if(a < 90) return a;
    if(a >= 90 && a < 180) return 180 - a;
    if(a >= 180 && a < 270) return a - 180;
    return 360 - a;
}

vector<int> adj[N];

int main() {
    // ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int tc = 1; 
    // scanf("%d", &tc);
    for(int cn = 1; cn <= tc; cn++) {
        int n, m; cin >> n >> m;
        for(int i = 0; i < m; i++) {
            int u, v; scanf("%d%d", &u, &v);
            adj[u].push_back(v);
            adj[v].push_back(u);
        }
        vector<bool> vis(n + 1, 0);
        vector<int> parent(n + 1, 0);
        queue<pair<int, int>> q;
        q.push({1, 1});
        while(q.size()) {
            int u = q.front().first;
            int pa = q.front().second;
            q.pop();
            if(vis[u]) continue;
            vis[u] = 1;
            parent[u] = pa;
            for(int v : adj[u]) {
                if(!vis[v]) q.push({v, u});
            }
        }
        puts("Yes");
        for(int u = 2; u <= n; u++) printf("%d\n", parent[u]);
    }  
    return 0;
}

Measured memory_bytes: 13216
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main(){
    int n,k,ans=1; cin>>n>>k;
    rep(i,n) ans=min(ans*2,ans+k);
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  string s,k;
 cin>>s>>k;
  sort(s.begin(),s.end());
  sort(k.begin(),k.end());
  reverse(k.begin(),k.end());
  
  if(s<k) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <stack>
#include <queue>
#include <cmath>
#include <string>
#include <iterator>
#include <map>
#include <set>
#include <iomanip>
#include <vector>
#include <cstdint>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Graph = vector<vector<int>>;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
#define rep(i, N) for(int i = 0; i < N; i++)
#define rep2(i, l, r) for (ll i = (ll)l; i < (ll)(r); i++)
#define INF 1000000000000000
#define MAX 200001

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
const ll MOD = 1000000007;

template <typename T > inline string toString(const T &a) {ostringstream oss; oss << a; return oss.str();};

int main(){
    int N;
    cin >> N;
    vector<int> A(N),A_p,A_n;
    rep(i,N) cin >> A[i];
    sort(A.begin(), A.end());
    rep(i,N){
        if(A[i] <= 0) A_n.push_back(A[i]);
        else A_p.push_back(A[i]);
    }
    if(A_n.size() == 0){
        int now = A_p[0];
        int ans = 0;
        rep(i,N-1){
            ans += A_p[i+1];
        }
        cout << ans - A_p[0] << endl;
        rep(i,N-2){
            cout << now << ' ' << A_p[i+1] << endl;
            now -= A_p[i+1];
        }
        cout << A_p[N-1] << ' ' << now << endl;
    }
    else if(A_p.size() == 0){
        int ans = 0;
        int now = A_n[N-1];
        rep(i,N-1){
            ans += -A_n[i]; 
        }
        ans += A_n[N-1];
        cout << ans << endl;
        rep(i,N-1){
            cout << now << ' ' << A_n[i] << endl;
            now -= A_n[i];
        }
    }
    else{
        int ans = 0;
        for(auto n:A_n) ans += n*-1;
        for(auto p:A_p) ans += p;
        cout << ans << endl;
        int s_n = A_n.size();
        int s_p = A_p.size();
        if(s_p == 1){
            int now = A_p[0];
            for(auto n:A_n){
                cout << now << ' ' << n << endl;
                now -= n;
            }
        }
        else{
            cout << A_n[0] << ' ' << A_p[0] << endl;
            int now = A_n[0] - A_p[0];
            for(int i = 1; i < s_p-1; i++){
                cout << now << ' ' << A_p[i] << endl;
                now -= A_p[i];
            }
            cout << A_p[s_p-1] << ' ' << now << endl;
            now = A_p[s_p-1] - now;
            for(int i = 1; i < s_n; i++){
                cout << now << ' ' << A_n[i] << endl;
                now -= A_n[i];
            }
        }
    }
}

Measured memory_bytes: 4296
const input = require("fs").readFileSync("/dev/stdin", "utf8")

const lines = input.split('\n')
const S = lines[0]

const plnd = str => {
    const center = Math.floor(str.length / 2)
    for (let i = 0; i < center; i++) {
        if (str[i] !== str[str.length - i - 1]) {
            return false
        }
    }
    return true
}

const center = Math.floor(S.length / 2)
console.log(plnd(S) && plnd(S.substring(0, center)) ? 'Yes' : 'No')

Measured memory_bytes: 29568
while 1:
    n=int(input())
    if n==0:break
    a={}
    for _ in range(n):
        b=list(map(int,input().split()))
        a[b[0]]=sum(b[1:8:2])*60+sum(b[2:9:2])
    a=sorted(a.items(),key=lambda x:x[1])
    for i in [0,1,-2]:print(a[i][0])

Measured memory_bytes: 8540
#include <bits/stdc++.h>
using namespace std;;
#define ll long long
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define INF 1<<30
#define LINF 1LL<<62
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define pb push_back
const int MOD = 1000000007;
 
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,m,c; cin >> n >> m >> c;
  ll ans = 0;
  ll b[m];
  REP(i,m){
      cin >> b[i];
  }
  REP(i,n){
      ll num = 0;
      REP(j,m){
          ll tmp ; cin >> tmp;
          num += tmp * b[j];
      }
      num += c;
      if(num > 0 ){
          ans++;
      }
  }
  cout << ans << endl;

}

Measured memory_bytes: 256
word = input().rstrip()
n = int(input())
hanten = 0
lhantenlist = []
rlist = []
for i in range(n):
    a = input().rstrip().split(" ")
    if a[0] == "1":
        hanten = (hanten + 1) % 2
        # word = word[::-1]
        #print(word)
    else:
        if (a[1] == "2" and hanten == 0) or (a[1] == "1" and hanten == 1):
            rlist.append(a[2])
            #print("rtuika: ",rlist)
        else:
            lhantenlist.append(a[2])
            #print("ltuika: ",lhantenlist)

lhanten="".join(lhantenlist)
r="".join(rlist)

if hanten == 0:
    anslist=[lhanten[::-1],word,r]
    ans="".join(anslist)
else:
    anslist = [r[::-1], word[::-1], lhanten]
    ans="".join(anslist)
print(ans)

Measured memory_bytes: 69080
N, A, B, C, D = map(int, input().split())
S = list(input())
S[A - 1] = 'A'
S[B - 1] = 'B'
a1 = 0
a2 = 0
ans = ''
if C > D:
    a1 = 'A'
    a2 = 'B'
    tmp1 = C - 1
    tmp2 = D - 1
    now1 = A - 1
    now2 = B - 1
else:
    a1 = 'B'
    a2 = 'A'
    tmp1 = D - 1
    tmp2 = C - 1
    now1 = B - 1
    now2 = A - 1

while True:
    if now1 != tmp1:
        if now1 + 1 <= len(S) - 1 and S[now1 + 1] == '.' and now1 + 1 <= tmp1:
            S[now1] = '.'
            S[now1 + 1] = a1
            now1 += 1
        elif now1 + 2 <= len(S) - 1 and S[now1 + 2] == '.' and now1 + 2 <= tmp1:
            S[now1] = '.'
            S[now1 + 2] = a1
            now1 += 2
        elif now2 + 1 <= len(S) - 1 and S[now2 + 1] == '.' and now2 + 1 <= tmp2:
            S[now2] = '.'
            S[now2 + 1] = a2
            now2 += 1
        elif now2 + 2 <= len(S) - 1 and S[now2 + 2] == '.' and now2 + 2 <= tmp2:
            S[now2] = '.'
            S[now2 + 2] = a2
            now2 += 2
        else:
            ans = 'No'
            break
    elif now2 != tmp2:
        if now2 + 1 <= len(S) - 1 and S[now2 + 1] == '.' and now2 + 1 <= tmp2:
            S[now2] = '.'
            S[now2 + 1] = a2
            now2 += 1
        elif now2 + 2 <= len(S) - 1 and S[now2 + 2] == '.' and now2 + 2 <= tmp2:
            S[now2] = '.'
            S[now2 + 2] = a2
            now2 += 2
        else:
            ans = 'No'
            break
    else:
        ans = 'Yes'
        break

print(ans)

Measured memory_bytes: 4988
s = input()
n = len(s)
flag = True

for i in range(n):
  if i % 2 == 0 and s[i] == ("L"):
    flag = False
  if i % 2 == 1 and s[i] == ("R"):
    flag = False
    
if flag:
  print("Yes")
else:
  print("No")
    

Measured memory_bytes: 9108
#include<bits/stdc++.h>
template<typename T>inline auto range(T i,T j){
    std::vector<T>ee;
    if(j>=i)for(T o=i;o<=j;++o)ee.push_back(o);
    else for(T o=i;o>=j;--o)ee.push_back(o); 
    return ee;
}
struct __EMPty__{};
template <typename T> struct Greater:std::greater<T>{};
template <typename T> struct Less:std::less<T>{};
#define Print print
#define Greater(x) greater<x>
#define Less(x) less<x>
#define print std::cout
#define out <<
#define Constructor(f) f
#define Destructor(f) ~f
#define read std::cin
#define Read read
#define in >>
#define begin main(){
#define another 
#define called 
#define integer int
#define plus +
#define Let 
#define let 
#define be =
#define the
#define value
#define of 
#define us
#define now
#define I 
#define have 
#define an 
#define thing auto
#define Please 
#define please
#define Now
#define Then 
#define That 
#define is  
#define all return 0;
#define Thank
#define you
#define so
#define within :
#define much }
#define do )
#define each (
#define For for
#define word char
#define sentence string
#define Do do
#define While while(
#define array 
#define Until until
#define some
#define integers integer
#define times *
#define minus -
#define divided /
#define by
#define mod %
#define Sort std::sort
#define equals ==
#define not_equals !=
#define stop break
#define Stop stop
#define If if(
#define to
#define Else else
#define boolean bool
#define one
#define is
#define from
#define different !=
#define function auto
#define with
#define as
#define well ,
#define nothing
#define address &
#define One one
#define An an
#define type struct
#define includes
#define which
#define way
#define Use
#define its this->
#define Return return
#define cpp std
#define itself *this;
#define Another another
#define but __EMPty__
#define decimal double
#define greater >
#define less <
#define than
Let us begin;
I have an integer called x;
Read in x;
If the value of x is less than 1200 do{
    Print out "ABC\n";
}
Else{
    Print out "ARC\n";
}
That is all;
Thank you so much;

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    int n; cin >> n;
    string s; cin >> s;
    vector<int> r,g,b;
    REP(i,n) {
        if (s[i] == 'R') r.push_back(i);
        else if (s[i] == 'G') g.push_back(i);
        else b.push_back(i);
    }
    ll ans = 0;
    if (r.size() * g.size() * b.size() == 0){
        OUT(0)
        return 0;
    }
    for (auto i:r) {
        for (auto j:g) {
            //if (i > j) swap(i,j);
            ll d = j-i;
            ll bs = b.size();
            if (i-d >= 0) {
                auto it1 = lower_bound(ALL(b),i-d);
                if (*it1  == i-d) bs--;
            }
            if (j+d >= 0) {
                auto it2 = lower_bound(ALL(b),j+d);
                if (*it2 == j+d ) bs--;
            }
            if (d % 2 == 0) {
                if (i+d/2 >= 0) {
                    auto it3 = lower_bound(ALL(b),i+d/2);                
                    if (*it3 == i+d/2) bs--;
                }
            }
            ans += bs;
        }
    }

    cout << ans << '\n';

    return 0;
}

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

int main(){
    string s; cin >> s;
    string ans;
    if(s=="Sunny"){
        ans = "Cloudy";
    } else if(s=="Cloudy"){
        ans = "Rainy";
    } else {
        ans = "Sunny";
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
_ = int(input())
h = list(map(int, input().split()))

opt = [0] * len(h)
opt[1] = abs(h[0]-h[1])

for i in range(2,len(h)):
    A = opt[i-1] + abs(h[i-1] - h[i])
    B = opt[i-2] + abs(h[i-2] - h[i])
    opt[i] = min(A, B)

print(opt[len(h)-1])

Measured memory_bytes: 20640
#include<stdio.h>
int main(){
  int n,m, i,j,last, ch[9][2],ans=-1,p[]={1,10,100,1000};
  scanf("%d%d",&n,&m);
  last= n==1? 0: p[n-1];
  for(i=0; i<m; i++)
    scanf("%d%d",&ch[i][0],&ch[i][1]);
  for(i=p[n]-1; i>=last; i--){
    for(j=0; j<m; j++)
      if((i/p[n-ch[j][0]])%10!=ch[j][1])break;
    if(j>=m)ans=i;
  }
  printf("%d\n",ans);
return 0;}



Measured memory_bytes: 128
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;

class AtCoder
{
    const int MOD = 1000000007;
    
    int GetParent(int current, int[] parents)
    {
        if(parents[current] == current)
            return current;
        int parent = GetParent(parents[current], parents);
        parents[current] = parent;
        return parent;
    }
    public void Slove()
    {
        var inputs = Console.ReadLine().Split();
        int n = int.Parse(inputs[0]);
        int d = int.Parse(inputs[1]);
        int[][] points = new int[n][];
        points = points
            .Select(x => Console.ReadLine().Split().Select(int.Parse).ToArray())
            .ToArray();
        int ans = 0;
        foreach(int i in Enumerable.Range(0, n - 1))
            foreach(int j in Enumerable.Range(0, n).Skip(i + 1))
            {
                double v = points[i]
                    .Select((x, index) => Math.Pow(x - points[j][index], 2))
                    .Sum();
                if(v == Math.Pow((int)Math.Sqrt(v), 2))
                {
                    //Console.WriteLine($"{i} {j} {v}");
                    ans++;
                }
            }
        Console.WriteLine(ans);
    }
    static void Main()
    {
        var ac = new AtCoder();
        ac.Slove();
    }
}

Measured memory_bytes: 13524
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
const double EPS = 1e-9;
const ll MOD = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;

#define SIZE 4000001

ll kai[SIZE];
ll mokai[SIZE];

ll mod_pow (ll x, ll y) {
    ll ret = 1;
    while (y) {
        if (y&1) ret = ret*x%MOD;
        x = x*x%MOD;
        y /= 2;
    }
    return ret;
}

void init () {
    kai[0] = 1;
    for (int i = 1; i < SIZE; i++) kai[i] = kai[i-1]*i%MOD;
    for (int i = 0; i < SIZE; i++) mokai[i] = mod_pow(kai[i],MOD-2);
}

ll conb (ll x, ll y) {
    ll z = x-y;
    ll ret = kai[x]*mokai[y]%MOD;
    ret = ret*mokai[z]%MOD;
    return ret;
}

ll n, k;
ll dp[2001][2001];

inline ll mmul (ll x, ll y) {
    return x*y%MOD;
}

int main() {
    cin >> n >> k;
    init();
    if (k == 1) {
        cout << 1 << endl;
        return 0;
    }
    dp[0][0] = 1;
    for (ll i = 1; i <= n; i++) {
        dp[i][0] = mmul(dp[i-1][0], conb(i*(k-1)-1,k-2));
    }
    for (ll j = 1; j <= n; j++) {
        for (ll i = j; i <= n; i++) {
            if (i == j) {
                dp[i][j] = dp[i][j-1];
            } else {
                dp[i][j] = (mmul(dp[i-1][j], conb(i*k-(i-j)-1, k-2)) + dp[i][j-1]) % MOD;
            }
        }
    }
    cout << (dp[n][n] * kai[n]) % MOD;
}


Measured memory_bytes: 92544
#include <iostream>
#include <sstream>
using namespace std;
string number_to_string(int num){    ostringstream ss;    ss << num;    return ss.str();}
int main(void)
{ 
   string s;
   cin >> s;
   //n = abs(n);
   //string s = number_to_string(n);
   //s[0]==s[1]==s[2] || s[1]==s[2]==s[3] || s[0]==s[1]==s[2]==s[3] 
   bool is_good = s[0]== s[1] && s[1]==s[2];
   is_good |= (s[1]==s[2] && s[2]==s[3]);
   is_good |=  (s[0]==s[1] && s[1]==s[2] && s[3]==s[4]);
   if(is_good)
     cout << "Yes" << endl;
   else
     cout << "No" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<algorithm>
using namespace std;
#define int long long

signed main(){

        int n;
        scanf("%lld",&n);
        for(int i=0;i<n;i++){
                double x1,x2,x3,y1,y2,y3;
                scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3);
                double a = x2-x1;
                double b = y2-y1;
                double c = x3-x1;
                double d = y3-y1;
                double xc = 1/(a*d-b*c)*((a*a+b*b)/2*d+(c*c+d*d)/-2*b)+x1;
                double yc = 1/(a*d-b*c)*((a*a+b*b)/-2*c+(c*c+d*d)/2*a)+y1;
                printf("%.3f %.3f %.3f\n", xc, yc, sqrt((x1-xc)*(x1-xc)+(y1-yc)*(y1-yc)));

        }

        return 0;
}

Measured memory_bytes: 3208
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define PI 3.141592653589793
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;


int main(){
    ll N;
    cin >> N;
    vector<ll> A(N);
    for(int i = 0; i < N; i++){
        cin >> A[i];
    }
    vector<ll> Busket(200001);
    for(int i = 0; i < N; i++){
        Busket[A[i]]++;
    }
    ll total=0;
    for(int i = 0; i < Busket.size(); i++){
        if(Busket[i] <= 1) continue;
        total += Busket[i]*(Busket[i]-1)/2;
    }
    for(int i = 0; i < N; i++){
        ll C1,C2;
        if(Busket[A[i]] == 1){
            C1 = 0;
            C2 = 0;
        }else if(Busket[A[i]] == 2) {
            C1 = 1;
            C2 = 0;
        }else{
            C1 = Busket[A[i]]*(Busket[A[i]]-1)/2;
            C2 = (Busket[A[i]]-1)*(Busket[A[i]]-2)/2;
        }
        // cout << "---"<< endl;
        // cout << total<< endl;
        // cout << C1 << endl;
        // cout << C2 << endl;

        cout << total - C1 + C2 << endl;
    }


}

Measured memory_bytes: 5760
from collections import Counter
def MI(): return map(int, input().split())
def II(): return int(input())
def IS(): return input()
def LI(): return list(map(int, input().split()))


n = II()
l = list(Counter(LI()).items())
ans = 0
for num in l:
    if num[0] < num[1]:
        ans += num[1]-num[0]
    elif num[0] > num[1]:
        ans += num[1]
    else:  # num[0] == num[1]
        pass
print(ans)


Measured memory_bytes: 21224
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> a(n+1, 0);
    for (int i = 1; i < n+1; i++) {
        cin >> a.at(i);
    }

    vector<int> flag(n+1, 0);
    int i = 1, ans = 0;
    while (flag.at(i) == 0) {
        flag.at(i) = 1;
        i = a.at(i);
        ans++;
        if (i == 2) break;
    }
    if (i != 2) ans = -1;

    cout << ans << endl;
}


Measured memory_bytes: 1024
/*#include <iostream>

unsigned long long int func(unsigned long long int a);

unsigned long long answ[1000000000];

int main(){
	unsigned long long int n;
	while(std::cin >> n, n){
		unsigned long long int ans = 0;
		unsigned long long int n_=n;
		while(n_--){
			ans++;
			unsigned long long int b = func(ans); 
			ans+=b;
			n-=b;
		}
		std::cout << ans << std::endl;
	}
	return 0;
}

unsigned long long int func(unsigned long long int a){
	int res=1;
	while(a > 0){
		if(a % 10 == 4 || a % 10 == 6)return res;
		a /= 10;
		res*=10;
	}
	return 0;
}*/

#include <iostream>
#include <stack>
#define  _m_ 1

const int Ebit[8]={0,1,2,3,5,7,8,9};

int main(){
	int n;
	std::stack<int> st;
	while(_m_){
		std::cin >> n;
		if(n==0)break;
		while(_m_){
			if(n<8){
				st.push(Ebit[n]);
				break;
			}
			int amari = n%8;
			n/=8;
			st.push(Ebit[amari]);
		}
		while(st.size()){
			std::cout<<st.top();
			st.pop();
		}
		std::cout<<std::endl;
	}
	return 0;
}

Measured memory_bytes: 1200
parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)
N,A,B = parseMap(split(readline()))
ans = 0
set_count = div(N,A + B)
nokori  = N % (A + B)
ans += A * set_count
ans += minimum([A,nokori])        

println(ans)

Measured memory_bytes: 130784
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <stack>
#include <cstdlib>
#include <ctime>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef double DB;

int n, m, k;

int main()
{
	scanf("%d%d%d", &n, &m, &k);
	bool ok = 0;
	for(int i = 0; i <= n; i++)
		for(int j = 0; j <= m; j++) 
			if(i * m + j * n - 2 * i * j == k) ok = 1;
	if(ok) printf("Yes\n");
	else printf("No\n");
}

Measured memory_bytes: 256
A,B,C = map(str,input().split())
box = [A,B,C]
box.sort(reverse = True)#降順

tasu = int(box[0]+box[1])
nokori = int(box[2])

ans = tasu + nokori
print(ans)
"""
print(tasu)
print(type(tasu))
"""

Measured memory_bytes: 3060
/*  TAHMID RAHMAN
    DAMIAN FOREVER
     MATH LOVER
    NEVER GIVE UP
*/
#include<bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ll long long
#define pb push_back
#define fi first
#define se second
#define in insert
#define mp make_pair
#define GCD(a,b) __gcd(a,b);
#define endl "\n"
#define FRU freopen("out.txt","w",stdout)
#define FRO freopen("in.txt","r",stdin)
#define INFLL 9223372036854775807
#define debug 0
#define MAXN   100001
#define ar array
const int mxN=2e5;
const int MOD=1e9+7;
bool sortbysec(const pair<int,int> &a,const pair<int,int> &b){return (a.second < b.second);}
//Don't hesitate to ask me if you don't understand my code.......Happy coding,Tahmid...;

int main()
{
    fastio;
    ll t;
    t=1;
    //cin>>t;
    while(t--)
    {
        ll n,i,j;
        cin>>n;
        vector<ll>v(n),notten;
        ll ans=0,sum=0;
        for(i=0;i<n;i++)
        {
            cin>>v[i];
            if(v[i]%10!=0)
            {
                notten.pb(v[i]);
            }
            sum+=v[i];
        }

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

        for(i=0;i<notten.size();i++)
        {
            if(sum%10!=0)
            {
                ans=sum;
                break;
            }

            sum-=notten[i];
        }

        cout<<ans<<endl;


    }

}


Measured memory_bytes: 3664
#include<bits/stdc++.h>
#define n 500000
#define mem(arr) memset(arr, 0, sizeof(arr))
using namespace std;
typedef long long lli;
typedef double llf;
typedef pair<int, int> P;
void solve();
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int times = 1;
//	cin >> times;
	for(int i=0; i<times; i++)
	{
		solve();
		cout << '\n';
	}
	return 0;
}

int a, b, c, d, e, f, g, h;
int arr[n + 50], arr1[n + 50], arr2[n + 50];

//type here

void solve()
{
	string str; cin >> str;
	if(str == "Sunny") cout << "Cloudy";
	else if(str == "Cloudy") cout << "Rainy";
	else					 cout << "Sunny";
}

Measured memory_bytes: 256