akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;

static const int MAX_NUM = 36;

typedef struct tagCard
{
    char cSuit;
    int  iNum;
} Card;

void BubbleSort(Card* pCard, int num)
{
    int i, j;
    bool flag;

    for (i = 0; i < num; i++) {
        flag = false;
        for (j = num - 1; j > i; j--) {
            if ((pCard + j)->iNum < (pCard + j - 1)->iNum) {
                swap(*(pCard + j), *(pCard + j - 1));
                flag = true;
            }
        }
        if (flag == false) {
            break;
        }
    }

    return;
}

void SelectSort(Card* pCard, int num)
{
    int i, j;
    int min;

    for (i = 0; i < num; i++) {
        min = i;
        for (j = i + 1; j < num; j++) {
            if ((pCard + min)->iNum > (pCard + j)->iNum) {
                min = j;
            }
        }
        if (min != i) {
            swap(*(pCard + i), *(pCard + min));
        }
    }

    return;
}

bool IsStable(Card* pCard1, Card* pCard2, int num)
{
    int i;
    bool ret = true;

    for (i = 0; i < num; i++) {
        if (pCard1[i].cSuit != pCard2[i].cSuit) {
            ret = false;
        }
    }

    return ret;
}

int main(void)
{
    int  i;
    int  num;
    Card elem1[MAX_NUM];
    Card elem2[MAX_NUM];

    cin >> num;
    for (i = 0; i < num; i++) {
        cin >> elem1[i].cSuit >> elem1[i].iNum;
        elem2[i] = elem1[i];
    }

    BubbleSort(elem1, num);
    SelectSort(elem2, num);

    cout << elem1[0].cSuit << elem1[0].iNum;
    for (i = 1; i < num; i++) {
        cout << " ";
        cout << elem1[i].cSuit << elem1[i].iNum;
    }
    cout << endl;
    cout << "Stable" << endl;

    cout << elem2[0].cSuit << elem2[0].iNum;
    for (i = 1; i < num; i++) {
        cout << " ";
        cout << elem2[i].cSuit << elem2[i].iNum;
    }
    cout << endl;
    if (IsStable(elem1, elem2, num) == true) {
        cout << "Stable" << endl;
    }
    else {
        cout << "Not stable" << endl;
    }


    return 0;
}

Measured memory_bytes: 1164
#include<bits/stdc++.h>
using namespace std;
 
#define ll          long long int
#define ld          long double
#define pb          push_back
#define mp          make_pair
#define ff          first
#define se          second
#define endl        '\n'
#define fd(n)       fixed<<setprecision(n)
#define MAX         100000000000000000
#define MAXN        1000005
#define mod         1000000007  
#define pi          3.1415926535897932384626433
 
ll fun(ll x,ll y){
    ll ans=1;
    while(y>0){
        if(y%2==1){
            ans=ans*1ll*x;
            ans=ans%mod;
        }
        y=y/2;
        x=(x*1ll*x)%mod;
    }
    return ans;
}
 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,m,i,x,y,mx=0,count=0;
    cin>>n>>m;
    vector<ll> vi[n+1];
    for(i=1;i<=m;i++){
        cin>>x>>y;
        vi[x].pb(y);
        vi[y].pb(x);
    }
    ll vis[n+1];
    memset(vis,0,sizeof(vis));
    queue<ll> qe;
    for(i=1;i<=n;i++){
        if(!vis[i]){
            count=0;
            vis[i]=1;
            queue<ll> qe;
            qe.push(i);
            while(!qe.empty()){
                ll node=qe.front();
                qe.pop();
                count++;
                for(auto x:vi[node]){
                    if(!vis[x]){
                        vis[x]=1;
                        qe.push(x);
                    }
                }
            }
            mx=max(mx,count);
        }
    }
    cout<<mx;
}

Measured memory_bytes: 18896
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>

using namespace std;

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)

typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const double EPS = 1e-9;


int main() {
    int N;
    cin >> N;
    vector<int> x(N+2), y(N+2);

    FOR(i, 0, N) {
        cin >> x[i] >> y[i];
    }
    x[N] = x[0]; y[N] = y[0];
    x[N+1] = x[1]; y[N+1] = y[1];

    auto cross = [](double a, double b, double c, double d) -> double {
        return a * d - b * c;
    };

    int result = 1;
    FOR(i, 0, N) {
        double p = cross(x[i+1]-x[i], y[i+1]-y[i],
                x[i+2]-x[i+1], y[i+2]-y[i+1]);
        if (p < 0) {
            result = 0;
            break;
        }
    }

    cout << result << endl;

    return 0;
}

Measured memory_bytes: 3096
S = sorted([[i,j] for i in range(1,100) for j in range(i+1,151)], key = lambda x:x[0]**2+x[1]**2)
while 1:
	h,w = map(int,raw_input().split())
	if h == 0: break
	hi,wi = S[S.index([h,w])+1]
	print hi,wi

Measured memory_bytes: 5772
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long int64;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const long long  INFL = 1e18;
const int MOD = 1000000007;
const int MAX = 210000;
const int MAX_NUM = 999999999;
void solve() {
	int X; cin >> X;
	if (X == 7 || X == 5 || X == 3) cout << "YES" << endl;
	else cout << "NO" << endl;
	return;
}
int main() {
	solve();
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main() {
  int i = 1;
  int n;
  while (1) {
    scanf("%d", &n);
    if (n == 0) {
      break;
    } else {
      printf("Case %d: %d\n", i, n);
      i++;
    }
  }
  return 0;
}

Measured memory_bytes: 600
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<string>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>

#define REP(i,n) for(int i=0;i<(n);i++)
#define EPS (1e-7)
#define INF (3e9)

using namespace std;
typedef long long int ll;

int N;
string S, T;
int main(void){
    cin >> N;
    cin >> S >> T;
    REP(i,N) cout << S[i] << T[i];
    cout << endl;
    return 0;
}



Measured memory_bytes: 256
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

a,b,c = LI()
x = c - a - b
y = 4 * a * b
if y < x**2 and x > 0:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 38384
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n); i >= 0; i--)
#define REP(i, m, n) for (int i = (int)(m); i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
typedef long long ll;

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; }

