akhauriyash/Code-Regression huggingface dataset:
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {

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

	/**
	 * @throws IOException
	 */
	private void solve() throws IOException {
		try {
			solveA();
			//			solveB();
			//			 solveC();
			//			 solveD();
			//			 solveE();
			//			 solveF();
		} finally {
			if (in != null) {
				in.close();
			}
			if (out != null) {
				out.flush();
				out.close();
			}
		}

	}

	private void solveA() {
		int numA = nextInt();
		int numB = nextInt();
		int numC = nextInt();

		if (numA + numB == numC || numB + numC == numA || numA + numC == numB) {
			out.println("Yes");
		} else {
			out.println("No");
		}
	}

	private void solveB() {
		int numN = nextInt();

		out.println("");
	}

	private void solveC() {
		int numN = nextInt();

		out.println("");
	}

	private void solveD() {
		int numN = nextInt();

		out.println("");
	}

	private void solveE() {
		int numN = nextInt();

		out.println("");
	}

	private void solveF() {
		int numN = nextInt();

		out.println("");
	}

	private final PrintWriter out = new PrintWriter(System.out);
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define ll long long
using namespace std;

const ll P = 1000000007;
int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }

int main()
{
  cout << fixed << setprecision(10);
  int N;
  cin >> N;
  vector<int> A(N),B(N);
  rep(i,N) cin >> A[i] >> B[i];
  vector<pair<int,int>> vec;
  rep(i,N)
  {
    vec.push_back(make_pair(B[i],A[i]));
  }
  sort(RALL(vec));
  int sum = vec[0].first;
  rep(i,N)
  {
    if(sum>vec[i].first)
    {
      sum = vec[i].first;
    }
    sum -= vec[i].second;
    if(sum<0)
    {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


Measured memory_bytes: 6940
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define put(i) cout<<fixed<<i<<endl
using namespace std;
using ll = long long;

//pdf見て解答

int main(){
    int n, x, y; cin >> n >> x >> y;
    vector<ll> ans(n);

    fill(ans.begin(),ans.end(),0);

    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= n; j++){
            ans[min(abs(j-i),min(abs(x-i)+1+abs(j-y),abs(y-i)+1+abs(j-x)))]++;
            //put(min(abs(j-i),min(abs(x-i)+1+abs(j-y),abs(y-i)+1+abs(j-x))));
        }
    }
    for(int j = 1; j < n; j++){
        put(ans[j] / 2);
    }
}

Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#include <string.h>
using namespace std;

const int MAXN = 405;
const long long INF_LL = (long long)1e16;

int a[MAXN];
long long dp[MAXN][MAXN];
long long pref[MAXN];

long long get_sum(int l, int r) {
    return pref[r] - pref[l - 1];
}

long long solve(int l, int r) {
    if (l >= r) return 0;
    if (dp[l][r] != -1) return dp[l][r];

    long long& ans = dp[l][r];
    ans = INF_LL;
    for (int i = l; i < r; i++) {
        ans = min(ans, get_sum(l, i) + get_sum(i + 1, r) + solve(l, i) + solve(i + 1, r));
    }
    return ans;

    return 0;
}

int main(void) {
    int n;

    scanf(" %d", &n);
    for (int i = 1; i <= n; i++) {
        scanf(" %d", &a[i]);
        pref[i] = pref[i - 1] + a[i];
    }
    memset(dp, -1, sizeof(dp));
    long long ans = solve(1, n);
    printf("%lld\n", ans);

    return 0;
}


Measured memory_bytes: 1536
#include<iostream>
#include<string>
using namespace std;
int main()
{
    string s;
    int ans=0;
    cin>>s;
    if(s[2]==s[3])
        ans++;
    if(s[4]==s[5])
        ans++;
    if(ans==2)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
}

Measured memory_bytes: 256
N = int(input())
people = [[-1 for __ in range(N)] for _ in range(N)]
for i in range(N):
    A = int(input())
    for j in range(A):
        x, y = map(int, input().split())
        x -= 1
        people[i][x] = y

ans = 0


for i in range(1 << N):
    ansi = 0
    flag = True
    for j in range(N):
        peoplei = 0
        if (i & 1 << j):
            peoplei = 1
            ansi += 1
        for k in range(N):
            if (i & 1 << k):
                if(people[k][j] != -1 and people[k][j] != peoplei):
                    flag = False

    if flag:
        ans = max(ans, ansi)


print(ans)





Measured memory_bytes: 9228
A,B,C=(map(int,input().split(' ')))
ans = 0
while True:
    if A%2!=0 or B%2!=0 or C%2!=0:
        print(ans)
        break
    if A==B==C:
        print(-1)
        break
    A,B,C=B/2+C/2,A/2+C/2,A/2+B/2
    ans += 1

Measured memory_bytes: 3060
#include <stdio.h>

int top=0;

int push(int);
int pop(void);


int main(){
 
  int x,a,b;
  char s[100];


  while( scanf("%s", s) != EOF ){
    if ( s[0] == '+' ){
      a=pop();
      b=pop();
      push(b+a);


    } else if ( s[0] == '-' ){
      a=pop();
      b=pop();
      push(b-a);
     
      



    } else if ( s[0] == '*' ){
      a=pop();
      b=pop();
      push(b*a);
     

    } else {
      x = atoi(s);
      push(x);
    }
  }
  
  printf("%d\n",pop());
  return 0;
}


int s[100];


int push(int x){

  
  s[top++] = x;
  return x;
}

int pop(void){

    
 
 
  return s[--top]; 
}

Measured memory_bytes: 548
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <algorithm>

#include <bits/stdc++.h>
#include <cmath>
#include <limits>

using namespace std;
typedef long long LL;
using Graph = vector<vector<int>>;

static long long INF = (1LL<<62);

int main(int argc, char* argv[]){
	cin.tie(0);
	ios::sync_with_stdio(false);

	LL a, b, c;
	cin >> a >> b >> c;

	LL u = c - a - b;
	if(u <= 0){
		printf("No\n");
		return 0;
	}

	LL v = u * u;
	v -= (4*a*b);
	if(v > 0){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 3556
package main

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

var sc = bufio.NewScanner(os.Stdin)

func Scan() string {
	sc.Scan()
	return sc.Text()
}
func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}
func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

type pair struct {
	fi int
	se int
}

var data [3][30]int
var d [][]int
var c [][]int

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	//予備
	n := iScan()
	s := Scan()
	red := 0
	white := 0
	k := 0
	data := make([]int, n)
	for i := 0; i < n; i++ {
		if s[i] == 'W' {
			data[i] = 0
			red++
		} else {
			data[i] = 1
			white++
		}
	}

	now := n - 1
	end := 0
	for {
		if end == now {
			break
		}
		if data[now] == 1 {
			if data[end] == 0 {
				k++
				data[now] = 0
				data[end] = 1
			} else {
				end++
				continue
			}
		}
		now--
	}
	ans := make([]int, 3)
	ans[0] = k
	ans[1] = white
	ans[2] = red
	fmt.Println(min(ans))
}

Measured memory_bytes: 4060
#include <bits/stdc++.h>
#define int long long
#define double long double
#define INF 1e18
using namespace std;
int Y[110];
signed main() {
  int N, A, B, C, X;
  while (true) {
    cin>>N>>A>>B>>C>>X;
    if (N+A+B+C+X==0) break;
    for (int i = 0; i < N; i++) cin >> Y[i];
    int ans = -1;
    for (int i = 0; i < N; ans++){
      if (ans > 10000) break;
      if (Y[i] == X) i++;
      X = (A * X + B) % C;
    }
    ans = (ans > 10000) ? -1 : ans;
    cout << ans << endl;
  }
}



Measured memory_bytes: 3092
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<math.h>
using namespace std;
#define N (1000000000+7)
#define INF 1e16
typedef pair<int,int> P;
typedef long long ll;


int main(void){
    string s,t;
    cin>>s>>t;
    map<char,char>f,finverse;
    for(char z='a';z<='z';z++){
        f[z]='0';
        finverse[z]='0';
    }
    for(int i=0;i<s.length();i++){
        if(f[s[i]]!='0'){
            if(f[s[i]]!=t[i]){
                cout<<"No"<<endl;
                return 0;
            }
        }
        if(finverse[t[i]]!='0'){
            if(finverse[t[i]]!=s[i]){
                cout<<"No"<<endl;
                return 0;
            }
        }
        if(f[s[i]]=='0')f[s[i]]=t[i];
        if(finverse[t[i]]=='0')finverse[t[i]]=s[i];
    }
    cout<<"Yes"<<endl;
    return 0;
}

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

using namespace std;

long long MOD = 1000000007;

int n;
vector<long long> v;

long long binpow(long long a, long long x) {
    if (x == 0) return 1;
    if (x & 1) {
        return a * binpow(a, x-1) % MOD;
    } else {
        long long t = binpow(a, x/2);
        return t * t % MOD;
    }
}

long long inverse(long long x) {
    return binpow(x, MOD-2);
}

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

    cin >> n;
    for (int i = 0; i < n; i++) {
        long long x;
        cin >> x;
        v.push_back(x);
    }

    long long z = 0;
    vector<long long> w(n);
    vector<long long> fact(n);
    fact[0] = 1;
    for (int i = 1; i < n; i++) {
        w[i] = (w[i-1] * i + fact[i-1]) % MOD;
        fact[i] = (fact[i-1] * i) % MOD;
        long long d = v[i] - v[i-1];
        z += d * w[i] % MOD * inverse(fact[i]) % MOD;
    }
    for (int i = 1; i < n; i++) {
        z = z * i % MOD;
    }
    cout << z << endl;

    return 0;
}