const long long INF = 1LL << 60;

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

  int ans = 1;
  rep(i, n){
    if(i) ans *= k-1;
    else ans *= k;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))

l = 0
r = 0
ans = 0
S = 0

while r<N:
    if S^A[r]==S+A[r]:
        ans += r+1-l
        S +=A[r]
        r +=1
    else:
        l += 1
        if l>r:
            r+=1
        else:
            S -= A[l-1]
print(ans)

Measured memory_bytes: 24584
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
 


public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static         Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);   cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	static int K,N;
	static long mod =1000000007;
	//static 	ArrayList<Integer> cc = new ArrayList<>(100);
//<60 >62
	public static void main(String[] args) {
			//String S=sc.next();
			//int N=sc.nextInt();
			//int v[]=new int[N];
			//for(int i=0;i<N;i++) {}
		int a=sc.nextInt();
		int b=sc.nextInt();
		int c=sc.nextInt();	
		
		if(b+c<=a) {
			p(0);
		}else {
			p(c-(a-b));
		}
	}
	static int v(int a) {
		return a*(a-1)/2;
	}

	
	//N==S
	//E==W
//83 S 
	//69E
	//78N
	//87W
	
	//static ArrayList<Integer> cc = new ArrayList<>(10001);
	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	public static int gcd(int a, int b) {
        return b == 0 ? a: gcd(b, a % b);
	}
	static String nextPermutation(String s) {
		ArrayList<Character> list=new ArrayList<>();
		for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		}
		int pivotPos=-1;
		char pivot=0;
		for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		}
		if(pivotPos==-1&&pivot==0) {
			return "Final";
		}
		int L=pivotPos+1,R=list.size()-1;
		
		
		
		int minPos=-1;
		char min =Character.MAX_VALUE;
		
		for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		}
		
		Collections.swap(list, pivotPos, minPos);
		Collections.sort(list.subList(L, R+1));
		
		
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		}
		return sb.toString();
	}
}
	


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

vector<long long> a;

int main() {
  a.resize(3);
  for (int i = 0; i < 3; ++i) cin >> a[i];
  for (int i = 0; i < 1000000; ++i) {
    if (a[0] % 2 || a[1] % 2 || a[2] % 2) {
      cout << i << endl;
      return 0;
    }
    long long x = a[0] / 2, y = a[1] / 2, z = a[2] / 2;
    a[0] = x + y;
    a[1] = x + z;
    a[2] = y + z;
  }
  cout << -1 << endl;
  return 0;
}


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

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef map<string, int> maps;
typedef map<int, int> mapi;

#define db double
#define add push_back
#define rem pop_back
#define mod 1000000007
#define all(a) a.begin(), a.end()
#define sz(a) int((a).size())
#define BS(i, j, k) binary_search(i, j, k)
#define prec(n) fixed<<setprecision(n)

void input(int *a, int size)  { for(int i = 0; i < size; ++i) cin >> a[i]; }
void output(int *a, int size) { for(int i = 0; i < size; ++i) cout << a[i] << " "; cout<<endl; }

#define repi(it, x) for(__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define rep(i, a, b)  for(int i = a; i <  b; i++)
#define repn(i, a, b) for(int i = a; i <= b; i++)
#define repv(i, b, a) for(int i = b - 1; i >= a; i--)
#define _1 first
#define _2 second

const double EPS = 1e-9;
const double PI = acos(-1.);
const int MOD = 1e9 + 7;
const int MAXN = 120001;
int INF = __INT64_MAX__;
int MAX = -1e9;
int MIN = 1e9;
string YN[] = {"NO", "YES"};

bool isPrime(int n)
{
          if (n <= 1)  return false;
          if (n <= 3)  return true;

          if (n%2 == 0 || n%3 == 0) return false;

          for (int i=5; i*i<=n; i=i+6)
                    if (n%i == 0 || n%(i+2) == 0)
                              return false;
          return true;
}
int n, m, A[MAXN], B[MAXN], res, cnt;
string s;
void solution()
{
		cin >> n >> s;
		for(int i = 0; i < n; i++){
			set<char> s1, s2, s3;
			for(int j = 0; j <= i; j++)
				s1.insert(s[j]);
			for(int j = i + 1; j <= n; j++)
				s2.insert(s[j]);
			set_intersection(s1.begin(), s1.end(), s2.begin(), s2.end(),std::inserter(s3, s3.begin()));
			MAX = max((int)s3.size(), MAX);
		}
		cout << MAX;
}
__INT16_C() main()
{
          ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
          int t = 1;
          //cin >> t;
          while(t--) solution();
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int i, n;
	int a[101] = {0};

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

	double sum = 0;
	for (i = 0; i < n; i++)
		sum += (double)1 / (double)a[i];
	sum = (double)1 / sum;

	printf("%le\n", sum);
	return 0;
}

Measured memory_bytes: 128
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

k = ni()
s = ns()
n = len(s)
mod = 10**9+7


def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

N = 10**6*3
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

ans = 0
for i in range(k+1):
    ans += cmb(n-1+i,i,mod)*pow(25,i,mod)%mod*pow(26,k-i,mod)%mod
    ans %= mod

print(ans)

Measured memory_bytes: 233868
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public final class Main {

    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        final int n = Integer.parseInt(in.nextLine());
        System.out.println(n >= 30 ? "Yes" : "No");
    }
}


Measured memory_bytes: 35688
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long x;cin>>x;
	long long last=0,ans=0;
	for(long long i=1;i<=5;i=i+2){
		if(pow(10LL,i)-1<x){
			ans+=9*pow(10LL,i-1);
			last=pow(10LL,i+1)-1;
		}
	}
	ans+=max(0LL,x-last);
	cout<<ans<<endl;
	
}

Measured memory_bytes: 512
#![allow(unused_imports, non_snake_case, dead_code)]
use proconio::{
    input, fastout,
    marker::{Chars, Bytes, Usize1}
};

struct UnionFind {
    size: usize,
    pos: Vec<isize>,
}
impl UnionFind {
    fn new(n: usize) -> Self {
        let size = n;
        let pos = vec![-1; n + 1];
        UnionFind { size, pos }
    }
    fn find(&mut self, x: usize) -> usize {
        if self.pos[x] < 0 {
            x
        } else {
            let v = self.pos[x] as usize;
            self.pos[x] = self.find(v) as isize;
            self.pos[x] as usize
        }
    }
    fn unite(&mut self, x: usize, y: usize) -> Result<(), ()> {
        let mut x = self.find(x);
        let mut y = self.find(y);
        if x == y {
            return Err(());
        };
        if self.pos[x] > self.pos[y] {
            std::mem::swap(&mut x, &mut y);
        }
        self.pos[x] += self.pos[y];
        self.pos[y] = x as isize;
        Ok(())
    }
    fn same(&mut self, x: usize, y: usize) -> bool {
        self.find(x) == self.find(y)
    }
    fn size(&mut self, x: usize) -> usize {
        let x = self.find(x);
        -self.pos[x] as usize
    }
}

#[fastout]
fn main() {
    input! {
        N: usize, Q: usize,
        l: [(usize, usize, usize); Q]
    }
    let mut uf = UnionFind::new(N);
    for &(t, x, y) in &l {
        if t > 0 {
            println!("{}", if uf.same(x, y) {1} else {0});
        } else {
            uf.unite(x,y).ok();
        }
    }
    // println!("{}", N);
}

Measured memory_bytes: 9928
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;


public class Main {
    private static int MOD = 1000000007;


    public static void main(String[] args) throws IOException {
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        String str = br.readLine();
        int yen = Integer.parseInt(str);

        int a = yen / 500; //1000
        int amari = yen % 500;
        int b = amari / 5;

        System.out.println((a*1000) + (b*5));
    }

}


Measured memory_bytes: 21204
class SegmentTree
  MIN = -Float::INFINITY
  def initialize(data)
    @offset = 1 << data.length.bit_length
    @data = Array.new(@offset * 2, MIN)
    data.each_with_index do |v, i|
      @data[@offset + i] = v
    end
    i = @offset - 1
    while i > 0
      @data[i] = merge(@data[2 * i], @data[2 * i + 1])
      i -= 1
    end
  end
  def merge(l, r); l > r ? l : r; end
  def max(a, b, k = 1, l = 0, r = @offset)
    mid = (l + r) / 2
    return MIN if b <= l || r <= a
    return @data[k] if a <= l && r <= b
    return merge(max(a,b,2 * k, l, mid), max(a,b,2 * k + 1, mid, r))
  end
end

def max(a,b); a > b ? a : b; end
def min(a,b); a < b ? a : b; end
def extract_cycle(s, used)
  cycle = []
  u = s
  until used[u]
    used[u] = true
    cycle << u  
    u = P[u]
  end
  return cycle
end

def section_max(dp, z)
  segtree = SegmentTree.new(dp)
  (0 ... z).inject(-Float::INFINITY) do |s, offset|
    if K >= z
      m = segtree.max(offset + 1, offset + z + K % z + 1) 
      r = K / z - 1
      max(s, r * max(0, dp[z]) + m - dp[offset])
    else
      m = segtree.max(offset + 1, offset + K + 1)
      max(s, m - dp[offset])
    end
  end
end

N, K = gets.split.map(&:to_i)
P = gets.split.map(&:to_i).tap{|array| array.unshift(0) }
C = gets.split.map(&:to_i).tap{|array| array.unshift(0) }
ans = -1e20

used = Array.new(N + 1)
(1 .. N).each do |s|
  next if used[s]
  cycle = extract_cycle(s, used)
  z = cycle.size
  
  score = Array.new(3 * z + 1, 0)
  (1 .. z * 3).each do |i|
    v = cycle[i % z]
    score[i] = score[i - 1] + C[v]
  end
  ans = max(ans, section_max(score, z))
end
puts ans


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

int main() {
  int i, j;
  int n;
  long long int na;
  int data[100001];
  int dif[100001];
  //  long int times[100001];
  long long int sum = 0;
  int times;
  int tme[100001];
  long long int one;
  int sum2 = 0;
  int flag = 0;

  scanf("%d", &n);
  na = (long long int)n;

  for (i = 0; i < n; i++) {
    scanf("%d", & data[i]);
    sum += data[i];
  }

  one = na * (na + 1) / 2;
  if (sum % one != 0) {
    flag = 1;
  } else {
    times = sum / one;
    for (i = 0; i < n-1; i++) {
      dif[i] = data[i+1] - data[i];
    }
    dif[n-1] = data[0] - data[n - 1];

    for (i = 0; i < n; i++) {
      if ((times - dif[i]) % n != 0) {
        flag = 1;
        break;
      } else {
        tme[i] = (times - dif[i]) / n;
        if(tme[i]<0){
          flag = 1;
          break;
        }
      }
    }
    if (flag == 0) {
      for (i = 0; i < n; i++) {
        sum2 += tme[i];
      }
    }
   }
  if (flag == 0) {
    printf("YES");
/*
    if (sum2 == times) {
      printf("YES");

    } else {
      printf("NO");
    }
*/
  } else {
    printf("NO");
  }

  return 0;
}