Measured memory_bytes: 2804
def divisor(n):
    d = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            d.append(i)
            if n % (n//i) == 0:
                d.append(n//i)
    d.sort()
    return d

n = int(input())
def solve():
    for a in divisor(n):
        b = n // a
        yield max(len(str(a)), len(str(b)))

print(min(solve()))


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
using Graph = vector<vector<int>>;
#define MOD 1000000007
#define MOD2 998244353
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long ll;
typedef pair<ll, ll> P;

ll a[100010];
ll b[100010];

int main(){
    int n;
    cin >> n;
    rep(i, n + 1) cin >> a[i];
    rep(i, n) cin >> b[i];
    ll ans = 0;
    rep(i, n){
        if (b[i] > a[i]){
            if (b[i] < a[i+1] + a[i]){
                ans += b[i];
                a[i+1] -= b[i] - a[i];
            }
            else{
                ans += a[i] + a[i+1];
                a[i+1] = 0;
            }
        }
        else {
            ans += b[i];
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char *argv[]){
	string s,t;
	cin >> s >> t;
	int i,j,k,flag;
	for(i=s.length()-t.length();i>=0;i--){
		flag=1;
		for(j=0;j<t.length();j++)
			if(!((s[i+j]=='?')||(s[i+j]==t[j]))) flag=0;
		if(flag==1){
			k=i;
			break;
		}
	}
	if(flag==0){
		cout << "UNRESTORABLE";
		return 0;
	}
	for(j=0;j<s.length();j++)
		if((j>=k)&&(j<k+t.length()))
			cout << t[j-k];
		else if(s[j]=='?')
			cout << 'a';
		else cout << s[j];
	return 0;
}

Measured memory_bytes: 256
import unittest


class TestC(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think([9, 1, 4, 4, 6, 7]), 2)

    def test_2(self):
        self.assertEqual(think([9, 1, 14, 5, 5, 4, 4, 14]), 0)

    def test_3(self):
        self.assertEqual(think([99592 ,10342 ,29105 ,78532 ,83018 ,11639 ,92015 ,77204 ,30914 ,21912 ,34519 ,80835 ,100000 ,1]), 42685)


def solve():
    d = read()
    result = think(d)
    write(result)


def read():
    n = read_int(1)[0]
    return read_int(n)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_float(n):
    return list(map(lambda x: float(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(data):
    n = len(data)
    data.sort()
    right_index = n // 2
    left_index = n // 2 - 1
    return data[right_index] - data[left_index]


def write(result):
    print(result)


if __name__ == '__main__':
    # unittest.main()
    solve()

Measured memory_bytes: 17108
#include <iostream>
using namespace std;
typedef long long ll;
//vector<pair<bool, ll>> v(4001);
ll a[4001];

int main(){
	int n, num, p, q;
	while(cin >> n, n){
		fill(a, a+4001, 0);
		int f = 1;
		//for(int i = 0;i < 4001;i++)a[i] = 0;
		for(int i = 0;i < n;i++){
			cin >> num >> p >> q;
			a[num] += p * q;
			if(a[num]>999999){
                cout << num << endl;
                f = 0;
            }
		}
		if(f)cout << "NA" <<endl;
		/*int f = 1;
		for(int i = 1;i <= 4000;i++)if(a[i] >= 1000000)cout << i << endl, f = 0;
		if(f)cout << "NA" << endl;*/
	}
	return 0;
}

/*
4
1001 2000 520
1002 1800 450
1003 1600 625
1001 200 1220
*/

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



int main(int argc, char **argv){
    int x, y;
    cin >> x >> y;
    for(int i = 0;i < y + 2;i++){
        cout << "#";
    }
    cout << endl;
    for(int i = 0;i < x;i++){
        cout << "#";
        for(int j = 0;j < y;j++){
            char a;
            cin >> a;
            cout << a;
        }
        cout << "#";
        cout << endl;
    }
    for(int i = 0;i < y + 2;i++){
        cout << "#";
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin >> s;
	int len = s.size();
	int ans = 0;
	for(int i=0; i<len/2; i++){
		if(s[i]!=s[len-i-1])
			ans++;
	}
	cout << ans;
	return 0;
} 

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
  
int X;
long long int K;

const long long int MOD = (long long int)1e9+7;

struct Matrix{
	int sizeX,sizeY;
	vector< vector<long long int> > value;
	
	Matrix(){
	}
	
	Matrix(int X,int Y){
		set(X,Y);
	}
	
	void set(int X,int Y){
		sizeX=sizeY=Y;
		value.resize(X);
		for(int i=0;i<X;i++){
			value[i].resize(Y);
		}
	}
	
};

long long int modAdd(long long int A,long long int B){
	return ((A%MOD+B%MOD)%MOD+MOD)%MOD;
}

long long int modMultiply(long long int A,long long int B){
	return ((A%MOD*B%MOD)%MOD+MOD)%MOD;
}

Matrix operator * (Matrix &lhs, Matrix &rhs){
	Matrix ret(lhs.sizeX,rhs.sizeY);
	
	for(int i=0;i<ret.sizeX;i++){
		for(int j=0;j<ret.sizeY;j++){
			ret.value[i][j] = 0;
			for(int k=0;k<rhs.sizeX;k++){
				ret.value[i][j]=modAdd(ret.value[i][j],modMultiply(lhs.value[i][k],rhs.value[k][j]));
			}
		}
	}
	
	return ret;
}

Matrix matrixPow(Matrix A,long long int X){
	Matrix ret(A.sizeX,A.sizeX);
	for(int i=0;i<A.sizeX;i++){
		for(int j=0;j<A.sizeX;j++){
			if(i==j) ret.value[i][j]=1;
			else ret.value[i][j]=0;
		}
	}
	
	while(X){
		if(X%2==1){
			ret = ret*A;
		}
		A=A*A;
		X=X/2;
	}
	
	return ret;
}

int main(){
	Matrix A;
	long long int ans=0;
	cin>>X>>K;
	A.set(X,X);
	for(int i=0;i<X;i++){
		for(int j=0;j<X;j++){
			cin>>A.value[i][j];
		}	
	}
	A=matrixPow(A,K);
	for(int i=0;i<X;i++){
		for(int j=0;j<X;j++){
			ans=modAdd(ans,A.value[i][j]);
		}
	}
	cout<<ans<<"\n";
	return 0;
}

Measured memory_bytes: 384
bingo = ({(0,0),(0,1),(0,2)},{(1,0),(1,1),(1,2)},
         {(2,0),(2,1),(2,2)},{(0,0),(1,0),(2,0)},
         {(0,1),(1,1),(2,1)},{(0,2),(1,2),(2,2)},
         {(0,0),(1,1),(2,2)},{(0,2),(1,1),(2,0)})

card = []
for i in range(3):
    card.append(list(map(int, input().split())))

n = int(input())
b = []
for i in range(n):
    b.append(int(input()))

a = set()
for i in range(3):
    for j in range(3):
        if card[i][j] in b:
            a.add((i,j))

flag = False
for line in bingo:
    if line <= a:
        flag = True
        break

if flag:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3192
#include<bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define inf 2000000000
#define infLL 2000000000000000000
#define MAX 5000010
#define sf(a) scanf("%d", &a)
#define sfl(a) scanf("%lld", &a)
#define pf(a) printf("%d ", a)
#define pfl(a) printf("%lld\n", a)
#define Case(t) printf("Case %d: ", t)
#define pii pair<int, int>
#define MOD 1000000007
#define mod 998244353
#define PI acos(-1.0)
#define eps 1e-9
#define mem(a, b) memset(a, b, sizeof(a))
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

inline int Set(int N, int pos){return N=N | (1<<pos);}
inline int Reset(int N, int pos){return N=N & ~(1<<pos);}
inline bool Check(ll N, ll pos){return (bool)(N & (1LL<<pos));}

inline void normal(ll &a) { a %= mod; (a < 0) && (a += mod); }
inline ll modMul(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a * b) % mod; }
inline ll modAdd(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a + b) % mod; }
inline ll modSub(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while (p) { if (p & 1LL) r = modMul(r, b); b = modMul(b, b); p >>= 1LL; } return r; }
inline ll modInverse(ll a) { return modPow(a, mod - 2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

ll fast_exp(ll x, ll n, ll m)
{
    ll res = 1;
    while(n>0)
    {
        if(n%2==1)
            res = (res * x) % m;
        x = (x * x) % m;
        n/=2;
    }
    return res%m;
}

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}

clock_t t_Start;
void Start()
{
    t_Start = clock();
}
void End()
{
    double Time = (double)(clock()-t_Start)/CLOCKS_PER_SEC;
    error(Time);
}

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>orderedSet;
typedef tree<int,null_type,greater<int>,rb_tree_tag,tree_order_statistics_node_update>orderedSet1;

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    //Start();

    FASTIO;
    int a, b, c;
    cin>>a>>b>>c;
    swap(a, b);
    swap(a, c);
    cout<<a<<" "<<b<<" "<<c<<endl;

    //End();
    return 0;
}


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

int main()
{
    int a, b;
    cin >> a >> b;
    cout << max({a + b, a - b, a * b}) << endl;
    return 0;
}

Measured memory_bytes: 3636
#include<iostream>
#include<string>
#include<cmath>
using namespace std;
using ll=long long;

int main(){
    string S,T;
    cin>>S>>T;
    ll min_change=1000;
    ll S_l=S.length();
    ll T_l=T.length();
    for(ll i=0;i<=S_l-T_l;i++){
        ll temp=0;
        for(ll j=0;j<T_l;j++){
            if(S[i+j]!=T[j]){
                temp++;
            }
        }
        min_change=min(min_change,temp);
    }
    cout<<min_change<<endl;
    return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;using ll=long long;using uint=unsigned int;using pii=pair<int,int>;using pll=pair<ll,ll>;using ull = unsigned long long;using ld=long double;template<typename T>void _(const char*s,T h){cerr<<s<<" = "<<h<<"\n";}template<typename T,typename...Ts>void _(const char*s,T h,Ts...t){int b=0;while(((b+=*s=='(')-=*s==')')!=0||*s!=',')cerr<<*s++;cerr<<" = "<<h<<",";_(s+1,t...);}// break continue pop_back 998244353
#define int ll
#define pii pll
#define f first
#define s second
#define pb emplace_back
#define forn(i,n) for(int i=0;i<(n);++i)
#define sz(a)((int)(a).size())
#define sqr(x) ((x)*(x))
struct init{init(){cin.tie(0);iostream::sync_with_stdio(0);cout<<fixed<<setprecision(11);cerr<<fixed<<setprecision(5);}~init(){
#ifdef LOCAL
#define dbg(...) _(#__VA_ARGS__,__VA_ARGS__)
cerr<<"Time elapsed: "<<(double)clock()/CLOCKS_PER_SEC<<"s.\n";
#else
#define dbg(...) 
#endif
}}init;template<typename T,typename U>void upx(T&x,U y){if(x<y)x=y;}template<typename T,typename U>void upn(T&x,U y){if(x>y)x=y;}mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N=202020,C=1e8;
int r[N];
int32_t main(){
	int x1,y1,x2,y2;
	cin>>x1>>y1>>x2>>y2;
	if(x1>x2){
		swap(x1,x2);
		swap(y1,y2);
	}
	bool flip=y1>y2;
	if(flip){
		y1=C-y1-1;
		y2=C-y2-1;
	}
	int n;
	cin>>n;
	vector<pii> a;
	forn(i,n){
		int x,y;
		cin>>x>>y;
		if(flip)y=C-y-1;
		if(x1<=x&&x<=x2&&y1<=y&&y<=y2)a.pb(x-x1,y-y1);
	}
	sort(a.begin(),a.end());
	n=sz(a);
	forn(i,n+1)r[i]=C+C;
	r[0]=-C-C;
	for(pii p:a){
		int y=p.s;
		int j=upper_bound(r,r+n+1,y)-r;
		r[j]=y;
	}
	int lis=-1;
	forn(i,n+1)if(r[i]!=C+C)lis=i;
	const ld pi=acosl(-1);
	ld ans=(x2-x1+y2-y1)*100-lis*(20-pi*5);
	if(lis==min(x2-x1+1,y2-y1+1))
		ans+=pi*5;
	cout<<ans<<'\n';
	return 0;
}


Measured memory_bytes: 8216
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL; 
  typedef pair<ll,char> PLC; 
  typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

class UnionFind{
  private:
    vector<int> Parent;
    vector<int> CandFre;
  public:
    UnionFind(int N){
      Parent = vector<int>(N,-1);
    }

    int find(int x){
      if(Parent[x] < 0) return x;
      return Parent[x] = find(Parent[x]);
    }

    int size(int x){
      return -Parent[find(x)];
    }

    bool unite(int x, int y){
      x = find(x);
      y = find(y);
      if(x==y) return false;

      if(size(x)<size(y))swap(x,y);
      Parent[x] += Parent[y];
      Parent[y] = x;
      return true;
    }

    bool same(int x, int y){
      return find(x) == find(y);
    }
};

int main(void){
  SPEEDUP
  cout << setprecision(15);
  int N,M,K;cin >> N >> M >> K;
  UnionFind uni = UnionFind(N);
  vector<int> v(N,-1);
  rep(i,M){
    int x,y;cin >> x >> y;
    --x;--y;
    --v[x];
    --v[y];
    uni.unite(x,y);
  }
  rep(i,K){
    int x,y;cin >> x >> y;
    --x;--y;
    if(uni.same(x,y)){
      --v[x];--v[y];
    }
  }
  rep(i,N) cout << uni.size(i)+v[i] SPF;
  cout << endl;
  return 0;
}


Measured memory_bytes: 1664
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner a =  new Scanner(System.in);
        int W = a.nextInt(), H = a.nextInt(), x = a.nextInt(), y = a.nextInt(), r = a.nextInt();
        String b;
  
        if(x + r <= W && x - r  >=0 ){
            if(y + r <= H && y - r >= 0){
                b = "Yes";
            }else {
                    b = "No";
	}
	}else {
            b = "No";
        }
         System.out.println(b);
    }
    
}

Measured memory_bytes: 26264
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC push_options
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#include <xmmintrin.h>
#include <immintrin.h>
using namespace::std;
__attribute__((constructor))void init(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/priority_queue.hpp>
#include<ext/pb_ds/tag_and_trait.hpp>
// #include <boost/multiprecision/cpp_dec_float.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
// namespace mp = boost::multiprecision;
// typedef mp::number<mp::cpp_dec_float<0>> cdouble;
// typedef mp::cpp_int cint;
template<typename T>using pbds=__gnu_pbds::tree<T,__gnu_pbds::null_type,less<T>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>;
template<typename T>using pbds_map=__gnu_pbds::tree<T,T,less<T>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>;
template<typename T,typename E>using hash_map=__gnu_pbds::gp_hash_table<T,E>;
template<typename T>using pqueue =__gnu_pbds::priority_queue<T, greater<T>,__gnu_pbds::rc_binomial_heap_tag>;
typedef long long lint;
#define INF (1LL<<60)
#define IINF (1<<30)
#define EPS (1e-10)
#define endl '\n'
#define MOD 1000000007LL
//#define MOD 998244353LL
typedef vector<lint> vec;
typedef vector<vector<lint>> mat;
typedef vector<vector<vector<lint>>> mat3;
typedef vector<string> svec;
typedef vector<vector<string>> smat;
template<typename T>inline void numout(T t){bool f=0;for(auto i:t){cout<<(f?" ":"")<<i<INF/2?i:"INF";f=1;}cout<<endl;}
template<typename T>inline void numout2(T t){for(auto i:t)numout(i);}
template<typename T>inline void output(T t){bool f=0;for(auto i:t){cout<<(f?" ":"")<<i;f=1;}cout<<endl;}
template<typename T>inline void output2(T t){for(auto i:t)output(i);}
template<typename T>inline void _output(T t){bool f=0;for(lint i=0;i<t.size();i++){cout<<f?"":" "<<t[i];f=1;}cout<<endl;}
template<typename T>inline void _output2(T t){for(lint i=0;i<t.size();i++)output(t[i]);}
#define rep(i,n) for(lint i=0;i<lint(n);++i)
#define repi(i,a,b) for(lint i=lint(a);i<(lint)(b);++i)
#define rrep(i,n) for(lint i=lint(n)-1;i>=0;--i)
#define rrepi(i,a,b) for(lint i=lint(b)-1;i>=lint(a);--i)
#define irep(i) for(lint i=0;;++i)
#define all(n) begin(n),end(n)
#define dist(a,b,c,d) sqrt(pow(a-c,2)+pow(b-d,2))
inline lint gcd(lint A,lint B){return B?gcd(B,A%B):A;}
inline lint lcm(lint A,lint B){return A/gcd(A,B)*B;}
// inline cint cgcd(cint A,cint B){return B?cgcd(B,A%B):A;}
// inline cint clcm(cint A,cint B){return A/cgcd(A,B)*B;}
inline bool chmin(auto& s,const auto& t){bool res=s>t;s=min(s,t);return res;}
inline bool chmax(auto& s,const auto& t){bool res=s<t;s=max(s,t);return res;}
const vector<lint> dx={1,0,-1,0,1,1,-1,-1};
const vector<lint> dy={0,1,0,-1,1,-1,1,-1};
#define SUM(v) accumulate(all(v),0LL)
auto call=[](auto f,auto... args){return f(f,args...);};


int main(){
	lint n,a,b;
	cin>>n>>a>>b;
	if(n%(a+b)<=a){
		cout<<n/(a+b)*a+n%(a+b)<<endl;
	}else{
		cout<<n/(a+b)*a+a<<endl;
	}
}

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

int main()
{
    int64_t x;
    cin >> x;
    int64_t mod11, div11, ans = 0;
    div11 = (x) / 11;
    mod11 = (x) % 11;
    if (x <= 6)
    {
        cout << 1 << endl;
        return 0;
    }
    else if (x <= 11)
    {
        cout << 2 << endl;
        return 0;
    }
    //    ans = 1;
    if (mod11 == 0)
    {
        ans = 0;
    }
    else if (mod11 <= 6)
    {
        ans = 1;
    }
    else
    {
        ans = 2;
    }
    ans = ans + div11 * 2;
    cout << ans << endl;
}

Measured memory_bytes: 256
from sys import stdin
N = int(stdin.readline().rstrip())
data = [int(x) for x in stdin.readline().rstrip().split()] + [10**10]
ans = 0
tmp = 0
for i in range(N):
    if data[i] >= data[i+1]:
        tmp += 1
    else:
        ans = max(ans,tmp)
        tmp = 0
print(ans)

Measured memory_bytes: 14224
#include <iostream>

using namespace std;

int main(){
    int boxX, boxY, circleX, circleY, radius, centerX, centerY;
    cin >> boxX >> boxY >> circleX >> circleY >> radius;
    centerX = circleX;
    centerY = circleY;
    circleX += radius;
    circleY += radius;
    if(circleX > boxX || circleY > boxY){
        cout << "No" << endl;
    }
    else if(circleX < 0 || circleY < 0){
        cout << "No" << endl;
    }
    else if(centerX < 0 || centerY < 0){
        cout << "No" << endl;
    }
    else{
        cout << "Yes" << endl;
    }
}

Measured memory_bytes: 1156
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
const double PI = acos(-1);
const ll MOD = 1000000007;
using Graph = vector<vector<int>>;

int main() {
  int M,D,N,E; cin >> M >> D >> N >> E;
  if (M != N) cout << 1 << endl;
  else cout << 0 << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main(){
	string s, t;
  	cin >> s >> t;
  	int flag  = 1;
  	for (int i=0;i<s.size();++i){
    	if (s[i] != t[i])
          	flag = 0;
    }
  if (flag)
      cout << "Yes" << endl;
  else
      cout << "No" << endl;
}


Measured memory_bytes: 3588
def solve(s, K):
    import heapq
    import re

    seen = set(s)
    pq = list(seen)
    heapq.heapify(pq)

    while True:
        t = heapq.heappop(pq)
        K -= 1
        if K==0:
            return t
        pattern = t + "."

        matched = re.findall(pattern, s)
        for sub in matched:
            if sub not in seen:
                seen.add(sub)
                heapq.heappush(pq, sub)


def main():
    s = input()
    k = int(input())
    print(solve(s, k))


main()

Measured memory_bytes: 3572
#include <cstdio>
#include <vector>
using namespace std;

int partition(int a[], int p, int r)
{
  int x = a[r];
  int i = p - 1;
  for (int j = p; j < r; j++)
    if (a[j] <= x)
    {
      i++;
      swap(a[i], a[j]);
    }
  swap(a[i + 1], a[r]);
  return i + 1;
}

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

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

  int index = partition(a, 0, n - 1);

  for (int i = 0; i < n - 1; i++)
    if (i == index)
      printf("[%d] ", a[i]);
    else
      printf("%d ", a[i]);
  printf("%d\n", a[n - 1]);
  return 0;
}

Measured memory_bytes: 2936
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define fi first
#define se second
#define pb push_back
#define rep(i, s, n) for (int i = s; i < n; i++)
#define rrep(i, s, n) for (int i = (n)-1; i >= (s); i--)
#define all(a) a.begin(),a.end()
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
const long long MOD = 1000000007, INF = 1e17;
 
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
 
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}



signed main()
{
	IOS();
	int N;
	cin>>N;
	vector<int>ans;
	rep(i,0,N){
		int y,m,d;
		cin>>y>>m>>d;
		int cnt = 0;
		while(1){
			if(y==1000&&m==1&&d==1)break;
			d++;
			if(y%3&&m%2==0&&d==20){
				m++;
				d=1;
			}
			if(d==21){
				m++;
				d=1;
			}
			if(m==11){
				y++;
				m=1;
			}
			cnt++;
		}
		ans.push_back(cnt);
	}
	for(auto e:ans){
		cout<<e<<endl;
	}
}



Measured memory_bytes: 3152
#include <iostream>
#include <iomanip>
#include <algorithm>
using namespace std;
#include <cstdio>
#include <tuple>
#include <string>
#include <vector> 
#include <set>
#include <string.h>
#include <map>
#include <cmath>
#include <deque>
using ll = long long;
using Graph = vector<vector<int>>;
#include <queue>
#include <stack>
#include <math.h>  /* M_PI */
#include <bitset>
const ll MOD = 1000000007;

template<class T> bool chmax(T& a, T b) { if (a <= b) { a = b; return 1; } return 0; }

int main(){

    ll N,K;
    cin >> N >> K;

    vector<ll> A(N);

    for(int i = 0;i < N;i++) cin >> A[i];

    //10^12 <= 2^40(10^3 <= 2^10)
    const int MAX_DIGIT = 50;

    //初期化
    ll dp[100][2];//= {-1};//d桁目,smaller
    memset(dp, -1, sizeof(dp)); // DP 配列を -1 で初期化

    dp[0][0] = 0;//初期条件
    for(int d = 0;d < MAX_DIGIT;d++){

        ll num = 0LL;
        ll mask = 1LL << (MAX_DIGIT - d - 1);

        for(int i = 0; i< N;i++) if(A[i] & mask) num++;

        ll val0 = num * mask;//xのd桁目が0の時の桁合計
        ll val1 = (N - num) * mask;//xのd桁目が１の時の桁合計

        //smaller -> smaller
        if(dp[d][1] != -1LL){
            //dp[d + 1][1] = dp[d][1] + max(val0,val1);
            chmax(dp[d+1][1], dp[d][1] + max(val0, val1));
        }

        //exact -> smaller
        if(dp[d][0] != -1LL){
            if(mask & K){
                //dp[d + 1][1] = dp[d][0] + val0;
                chmax(dp[d+1][1], dp[d][0] + val0);
            }
        }
        //exact -> exact
        if(dp[d][0] != -1LL){
            if(mask & K){
                //dp[d + 1][0] = dp[d][0] + val1;
                chmax(dp[d+1][0], dp[d][0] + val1);
            }else{
                //dp[d + 1][0] = dp[d][0] + val0;
                chmax(dp[d+1][0], dp[d][0] + val0);
            }
        }

    }

    cout << max(dp[MAX_DIGIT][0],dp[MAX_DIGIT][1]) << endl;

   
}

Measured memory_bytes: 1024
#include <iostream>
#include <sstream>
#include <stack>
#include <iomanip>
#include <string>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>

#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x) BEGIN(x), END(x)
#define PAIR make_pair
#define VEC(type) vector<type >

#define FOR(i, A, B) for(auto i = (A);i != (B); i++)
#define FORD(i, A, B) for(auto i = (A);i != (B); i--)

#define READRANGE(begin, end) FOR(it, begin, end) cin >> *it
#define READVEC(V) READRANGE(BEGIN(V), END(V))

using namespace std;

typedef long long lint;
typedef pair<int, int> Pii;
typedef pair<int, lint> Pil;
typedef pair<lint, lint> Pll;
typedef pair<lint, int> Pli;

// ---- BEGIN LIBRARY CODE ----
// ---- END LIBRARY CODE ----
void io_init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
};

int getroot(int x, VEC(int)& root)
{
    if (root[x] == x)
        return x;
    return root[x] = getroot(root[x], root);
}

lint merge(int x, int y, VEC(int)& root, VEC(int)& size)
{
    int rx = getroot(x, root), ry = getroot(y, root);
    if (rx == ry)
        return 0LL;

    lint ret = size[rx] * 1LL * size[ry];
    if (size[rx] > size[ry]) {
        root[ry] = rx;
        size[rx] += size[ry];
    } else {
        root[rx] = ry;
        size[ry] += size[rx];
    }

    return ret;
}

int main(int argc, char **argv)
{
    io_init();

    // Actual program code starts here.
    int N, M;
    cin >> N >> M;
    VEC(int) A(M), B(M);
    FOR(i, 0, M) {
        cin >> A[i] >> B[i];
    }

    VEC(lint) V(M + 1);
    lint total = N * 1LL * (N - 1) / 2;

    VEC(int) root(N), size(N);
    FOR(i, 0, N)
        root[i] = i, size[i] = 1;

    V[M] = total;
    FORD(i, M - 1, -1) {
        total -= merge(A[i] - 1, B[i] - 1, root, size);
        V[i] = total;
    }

    FOR(i, 1, M + 1)
        cout << V[i] << endl;
    return 0;
};


Measured memory_bytes: 3712
#include<stdio.h>
#include<algorithm>
using namespace std;
int n, x, w[201000], Loc[201000];
void Put(int a, int b){
    swap(w[a], w[Loc[b]]);
    swap(Loc[w[a]], Loc[w[Loc[b]]]);
}
int main(){
    int i;
    scanf("%d%d",&n,&x);
    if(x==1||x==2*n-1){
        printf("No\n");
        return 0;
    }
    for(i=1;i<=n*2-1;i++)w[i]=i, Loc[i]=i;
    if(x==2){
        Put(n,x);
        Put(n-1,1);
    }
    else{
        Put(n,x);
        Put(n-1,x-1);
        Put(n+1,x+1);
        if(n>=2)Put(n+2,x-2);
    }
    printf("Yes\n");
    for(i=1;i<=n*2-1;i++)printf("%d ",w[i]);
    printf("\n");
}

Measured memory_bytes: 2944
#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
const ll mod = 1e9 + 7;				//adjust mod value according to your need
const ll limit = 670000;	
void init_fact(vector<ll> &arr)
{
	arr[0] = 1;
	for (ll i = 1; i <= limit; ++i)
		arr[i] = (arr[i-1]*i)%mod;
}
ll power(ll x, ll y) 
{ 
    ll res = 1;
    x = x % mod; 
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % mod; 
        y = y>>1;
        x = (x*x) % mod; 
    } 
    return res; 
}
ll modInverse(ll n) 
{ 
    return power(n, mod-2); 
} 
ll nCrmod_fermat(ll n, ll r, vector<ll> &fac)
{
	if (r==0) 
      return 1;
    return (fac[n]* modInverse(fac[r]) % mod * modInverse(fac[n-r]) % mod) % mod; 
}
int main()
{
	ll x, y;
	vector<ll> factorial(limit+1);
	init_fact(factorial);
	cin >> x >> y;

	if ((x+y)%3 != 0)
	{
		cout << 0;
		return 0;
	}
	ll k = (x+y)/3;
	if (x-k<0 || (2*k)-x<0)
	{
		cout << 0;
		return 0;
	}

	cout << nCrmod_fermat(k,x-k,factorial);
	return 0;
}

Measured memory_bytes: 5504
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <functional>
#include <iomanip>
#include <bitset>
#include <numeric>
#include <queue>
#include <map>
#include <cstdint>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
const long long mod = 1000000007;
typedef long long int ll;
typedef pair<ll, ll> P;
const vector<int> di = { -1, 0, 1, 0 };
const vector<int> dj = { 0, 1, 0, -1 };



int main() {

	string s;
	cin >> s;

	rep(i, s.size()) {
		int num = i + 1;
		bool check = false;
		rep(j, s.size() - num) {
			if (s.at(i) == s.at(j + num )) {
				cout << "no" << endl;
				check = true;
				break;
			}
		}
		if (check == true) {
			break;
		}
		if (i == (s.size() - 1)) {
			cout << "yes" << endl;
		}
	}

	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define per(i, n) for (int i = (int)(n-1); i >= 0; i--)
#define sz(x) int(x.size())
#define all(x) (x).begin(), (x).end()
#define INF 2e9
typedef long long ll;
typedef pair<int, int> P;

int main() {
    int w, h, x, y;
    cin >> w >> h >> x >> y;

    double ans;
    ans = (double)w*h/2.0;
    cout << ans << " " << (2*x==w && 2*y==h ? 1 : 0) << endl;
    
}


Measured memory_bytes: 256
K, N = [int(x) for x in input().split()]

A = list([int(x) for x in input().split()])

r_list = []

for i in range(N):
    if i == N - 1:
        r_list.append(A[0] + K - A[i])

    else:
        r_list.append(A[i + 1] - A[i])

r_list.sort()

print(sum(r_list[:-1]))


Measured memory_bytes: 31564
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

N = INT()
A = LIST()

tmp = sum(A[::2]) - sum(A[1::2])

for i in range(N):
	print(int(tmp), end = " ")
	tmp = 2*(A[i] - tmp/2)
print()

Measured memory_bytes: 22028
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n) ;i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
const ll INF=1e18;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b){ a = b; return 1; } return 0; }



int main(int argc, char const *argv[]) {
  ll n;cin >> n;
  vector<ll> a(n);
  map<ll,ll> mp;
  rep(i,n) {
    cin >> a[i];
    mp[a[i]]++;
  }
  ll sum=0;
  for(ll i=0;i<=n;i++){
    sum+=mp[i]*(mp[i]-1)/2;
  }
  //cout << sum << endl;

  rep(i,n){
    ll ans=sum-mp[a[i]]*(mp[a[i]]-1)/2;
    ans+=max((mp[a[i]]-1)*(mp[a[i]]-2)/2,(ll)0);
    cout << ans << endl;
  }

  return 0;
}


Measured memory_bytes: 16768
#include <bits/stdc++.h>
using namespace std;
int main() {

string x;
cin>>x;
if(x=="SUN")cout<<7<<endl;
if(x=="MON")cout<<6<<endl;
if(x=="TUE")cout<<5<<endl;
if(x=="WED")cout<<4<<endl;
if(x=="THU")cout<<3<<endl;
if(x=="FRI")cout<<2<<endl;
if(x=="SAT")cout<<1<<endl;

    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
int e[100][100],n,m;
int ax[4]={0, 1, 0, -1},ay[4]={1, 0, -1, 0};
int dfs(int x, int y){
  int i,w=1;
  for(int i=0;i<4;i++){
    int nx = x + ax[i];
    int ny = y + ay[i];
    if(nx < 0 || nx >= n || ny < 0 || ny >= m){
      continue;
    }
    e[x][y] = 0;
    if(e[nx][ny] == 1){
      int num=dfs(nx, ny) + 1;
      if(num>w){
         w=num;
      }
    }
    e[x][y] = 1;
  }
  return w;
}
 int main(){
  while(1){
    int ans=0;
    scanf("%d %d",&m,&n);
    if(!m){
      break;
    }
     for(int i = 0;i < n;i++){
      for(int j=0;j<m;j++){
        scanf("%d",e[i]+j);
      } 
   }
   for(int i = 0;i < n;i++){
      for(int j = 0;j < m;j++){
     if(e[i][j]){
       int num=dfs(i, j);
      if(num>ans){
        ans=num;
      }
    }
      }
    }
    printf("%d\n",ans);
  }
  return 0;
}

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

typedef long long ll;

int main(){
  string S;
  ll K;
  cin >> S >> K;
  ll ans = 0;
  int end1 = 0;
  int end2 = 0;
  
  for(int i = S.size()-1; S[i] == S[S.size()-1] && i >= 0; i--){
    end1++;
  }
  
  for(int j = 0; S[j] == S[0] && j <= S.size()-1; j++){
    end2++;
  }
  
  char c = '0';
  for(int i = 0; i <= S.size()-1; i++){
    if(S[i] == c){
      ans++;
      S[i] = '?';
    }
    c = S[i];
  }
  
  if(end1 == S.size() && end1 % 2 == 1){
    cout << S.size()*K/2 << endl;
  }
  else if(S[0] == S[S.size()-1] && (end1 + end2) % 2 == 0){
    cout << ans*K + (K-1) << endl;
  }
  else cout << ans*K << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>                                           
 
#define int long long
//#pragma GCC optimize("Ofast")
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
 
 
#define file(s) freopen(s".in","r",stdin); freopen(s".out","w",stdout);
#define forev(i, b, a) for(int i = (b); i >= (a); --i)
#define forn(i, a, b) for(int i = (a); i <= (b); ++i)
#define all(x) x.begin(), x.end()
#define sz(s) (int)s.size()
#define pb push_back
#define ppb pop_back
#define s second
#define f first
 
 
using namespace std;
 
 
typedef pair < long long, long long > pll;    
typedef pair < int, int > pii;
typedef unsigned long long ull;         
typedef vector < pii > vpii;
typedef vector < int > vi;
typedef long double ldb;  
typedef long long ll;  
typedef double db;                             
 
 
const int inf = 1e9, maxn = 4e5 + 148, mod = 1e9 + 7, N = 1e5 + 11;
const int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1}, block = 555;
const pii base = {1171, 3307}, Mod = {1e9 + 7, 1e9 + 9};
const db eps = 1e-12, pi = 3.14159265359;
const ll INF = 1e18;


string s;	
int k, n, ans;


bool check () {
	forn (i, 0, n - 2)
		if (s[i] != s[i + 1])
			return 0;

	return 1;
}


main () {
	cin >> s >> k;			
	n = sz(s);
	if (check()) {
		int m = n * k;	
		cout << m / 2 << endl;
	} else {
		int pref = 0, suff = n - 1;
		int len1 = 1, len2 = 1;

		while (s[pref] == s[pref + 1]) {
			++pref; 
			++len1;			
		}
		
		while (s[suff] == s[suff - 1]) {
			--suff; 
			++len2;
		}

		ans += len1 / 2;//for the 1st one
		ans += len2 / 2;//for the last one
		forn (i, pref + 1, suff - 1) {
			int cnt = 1;
			while (s[i] == s[i + 1]) {
				++i;
				++cnt;
			}
			ans += (cnt / 2) * k;//for all
		}

		ans += (k - 1) * (s[0] == s.back() ? (len1 + len2) / 2 : len1 / 2 + len2 / 2);	
		cout << ans << endl;
	}
}
                        

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<map>
#include<utility>
#include<algorithm> // reverse
using namespace std;
#define df 0

void in(string const& S,int a,map<pair<string,string>,int>& m);
int search(string const& S,int a,map<pair<string,string>,int>& m);


int main(){
  int n; cin >> n;
  string S; cin >> S;
  if(df)cout << S;
  string T=S.substr(n,n);
  reverse(T.begin(),T.end());
  S=S.substr(0,n);
  
  if(df)cout << "\n" << S << "\n" << T << "\n" ;
  map<pair<string,string>,int> m;
  for(int i=0,limit=1<<n; i<limit; i++){
    in(S,i,m);
  }
  /*
  if(df){
    for (const auto& [key, value] : m){
      std::cout << key.first << " " << key.second << " => " << value << "\n";
    }
  }
  */
  long int cnt=0;
  for(int i=0,limit=1<<n; i<limit; i++){
    cnt+=search(T,i,m);
  }
  cout << cnt <<endl;
}

void in(string const& S,int a,map<pair<string,string>,int>& m){
  string str1,str2;

  if(df)printf("a=%d: ",a);
  int len=S.size();
  for(int i=0;i<len;i++){
    if(a%2){
      str1.push_back(S.at(i));
    }else{
      str2.push_back(S.at(i));
    }
    a/=2;
  }
  if(df)cout << str1 << " " << str2 << endl;
  pair<string,string> P=make_pair(str1,str2);
  auto itr=m.find(P);
  if(itr==m.end()){
    m[make_pair(str1,str2)]=1;
  }else{
    m[make_pair(str1,str2)]++;
  }
}

int search(string const& S,int a,map<pair<string,string>,int>& m){
  string str1,str2;
  int len=S.size();
  for(int i=0;i<len;i++){
    if(a%2){
      str1.push_back(S.at(i));
    }else{
      str2.push_back(S.at(i));
    }
    a/=2;
  }
  return m[make_pair(str1,str2)];
}

/// confirm df==0 ///


Measured memory_bytes: 91904