Measured memory_bytes: 896
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>


using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;

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

#define pb push_back
#define mp make_pair
#define mt make_tuple

int main(void)
{
    cin.sync_with_stdio(false);
    int N;
    cin >> N;
    int MOD = 1e9 + 7;

    vector<char> chars{'A', 'C', 'G', 'T'};
    map<string, int> m;
    REP(n, N) {
        if (n == 0) {
            m["A"] = 1;
            m["G"] = 1;
            m["C"] = 1;
            m["T"] = 1;
        } else {
            map<string, int> new_m;
            for(auto kv: m) {
                auto str = kv.first;
                auto num = kv.second;

                for (auto ch: chars) {
                    auto str2 = str + ch;

                    if (str2 == "AGC" || str2 == "GAC" || str2 == "ACG") {
                        continue;
                    }
                    if (str2 == "AGGC" || str2 == "ACGC" || str2 == "ATGC"
                        || str2 == "AGAC" || str2 == "AGTC") {
                        continue;
                    }

                    string str3;
                    if (SIZE(str2) == 4) {
                        FOR(i, 1, SIZE(str2)) str3 += str2[i];
                    } else {
                        str3 = str2;
                    }
                    
                    if (str3 == "AGC" || str3 == "GAC" || str3 == "ACG") {
                        continue;
                    }

                    new_m[str3] += num;
                    new_m[str3] %= MOD;
                }
            }
            m = new_m;
            // cout << "===" << endl;
            // for(auto kv: m) cout << kv.first << ": " << kv.second << endl;
        }
    }
    ll ans = 0;
    for(auto kv: m) {
        ans += kv.second;
        ans %= MOD;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#define int long long
using namespace std;
 
const int MAX_N = 100000;
 
signed main() {
	int N, a[MAX_N], b[MAX_N];
	int ret = 0;
	scanf("%ld", &N);
	for (int i = 0; i < N; i++) {
		scanf("%ld %ld", &a[i], &b[i]);
	}
	for (int i = N - 1; i >= 0; i--) {
		int ii = a[i] + ret;
		if (ii == 0) continue;
		int iii  = ii % b[i];
		if (iii == 0) continue;
		if (ii > b[i]) {
			ret += (b[i] - iii);
		} else if (ii < b[i]) {
			ret += (b[i] - ii);
		}
	}
	cout << ret <<endl;
	return 0;
}

Measured memory_bytes: 1792
x = parse.(split(readline()))
y = parse.(split(readline()))

M = x[2]
S = sum(y)
const T = S/(4*M)
frag = 0
ys = sort(y,rev=true)
for i in [i for i = 1:M]
    if(ys[i] < T)
        frag=1
    end
end
if frag == 1
    println("No")
else
    println("Yes")
end

Measured memory_bytes: 177396
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stdio.h>
#include <list>
#include <numeric>
#include <stack>
#include <queue>
#include <tuple>
#include <bitset>
#include <map>
#include <math.h>
//　ceil(a/b)   (a + (b - 1))/ b
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
typedef long long ll;
typedef pair<int,int> P;
const int inf=1000000007;
const int mod=1000000007;
const double PI=3.14159265358979323846;
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};

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


// ll memo[2020][2020];
// int pascal_triangle(){
//   for(int i = 0; i < 2020; i++){
//     for(int j = 0; j < i+1; j++){
//       if(j == 0 || j == i) memo[i][j] = 1;
//       else{
// 	memo[i][j] = (memo[i-1][j-1]+memo[i-1][j]);
//       }
//     }
//   }
//   return 0;
// }


// int factorial(int n){
//   if(n == 0) return 1;
//   return n*factorial(n-1);
// }

// int divisor(int a){
//   int cnt = 0;
//   for(int i=1; i <= a; i++) if(a%i == 0) cnt++;
//   return cnt;
// }

// int comb(int n, int k){
//   return fact(n) / (fact(n-k)*fact(k));
// }

int answer(bool f){
  if(f) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}






int main(){
  double a,b,x,val,v;
  cin >> a >> b >> x;
  val = (2*b*a*a - 2*x)/(pow(a,3));
  v = a*a*b/2;
  if(x >= v){
    double ans = atan(val)/(2*PI) * 360;
    printf("%.10lf\n",ans);
  }
  else{
    val = a*b*b/(2*x);
    double ans = atan(val)/(2*PI)*360;
    printf("%.10lf\n",ans);
  }
  



  
  return 0;
}







Measured memory_bytes: 256
import math
A, B = map(int, input().split())

down_a = math.ceil(A / 0.08)
up_a = math.ceil((A+1) / 0.08)
down_b = int(B / 0.1)
up_b = int((B+1) / 0.1)

a = [i for i in range(down_a, up_a)]
b = [j for j in range(down_b, up_b)]

ans = -1
for num in a:
  if num in b:
    ans = num
    break;
print(ans)

Measured memory_bytes: 3064
#include <cstdio>
#include <set>
using namespace std;

set<int> s[2];
int n,u,v,m;

int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++)
	{
		scanf("%d%d",&u,&v);
		if (u==1) s[0].insert(v);
		else if (u==n) s[1].insert(v);
		else if (v==1) s[0].insert(u);
		else if (v==n) s[1].insert(u);
	}
	
	for(set<int>::iterator ii=s[0].begin();ii!=s[0].end();ii++)
	{
		if (s[1].find(*ii)!=s[1].end())
		{
			printf("POSSIBLE\n");
			return 0;
		}
	}
	
	printf("IMPOSSIBLE\n");
	return 0;
}

Measured memory_bytes: 9600
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,sse4,popcnt,abm,mmx")

#include <bits/stdc++.h>
#define pb push_back
#define pp pop_back()
#define mp make_pair
#define f first
#define s second
#define y1 yasfasf
#define kz ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define FILE "substring"

#define fr freopen(FILE".in", "r", stdin); freopen(FILE".out", "w", stdout);
using namespace std;
typedef pair <int, int> pii;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef struct node* treap;

const int N = 1e5 + 11, inf = 1e9;
const ll linf = 1e18, mod = 1e9 + 7;

int main(){
	string s;
	cin >> s;
	if(s.size() >= 4 && s.substr(0, 4) == "YAKI")
		cout << "Yes";
	else cout << "No";
	return 0;
}           

Measured memory_bytes: 256
import java.text.DecimalFormat;
import java.util.stream.LongStream;
import java.util.stream.IntStream;
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        AtCoder problem = new AtCoder(sc);
        problem.solve(out);

        out.flush();
    }

}

class AtCoder {

    final int N;

    AtCoder(FastScanner sc) {
        N = sc.nextInt();
    }

    void solve(PrintWriter out) {
        out.println(N * (N + 1) / 2);
    }

}

// https://qiita.com/p_shiki37/items/a0f6aac33bf60f5f65e4
class FastScanner {

    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;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
            ptr++;
        }
        return hasNextByte();
    }

    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();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
            throw new NumberFormatException();
        }
        return (int) nl;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


Measured memory_bytes: 21844
#include<stdio.h>
#include<string.h>

int main(){
	int i;
	char str[21],m[21];
	fgets(str,sizeof(str),stdin);
	for(i=strlen(str)-1;i>=0;i--){
		m[strlen(str)-i-1]=str[i];
	}
	m[strlen(str)]='\0';
	printf("%s\n",m);
	return 0;
}

Measured memory_bytes: 524
// Copyright 2017 wu_qing
#include <stdint.h>
#include <cstdio>
#include <cmath>
int64_t powe[20], d, ans;
int64_t dfs(int64_t l, int64_t r, int64_t d) {
    if (l >= r) {
        if (d == 0)
            return l == r ? 10 : 1;
        return 0;
    }
    if (d % 10 == 0) {
        if (l != 1) return 10 * dfs(l + 1, r - 1, d / 10);
        return 9 * dfs(l + 1, r - 1, d / 10);
    }
    int64_t dif = d % 10 - 10;
    int64_t nxt = d - dif + dif * powe[r - l];
    if (l == 1) return (9 + dif) * dfs(l + 1, r - 1, std::abs(nxt) / 10);
    return (10 + dif) * dfs(l + 1, r - 1, std::abs(nxt) / 10);
}
int main() {
    scanf("%lld", &d);
    powe[0] = 1;
    for (int i = 1; i <= 18; i++)
        powe[i] = powe[i - 1] * 10;
    for (int i = 2; i <= 18; i++)
        ans += dfs(1, i, d);
    printf("%lld\n", ans);
    return 0;
}


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

using namespace std;
using LL = long long int;

const int MAX_N = 55;
int N;
int A[MAX_N];

using II = pair<int, int>;
vector<II> vec;

int main()
{
  cin >> N;

  int Max = -1145141919; int maxIndex;
  int Min = 1145141919; int minIndex;
  for(int i = 0; i < N; i++) {
    cin >> A[i];
    if(Max < A[i]) {
      Max = A[i];
      maxIndex = i;
    }
    if(Min > A[i]) {
      Min = A[i];
      minIndex = i;
    }
  }

  if(abs(Min) <= Max) {
    for(int i = 0; i < N; i++) {
      if(A[i] < 0) {
        vec.push_back(II(maxIndex+1, i+1));
      }
    }
    for (int i = 0; i < N-1; i++) {
      vec.push_back(II(i+1, i+2));
    }
  } else {
    for(int i = 0; i < N; i++) {
      if(A[i] > 0) {
        vec.push_back(II(minIndex+1, i+1));
      }
    }
    for(int i = N-1; 0 < i; i--) {
      vec.push_back(II(i+1, i));
    }
  }

  cout << vec.size() << endl;
  for(int i = 0; i < vec.size(); i++) {
    cout << vec[i].first << " " << vec[i].second << endl;
  }

  return 0;
}


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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,g;cin >> n >> g;
	vector<int> p(n),c(n);
	rep(i,n) cin >> p.at(i) >> c.at(i);
	int ans=1000000000;
	rep(i,1<<n){
		int sum=0,num=0;
		vector<bool> b(n,false);
		rep(j,n){
			if(i&(1<<j)){
				sum+=p.at(j)*(j+1)*100+c.at(j);
				num+=p.at(j);
				b.at(j)=true;
			}
		}
		if(sum<g){
			for(int j=n-1;j>=0;j--){
				if(b.at(j)) continue;
				if(p.at(j)*(j+1)*100<g-sum){
					sum+=p.at(j)*(j+1)*100+c.at(j);
					num+=p.at(j);
				}
				else{
					num+=(g-sum+(j+1)*100-1)/((j+1)*100);
					sum+=g;
				}
				if(sum>=g) break;
			}
		}
		ans=min(ans,num);
	}
	cout << ans << endl;
}

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

const int64 mod = 1e9+7;

int main(void){
	int32 N;
	string s, t;
	cin >> N >> s >> t;
	REP(i, s.size()){
		bool ok = 1;
		FOR(j, i, s.size()){
			if(s[j] != t[j-i]) ok = 0;
		}
		if(ok){
			cout << i+N << endl;
			return 0;
		}
	}
	cout << 2*N << endl;
}

Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	a := make([][3]int, N)
	for i := 0; i < N; i++ {
		fmt.Scan(&a[i][0], &a[i][1], &a[i][2])
	}

	dp := make([][3]int, N+1)
	for i := 0; i < N; i++ {
		for j := 0; j < 3; j++ {
			for k := 0; k < 3; k++ {
				if j == k {
					continue
				}
				dp[i+1][k] = max(dp[i+1][k], dp[i][j]+a[i][k])
			}
		}
	}

	ans := 0
	for j := 0; j < 3; j++ {
		ans = max(ans, dp[N][j])
	}
	fmt.Println(ans)
}

func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}


Measured memory_bytes: 8192
package main

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

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

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

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	x := 1
	for ; x*x <= n; x++ {
	}
	fmt.Println((x - 1) * (x - 1))
}


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

const int MOD = 998244353;

int Power(int n, int x) {
  if (x == 0) return 1;
  int res = Power(n, x / 2);
  res = 1ll * res * res % MOD;
  if (x & 1) res = 1ll * res * n % MOD;
  return res;
}

const int INV = Power(Power(10, 18), MOD - 2);

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

  int N;
  cin >> N;
  vector<vector<int>> contrib(3);
  for (int g = 0; g < 3; g++) {
    int M;
    cin >> M;
    vector<vector<int>> adj(N);
    for (int i = 0; i < M; i++) {
      int u, v;
      cin >> u >> v;
      u--, v--;
      if (u > v) {
        swap(u, v);
      }
      adj[u].emplace_back(v);
    }
    int cur = Power(10, 18 * N);
    vector<int> used(N);
    vector<int> grundy(N);
    for (int i = N - 1; i >= 0; i--) {
      for (auto j : adj[i]) {
        used[grundy[j]] = 1;
      }
      while (used[grundy[i]]) grundy[i]++;
      while (int(contrib[g].size()) <= grundy[i]) {
        contrib[g].push_back(0);
      }
      contrib[g][grundy[i]] += cur;
      contrib[g][grundy[i]] %= MOD;
      cur = 1ll * cur * INV % MOD;
      for (auto j : adj[i]) {
        used[grundy[j]] = 0;
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < (int) contrib[0].size(); i++) {
    for (int j = 0; j < (int) contrib[1].size(); j++) {
      int k = i ^ j;
      if (k < (int) contrib[2].size()) {
        ans += 1ll * contrib[0][i] * contrib[1][j] % MOD * contrib[2][k] % MOD;
        ans %= MOD;
      }
    }
  }
  cout << ans << "\n";
  return 0;
}


Measured memory_bytes: 8508
#include <bits/stdc++.h>
const int maxn=1e5+5;
const int mod=1e9+7;
#define ll long long
using namespace std;
ll a[maxn],b[maxn];
ll aa[maxn],bb[maxn];
int main()
{
    int i,j,n,m;
    ll h=0,w=0;
    scanf("%d%d",&n,&m);
    for(i=1; i<=n; i++)
    {
        scanf("%lld",&a[i]);
    }
    for(i=1; i<=m; i++)
    {
        scanf("%lld",&b[i]);
    }
//    for(i=1; i<=n; i++)
//    {
//        scanf("%d",&a[i]);
//        aa[i]=aa[i-1]+a[i];
//    }
//    for(i=1; i<=m; i++)
//    {
//        scanf("%d",&b[i]);
//        bb[i]=bb[i-1]+b[i];
//    }
//    for(i=1; i<n; i++)
//    {
//        h+=aa[n]-aa[i]-(a[i]%mod*(n-i)%mod)%mod;
//        if(h>=mod) h-=mod;
//    }
//    cout<<h<<endl;
//    for(i=1; i<m; i++)
//    {
//        w+=bb[m]-bb[i]-b[i]*(m-i);
//        if(w>=mod) w-=mod;
//    }
//    cout<<w<<endl;
    for(int l=1, r=n; l<r; ++l,--r)
        w = (w + (a[r]-a[l])*(r-l))%mod;
    for(int l=1, r=m; l<r; ++l,--r)
        h = (h + (b[r]-b[l])*(r-l))%mod;
    cout<<(w*h)%mod<<endl;
    return 0;
}
/*622259192
993828220*/


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep2(i, m, n) for(int i=int(m); i<int(n); ++i)
#define drep2(i, m, n) for(int i=int(m-1); i>=int(n); --i)
#define rep(i, n) rep2(i, 0, n)
#define drep(i, n) drep2(i, n, 0)
#define all(a) a.begin(), a.end()
#define fst first
#define snd second
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using VV = vector<V>;
using VVll = vector<Vll>;
using VVld = vector<Vld>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
const int INF = 1<<30;
const ll INFll = 1ll<<62;
const ld EPS = 1e-10;
const int MOD = int(1e9)+7;
template<typename T> inline bool chmin(T& a, T b) {if(a>b) {a=b; return true;} return false;}
template<typename T> inline bool chmax(T& a, T b) {if(a<b) {a=b; return true;} return false;}
inline int Log2(ll x) {int k; for(k=0; x>0; ++k) x>>=1; return k;} // number of binary digits
template<typename T> inline int count_between(vector<T>& a, T l, T r) {
  return lower_bound(all(a), r) - lower_bound(all(a), l); // [l, r)
}


int main() {
  ll N; cin >> N;
  Vll s(N);
  rep(i, N) cin >> s[i];

  ll ans = 0;
  rep2(c, 1, N) {
    ll sum = 0;
    for (ll k = 1; (k+1)*c < N-1; k++) {
      if (N-1 == (2*k-1)*c || N-1 == 2*k*c) break;
      sum += s[k*c] + s[N-1-c*k];
      chmax(ans, sum);
    }
  }

  cout << ans << endl;
  return 0;
}


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

int main() {
  map<char, int> m;
  string s;
  cin >> s;
  for(int i = 0; i < s.size(); ++i){
    if(m.count(s[i])) ++m[s[i]];
    else m[s[i]] = 1;
  }
  bool b = 1;
  for(auto p: m){
    if(m[p.first] % 2 == 1){
      b = 0;
      break;
    }
  }
  if(b) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
namespace FAST_IO
{
	template<typename T> void read(T &a)
	{
		a=0;
		int f=1;
		char c=getchar();
		while(!isdigit(c))
		{
			if(c=='-')
			{
				f=-1;
			}
			c=getchar();
		}
		while(isdigit(c))
		{
			a=a*10+c-'0';
			c=getchar();
		}
		a=a*f;
	}
	template <typename T> void write(T a)
	{
		if(a<0)
		{
			a=-a;
			putchar('-');
		}
		if(a>9)
		{
			write(a/10);
		}
		putchar(a%10+'0');
	}
	template <typename T> void writeln(T a)
	{
		write(a);
		puts("");
	}
}
map<int,int> k;
bool check(int n)
{
	stringstream p;
	p<<n;
	string qq;
	p>>qq;
	for(int i=0;i<qq.size();i++)
	{
		if((k.find(i+1)!=k.end())&&(k[i+1]!=qq[i]-'0'))
		{
			return false;
		}
	}
	return true;
}
int main()
{
	int n,m,g=1;
	cin>>n>>m;
	while(m--)
	{
		int a,b;
		cin>>a>>b;
		if(k.find(a)!=k.end()&&k[a]!=b)
		{
			cout<<-1;
			return 0;
		}
		else
		{
			k[a]=b;
			g=max(a,g);
			//cout<<a<<" "<<g<<endl;
		}
	}
	int i=pow(10,n-1);
	if(n==1)
	{
		i=0;
	}
	for(;i<1000;i++)
	{
		//cout<<i;
		if(check(i))
		{
			cout<<i; 
			return 0;
		}
	}
	cout<<-1;
}


Measured memory_bytes: 896
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <algorithm>
#include <utility>
#include <tuple>

using namespace std;

int main()
{
    int n, length;
    cin >> n;
    string str;
    vector<int> count(26, 0);
    vector<int> num_min(26, 300);
    for (int i=0; i<n; ++i){
        cin >> str;
        length = str.length();
        for (int j=0; j<26; ++j){
            count[j] = 0;
        }
        for (int j=0; j<length; ++j){
            count[str[j] - 'a']++;
        }
        for (int j=0; j<26; ++j){
            num_min[j] = min(num_min[j], count[j]);
        }
    }
    const string alphabet = "abcdefghijklmnopqrstuvwxyz";
    for (int i=0; i<26; ++i){
        for (int j=0; j<num_min[i]; ++j){
            cout << alphabet[i];
        }
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];
        for (int i=0; i<n; i++) {
            a[i] = sc.nextInt();
        }

        long[][] dp = new long[n][n];
        for (int i=0; i<n; i++) {
            dp[i][i] = a[i];
        }

        for (int i = n - 2; i > -1; i--) {
            for (int j = i + 1; j < n; j++) {
                dp[i][j] = Math.max(a[i] - dp[i + 1][j], a[j] - dp[i][j - 1]);
            }
        }
        System.out.println(dp[0][n - 1]);
    }
}


Measured memory_bytes: 129320
#include <stdlib.h>
#include <stdio.h>

int main(){

	int a, b, c, d, e, k;
	scanf("%d", &a );
	scanf("%d", &b );
	scanf("%d", &c );
	scanf("%d", &d );
	scanf("%d", &e );
	scanf("%d", &k );

	if ((b - a) > k || (c - a) > k || (d - a) > k || (e - a) > k || (c - b) > k || (d - b) > k || (e - b) > k || (d - c) > k || (e - c) > k || (e - d) > k)
		printf(":(\n");
	else
		printf("Yay!\n");

	return 0;
	
}

Measured memory_bytes: 128
a,b,c=map(int,input().split())
l=[a,b,c]
l.sort()
if l[0]==l[1] and l[1]!=l[2]:
  print('Yes')
elif l[0]!=l[1] and l[1]==l[2]:
  print('Yes')
else:
  print('No')
  

Measured memory_bytes: 3060
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Integer[] ary = new Integer[3];
		ary[0] = sc.nextInt();
		ary[1] = sc.nextInt();
		ary[2] = sc.nextInt();
		Arrays.sort(ary);
		System.out.println(ary[0] * ary[1] / 2);
	}
}


Measured memory_bytes: 23508
S = input()

N=len(S)

total=0
for i in range(0, 2**(N-1)):
    answer=S[0]
    for j in range(N-1):
        if (i >> j) & 1:
            answer+='+'+S[j+1]
        else:
            answer+=S[j+1]
    total+=eval(answer)
    #print(answer)
print(total)

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


int main() {
	int N;
	cin >> N;
	vector<long> v(N + 1);
	for (int i = 0; i <= N; ++i)
		cin >> v[i];
	vector<unsigned long long int> back(N + 1);
	vector<unsigned long long int> minimum(N + 1);

	back[N] = v[N];
	minimum[N] = v[N];
	for (int i = N - 1; i >= 0; --i)
	{
		back[i] = back[i + 1] + v[i];
		minimum[i] = (minimum[i + 1] + 1) / 2 + v[i];
	}
	unsigned long  long int  ans = 1, remain = 1;
	bool flag = false;
	if (v[0] == 1 && N > 0 || (v[0]!=1 && N==0))
	{
		cout << "-1" << endl;
		return 0;
	}

	for (int i = 1; i <= N; ++i)
	{
		remain *= 2;
		if (minimum[i] > remain)
		{
			flag = true;
			break;
		}
		remain = min(remain, back[i]);
		ans += remain;
		remain -= v[i];
	}
	if (flag)
	{
		cout << "-1" << endl;
		return 0;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 5636
az = gets.split(' ').map(&:to_i)
ac = az[0] * az[2]
ad = az[0] * az[3]
bc = az[1] * az[2]
bd = az[1] * az[3]
ans = ac
if ans < ad then ans = ad end
if ans < bc then ans = bc end
if ans < bd then ans = bd end
puts ans

Measured memory_bytes: 14396
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
const int maxN = 2 * (int)1e5  + 100;
int a[maxN], b[maxN];
int n;
void bad() {
    cout << -1 << '\n';
    exit(0);
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    //freopen("input.txt", "r", stdin);
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    priority_queue < pair < int, int > > q;
    for (int i = 1; i <= n; i++) {
        cin >> b[i];
        q.push(make_pair(b[i], i));
    }
    ll op = 0;
    while (!q.empty()) {
        auto t = q.top();
        q.pop();
        int ind = t.second;
        int val = t.first;
        if (val < a[ind]) bad();
        if (val == a[ind]) {
            continue;
        }
        int c1 = b[(ind - 2 + n) % n + 1];
        int c2 = b[ind % n + 1];
        if (val < max(c1, c2)) bad();
        int total = c1 + c2;
        int moves = (val - max({c1, c2, a[ind]})) / total;
        val -= moves * total;
        op += moves;
        if (val == a[ind]) {
            b[ind] = a[ind];
            continue;
        }
        val -= total;
        op++;
        if (val < a[ind]) bad();
        b[ind] = val;
        q.push(make_pair(b[ind], ind));
        // val - total * k >= max(c1, c2, a[ind])
    }
    cout << op;
    return 0;
}

Measured memory_bytes: 3700
#include<bits/stdc++.h>
#define ll long long
#define M 50010
using namespace std;
template <typename T> void read(T &x){
	x=0;char c=getchar();int fh=1;
	while (!isdigit(c)){if (c=='-')fh=-1;c=getchar();}
	while (isdigit(c))x=x*10+c-'0',c=getchar();
	x*=fh;
}
struct edge{int x,y,z;}a[M];
int m,n,q,mod,g,bi[1000010],num,f[M*6],z,x,y,r;
int gcd(int x,int y){if (y==0) return x;if (x%y==0) return y;return gcd(y,x%y);}
int qf(int x){if (f[x]!=x) f[x]=qf(f[x]);return f[x];}
void lian(int x,int y){int nx=qf(x),ny=qf(y);if (nx!=ny) f[nx]=ny;}
int que(int x,int y,int z){return (y*3+z)*n+x;}
int main(){
	read(n);read(m);read(q);read(mod);
	for (int i=1;i<=m;i++){
		read(a[i].x);read(a[i].y);read(a[i].z);
		g=gcd(g,abs(a[i].z-a[1].z));
	}
	if (!g) g=mod;
	mod=gcd(g*3,mod);z=a[1].z%g;
	for (int i=0;i<mod;i++) bi[i]=0;
	for (int i=0;i<mod;i++)
		if (!bi[i]){num++;for (int j=i;!bi[j];j=j*4%mod) bi[j]=num;}
	for (int i=1;i<=m;i++) a[i].z-=z;
	for (int i=1;i<=n*6;i++) f[i]=i;
	for (int i=1;i<=m;i++)
		for (int j=0;j<=1;j++)
			for(int p=0;p<=2;p++){lian(que(a[i].x,j,p),que(a[i].y,j^1,(p*2+a[i].z/g)%3));lian(que(a[i].y,j,p),que(a[i].x,j^1,(p*2+a[i].z/g)%3));}
	for (int i=1;i<=q;i++){
		read(x);read(y);read(r);
		bool vi=0;
		for (int j=0;j<=1;j++)
			for (int k=0;k<=2;k++)
				if (qf(que(y,1,0))==qf(que(x,j,k))&&bi[(r+z)%mod]==bi[((2-j)*z+k*g)%mod])vi=1;
		if (vi) puts("YES");else puts("NO");
	}
	return 0;
}

Measured memory_bytes: 6016
s = list(input())

#不等号の向きを記録する
memo = ""

#不等号の連続した個数を記録する
cnt = 0

#1つ前に数えた不等号の連続した個数を記録する
before_cnt = 0

#出力する答え
ans = 0

#文字列Sの連続した不等号の向きを数える
for x in s:
    #初めはmemoが空白なので,memoに不等号の向きを記録
    if memo == "":
        memo = x
    
    #不等号の向きが同じ場合は、数を1カウントしてループに戻る
    if memo == x:
        cnt += 1
        
    #不等号の向きが異なる場合
    else:
        #ansに和を加算する
        ans += cnt * (cnt+1) // 2
        
        #不等号の向きの変化が処理が必要な場合
        if memo == ">":
            if before_cnt < cnt:
                ans -= before_cnt
            else:
                ans -= cnt

        before_cnt = cnt
        cnt = 1
        memo = x
else:
    ans += cnt * (cnt+1) // 2
    if before_cnt < cnt:
        if memo == ">":
            ans -= before_cnt
    else:
        if memo == ">":
            ans -= cnt
    before_cnt = cnt
    cnt = 0
 
print(ans)

Measured memory_bytes: 13216