akhauriyash/Code-Regression huggingface dataset:
n,m,c=map(int,input().split())
b=input().split()
b=[int(i) for i in b]
a=[input().split() for i in range(n)]
a=list([int(i) for i in j] for j in a)
count=0

for i in range(n):
  total=0
  for j in range(m):
    total+=a[i][j]*b[j]
  if total+c>0:
    count+=1
print(count)
       


Measured memory_bytes: 38256
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, M = map(int, readline().split())

    ans = ((N - M) * 100 + 1900 * M) * pow(2, M)

    print(ans)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 9092
#include <stdio.h>

main(void)
{
  char *pVal = (char *) malloc(sizeof(char) * 4);
  gets(pVal);

  int val = 0;
  int i = 0;
  while ('0' <= pVal[i])
  {
    val = val * 10 + pVal[i] - '0';
    i ++; 
  }

  int pages_duplex = (val%2==0) ? val / 2 : val / 2 + 1;
  printf("%d", pages_duplex);
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountl
#define m_p make_pair
#define inf 1000000000000000000ll
#define MAXN 1000001
#define eps 0.0000000001
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
string char_to_str(char c){string tem(1,c);return tem;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<class T>//usage rand<long long>()
T rand() {
    return uniform_int_distribution<T>()(rng);
}

// string to integer stuuu()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();

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

#define S second
#define F first
#define int long long  
///////

signed main()
{
	fastio;
	#ifdef ANIKET_GOYAL
		freopen("inputf.in","r",stdin);
		freopen("outputf.in","w",stdout);
	#endif
	int n,m;
	cin>>n>>m;
	int a[m];
	for(int i=0;i<m;++i)
	{
		int v=0;
		int k;
		cin>>k;
		while(k)
		{
			--k;
			int  d;
			cin>>d;
			--d;
			v+=(1ll<<d);
		}
		a[i]=v;
	}
	int ans =0;
	int p[m];
	for(int i=0;i<m;++i)
		cin>>p[i];
	for(int i=0;i<(1<<n);++i)
	{
		int fl=1;
		for(int j=0;j<m;++j)
		{
			if(__builtin_popcountl((a[j]&i))%2!=p[j])
			{
				fl=0;
			}
		}
		ans+=fl;
	}
	cout<<ans;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<stdlib.h>
#include<string.h>
#include<queue>
#define LL long long
using namespace std;
inline int read( )
{
  int sum=0;char c=getchar( );bool f=0;
  while(c<'0'||c>'9') {if(c=='-') f=1;c=getchar( );}
  while(c>='0'&&c<='9') {sum=sum*10+c-'0';c=getchar( );}
  if(f) return -sum;
  return sum;
}
int n,a[700005];
int main( )
{
  int i,j,n3;
  n=read( );n3=n*3;
  for(i=1;i<=n3;i++) a[i]=read( );
  sort(a+1,a+n3+1);
  LL ans=0;
  for(i=n+1;i<=n3;i+=2) ans+=a[i];
  cout<<ans;
}


Measured memory_bytes: 1408
const mask = (s) => {
  let m = []
  let cnt = 0
  let map = {}
  s.split("").map((c) => {
    if (!map[c]) {
      map[c] = cnt
      cnt++
    }
    m.push(map[c])
  })
  return m
}
const solve = (s, t) => {
  return mask(s).join("-") === mask(t).join("-") ? "Yes" : "No"
}
const main = (input) => {
  const n = input.split("\n")
  const [s, t] = input.split("\n")
  return solve(s, t)
}

if (process.env.NODE_ENV !== "test") {
  const input = require("fs").readFileSync("/dev/stdin", "utf8")
  console.log(main(input.trim()))
}

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

int main()
{
    using namespace std;
    int n,k;
    cin >> n >> k;
    for(int i=0;;i++){
      //cout << pow(k,i) << endl;
      if(pow(k,i)>n){
        cout << i << endl;
        break;
      }
    }
    return 0;
}


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

int main() {
  int x;
  while(cin >> x) {
    int ans= 0;
    for (int i=0; i<10; i++)
      for (int j=0; j<10; j++)
        for (int k=0; k<10; k++)
          for (int l=0; l<10; l++)
            if(i+j+k+l==x) ans++;
    cout << ans << endl;
  }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define mp make_pair
using namespace std;
const int inf = 1e18 + 7;
const int N = 1e6 + 7;
const int md = 1e9 + 7;
int dist[900], vis[900];
char a[30][30];
int n, m;
int val[30][30];
std::vector<int> g[900];
int ok(int i, int j) {
  if((i >= 0 && i < n) && (j >= 0 && j < m)) {
    if(a[i][j] == '.') return 1;
  }
  return 0;
}
void bfs(int src) {
  std::queue<int> q;
  int from;
  q.push(src);
  vis[src] = 1;
  dist[src] = 0;
  while(!q.empty()) {
    from = q.front();
    q.pop();
    for(auto &to : g[from]) {
      if(vis[to]) continue;
      q.push(to);
      vis[to] = 1;
      dist[to] = dist[from] + 1;
    }
  }
}
void sol() {
  int nodes = 0;
  int ans = 0;
  cin >> n >> m;
  for(int i=0; i<n; i++) {
    for(int j=0; j<m; j++) {
      cin >> a[i][j];
    }
  }
  for(int i=0; i<n; i++) {
    for(int j=0; j<m; j++) {
      if(a[i][j] == '.') {
        val[i][j] = nodes++;
      }
    }
  }
  for(int i=0; i<n; i++) {
    for(int j=0; j<m; j++) {
      if(a[i][j] == '.') {
        if(ok(i+1, j)) {
          g[val[i][j]].push_back(val[i+1][j]);
        }
        if(ok(i, j-1)) {
          g[val[i][j]].push_back(val[i][j-1]);
        }
        if(ok(i-1, j)) {
          g[val[i][j]].push_back(val[i-1][j]);
        }
        if(ok(i, j+1)) {
          g[val[i][j]].push_back(val[i][j+1]);
        }
      }
    }
  }
  //dfs(0, 0);
  for(int i=0; i<nodes; i++) {
    memset(dist, 0, sizeof(dist));
    memset(vis, 0, sizeof(vis));
    bfs(i);
    for(int j=0; j<nodes; j++) {
      ans = max(ans, dist[j]);
    }
  }
  cout << ans << "\n";
}

int32_t main() 
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  //cin >> T; while(T--) 
  sol();
  return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
#define INF 2000000000
#define MAXN 5000001
using namespace std;

int L[MAXN/2+2],R[MAXN/2+2];
int cnt;

void merge(int A[],int n,int left,int mid,int right)
{
	int n1=mid-left;
	int n2=right-mid;
	for(int i=0;i<n1;i++)
		L[i]=A[left+i];
	for(int i=0;i<n2;i++)
		R[i]=A[mid+i];
	L[n1]=R[n2]=INF;
	int i=0,j=0;
	for(int k=left;k<right;k++)
	{
		cnt++;
		if(L[i]<=R[j])
			A[k]=L[i++];
		else
			A[k]=R[j++];
	}
}

void mergesort(int A[],int n,int left,int right)
{
	if(left+1<right)
	{
		int mid=(left+right)/2;
		mergesort(A,n,left,mid);
		mergesort(A,n,mid,right);
		merge(A,n,left,mid,right);
	}
}

int main()
{
	int n,A[MAXN];
	cnt=0;
	cin >> n;
	for(int i=0;i<n;i++)
		cin >> A[i];
	
	mergesort(A,n,0,n);
	
	for(int i=0;i<n;i++)
	{
		if(i)
			cout << " ";
		cout << A[i];
	}
	cout << endl;
	cout << cnt << endl;
	return 0;
}


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

int main()
{
  int N, X;
  cin >> N >> X;
  
  int sum = 0;
  int min = 1000;
  int donut;
  for (int i = 0; i < N; i++) {
    cin >> donut;
    if (donut < min) {
      min = donut;
    }
    sum += donut;
  }
  cout << N + ((X - sum) / min) << endl;
}

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

if N != 0 and M != 0:
  answer = N*(N-1)/2 + M*(M-1)/2
  print(int(answer))
elif N == 0:
  answer = M*(M-1)/2
  print(int(answer))
else:
  answer = N*(N-1)/2
  print(int(answer))

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

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

  int n,k;
  cin >> n>>k;

  double ans = 0;
  repr(i,1,n+1){
    int x= i, c=0;
    while(x<k){
      x*=2;
      c++;
    }

    ans+= (1 / (double)n) * (1 / pow(2, c));
  }

  cout<<fixed<<setprecision(12)<<ans<<endl;
}


Measured memory_bytes: 4204
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define int long long
#define double long double
#define mod 1000000007
#define F first
#define S second
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
#define INF 1000000000000000000
#define endl '\n'
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; }
using namespace std;

inline int nCr(int n, int r){
    int res=1;
    vector<bool> done(r,false);
    for(int i=n; i>n-r; i--){
        res*=i;
        for(int j=1; j<=r; j++){
            if(res%j==0 and !done.at(j-1)){
                res/=j;
                done.at(j-1)=true;
            }
        }
    }
    return res;
}

signed main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,a,b; cin>>n>>a>>b;
    vector<int> v(n);
    rep(i,n)cin>>v.at(i);
    sort(all(v),greater<int>());
    int sum=0; int last=v.at(a-1);
    rep(i,a)sum+=v.at(i);
    cout<<setprecision(30)<<1.*sum/a<<endl;
    if(last==v.front()){
        int cnt=0;
        rep(i,n)if(v.at(i)==last)cnt++;
        int ans=0;
        for(int i=a; i<=b; i++){
            ans+=nCr(cnt, i);
        }
        cout<<ans<<endl;
    }else{
        int cnt=0,cnt2=0;
        rep(i,a)if(v.at(i)==last)cnt++;
        rep(i,n)if(v.at(i)==last)cnt2++;
        cout<<nCr(cnt2, cnt)<<endl;
    }
}

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

int main() {
    int n, x;
    cin >> n >> x;
    vector<int> m(n);
    int sum = 0;
    for (int i=0; i<n; i++) {
        cin >> m[i];
        sum += m[i];
    }
    int zan = x - sum;
    sort(m.begin(), m.end());
    int count = n;
    while(true) {
        if (zan >= m[0]) {
            zan -= m[0];
            count++;
        } else {
            break;
        }
    }

    cout << count << endl;

    return 0;
}

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

#define vi vector<int>
#define vl vector<ll>
#define vvi vector<vector<int>>
#define vvl vector<vector<ll>>
// constexpr ll mod = 1e9 + 7;

int main(){
    ll H, W;
    cin >> H >> W;
    ll ans = H*(W/2) + (W%2)*((H+1)/2);

    if(H==1 || W==1) {
        cout << 1 << endl;
        return 0;
    }

    cout << ans << endl;


    return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
    long long N, ans, f, b, fb;
  	cin >> N;
    ans = N*(N+1) / 2;
    f = N/3;
    b = N/5;
    fb = N/15;
    ans = ans - 3*f*(f+1)/2 - 5*b*(b+1)/2 + 15*fb*(fb+1)/2;
    cout << ans;
}

Measured memory_bytes: 3596
N = int(input())
ret = {}
for i in range(N):
    word = input()
    if word not in ret:
        ret[word] = 0
    else:
        ret[word] += 1
max_value = max(ret.values())
max_keys = [key[0] for key in ret.items() if key[1]==max_value]
max_keys = sorted(max_keys)
for key in max_keys:
    print(key)

Measured memory_bytes: 32988
#include<iostream>
using namespace std;
int main(){
  int a,b;
  cin>>a>>b;
  if(a%3==0||b%3==0||(a+b)%3==0){
    cout<<"Possible"<<endl;
  }else{
   	cout<<"Impossible"<<endl;
  }
  return(0);
}


Measured memory_bytes: 3632
X = int(input())

if X >= 400 and X <= 599:
    print(8)
elif X >= 600 and X <= 799:
    print(7)
elif X >= 800 and X <= 999:
    print(6)
elif X >= 1000 and X <= 1199:
    print(5)
elif X >= 1200 and X <= 1399:
    print(4)
elif X >= 1400 and X <= 1599:
    print(3)
elif X >= 1600 and X <= 1799:
    print(2)
else:
    print(1)

Measured memory_bytes: 9196
#include <cstdio>
#include <string>
#include <iostream>
using namespace std;
int main(){
	string s;
	cin >> s;
	if (s.size() % 2 == 1){
		printf("No\n");
		return 0;
	}
	for (int i = 0; i < s.size(); i += 2){
		if (s[i] != 'h' || s[i + 1] != 'i'){
			printf("No\n");
			return 0;
		}
	}
	printf("Yes\n");
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<cmath>
#pragma GCC optimize("Ofast")
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
const ll MOD = 1000000007;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};
#define print(x) cout << (x) << endl;
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
#define fs first
#define sc second
 
template<typename T>
T gcd(T a,T b){return b?gcd(b,a%b):a;}

const int INF = 1e9;
const ll LLINF = 1e16;
 
template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}
 
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
 
template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}
 
template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}
 
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
 
template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

// 割り算の切り上げ処理
template<typename T>
T round_up(T a, T b) {
  return (a + b - 1) / b;
}


using pint = pair<int, int>;
using pll = pair<ll, ll>;


int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    int n;
    cin >> n;
    int ans = 1;
    if(n < 105) {
      print(0);
      return 0;
    } else {
      REP(i, 107, n + 1){
        int count = 0;
        if(i % 2 == 0) continue;
        REP(j, 1, i + 1){
          if(i % j == 0) count++;
        }
        if(count == 8) ans++;
      }
    }
    print(ans);
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int a,b,c,d,n,count=0;
  while(scanf("%d",&n)!=EOF){
    for(a=0;a<10;a++){
      for(b=0;b<10;b++){
	for(c=0;c<10;c++){
	  for(d=0;d<10;d++){
	    if(a+b+c+d==n){
	      count++;
	    }
	  }
	}
      }
    }
    printf("%d\n",count);
    count=0;
  }
  return(0);
}

Measured memory_bytes: 1024
n, m = [int(x) for x in input().split()]
if n == 1 and m == 1:
    ans = 1
elif n == 1 or m == 1:
    ans = max(n, m) - 2
else:
    ans = n * m - 2 * n - 2 * m + 4
print(ans)

Measured memory_bytes: 3060
import itertools

n, y = map(int, input().split())
y = y // 1000

l = list(range(n+1))
for v, vv in itertools.combinations_with_replacement(l, 2):
    itiman = v
    gosen = vv - v
    sen = n - vv
    if y == itiman*10 + gosen*5 + sen:
        print(itiman, gosen, sen)
        exit()
print(-1, -1, -1)

Measured memory_bytes: 3060
package main

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

var n, k, q int
var sc = bufio.NewScanner(os.Stdin)

func nextLine() int {
	sc.Scan()
	a, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return a
}

func main() {
	fmt.Scan(&n, &k, &q)
	as := make([]int, q)

	for i := 0; i < q; i++ {
		as[i] = nextLine()
	}

	pts := make([]int, n)
	for i := 0; i < n; i++ {
		pts[i] = k - q
	}
	for _, a := range as {
		pts[a-1]++
	}

	for _, pt := range pts {
		if pt > 0 {
			fmt.Println("Yes")
		}else {
			fmt.Println("No")
		}
		}
}


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

public class Main{
  public static void main(String[] args) {
    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))){
      String[] sArr = in.readLine().split(" ");
      int A = Integer.parseInt(sArr[0]);
      int B = Integer.parseInt(sArr[1]);
      if (A+B >= 10){
        System.out.println("error");
      }else{
        System.out.println(A+B);
      }
    }catch(IOException e){
      e.printStackTrace();
    }
  }
}


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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0; i<n; i++){
    cin >> a[i];
  }
  
  int max = 0;
  int secmax = 0;
  
  for(int i=0; i<n; i++){
    if(a[i] >= max) max = a[i];
    if(a[i] >= secmax && a[i] < max) secmax = a[i];
    if(i == n-1 && secmax == 0) secmax = a[i-1];
  }
  
  int count = 0;
  
  for(int i=0; i<n; i++){
    if(a[i] == max) count++;
  }
  
  for(int i=0; i<n; i++){
    if(count == 1){
      if(a[i] == max){
      cout << secmax << endl;
      }
      else{
        cout << max << endl;
      }
    }
    else{
      cout << max << endl;
    }
  }
    
	return 0;
}


Measured memory_bytes: 2432
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
int main() {
  char c;
  cin >> c;
  if (islower(c)) cout << "a" << endl;
  else cout << "A" << endl;
  return 0;
}

Measured memory_bytes: 3636
import java.util.*;
 
public class Main {
    public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int w = sc.nextInt();
		int[][] moves = new int[h][w];
		char[][] map = new char[h][w];
		for (int i = 0; i < h; i++) {
			String s = sc.next();
			for (int j = 0; j < w; j++) {
				if (s.charAt(j) == '#')
					map[i][j] = '#';
				else
					map[i][j] = '.';
			}
		}

		for(int i=0; i<h; i++){
			int count = 0;
			for(int j=0; j<w; j++){
				if(map[i][j] == '.'){
					count++;
					if(j==w-1){
						int k = j;
						while(k>=0 && map[i][k] == '.'){
							moves[i][k] = count;
							k--;
						}
					}
				} else {
					int k = j-1;
					while(k>=0 && map[i][k] == '.'){
						moves[i][k] = count;
						k--;
					}
					count = 0;
				}
			}
		}

		for(int i=0; i<w; i++){
			int count = 0;
			for(int j=0; j<h; j++){
				if(map[j][i] == '.'){
					count++;
					if(j==h-1){
						int k = j;
						while(k>=0 && map[k][i] == '.'){
							moves[k][i] += count;
							k--;
						}
					}
				} else {
					int k = j-1;
					while(k>=0 && map[k][i] == '.'){
						moves[k][i] += count;
						k--;
					}
					count = 0;
				}
			}
		}
		int ans = 0;
		for(int i=0; i<h; i++){
			for(int j=0; j<w; j++){
				ans = Math.max(ans, moves[i][j]-1);
			}
		}
		System.out.println(ans);
	}
}


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

int main (void) {
    int a, b, num = 1, ans = 0;
    scanf("%d%d", &a, &b);

    while ( num < b )
    {   /* A を一つ使う */
        num += a - 1;
        ans++;
    }

    printf("%d\n", ans);
    return EXIT_SUCCESS;
}  

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

int64_t MOD = 1000000007;
int64_t MAX = 9223372036854775807;
double PI = 3.141592653589793;

int main()
{
    int64_t N, Q, tmp;
    cin >> N;
    unordered_map<int, int> hist;
    int64_t sum = 0;
    for (int i = 0; i < N; i++)
    {
        cin >> tmp;
        sum += tmp;
        hist[tmp]++;
    }
    cin >> Q;
    int B, C;
    for (int i = 0; i < Q; i++)
    {
        cin >> B >> C;
        sum += hist[B] * (C - B);
        cout << sum << endl;
        hist[C] += hist[B];
        hist.erase(B);
    }
}

Measured memory_bytes: 6612
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <cstdio>
using namespace std;

int main(){
	int n,a,b;
	cin >> n >> a>> b;
	if(a*n>b){
		cout << b << endl;
	}else{
		cout << a*n << endl;
	}
}

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

#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,n) for (int i = 0; i < n; i++)
#define forr(i,a,b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb(x) push_back(x)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;

int main () {
	ios_base::sync_with_stdio(0); cin.tie(0);
	
	ll n, p, res = 1;
	cin >> n >> p;

	for (ll i = 2; i * i <= p; i++) {
		int pw = 0;
		while (p % i == 0)
			p /= i, pw++;
		res *= pow(i, pw / n);
	}

	if (n == 1)
		res *= p;

	cout << res << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <functional>
#include <vector>
#include <queue>
#define nmax_def 110000
using namespace std;
typedef long long ll;

int main() {
	ll i, j;
	ll N, A[nmax_def], x[nmax_def], AsumOE[nmax_def], xsum = 0;
	cin >> N;
	AsumOE[0] = 0;
	AsumOE[1] = 0;
	for (i = 0; i < N; i++)
	{
		ll a;
		cin >> a;
		A[i] = a;
		AsumOE[i + 2] = AsumOE[i] + a;
		xsum += a;
	}
	for (i = 0; i < N; i++)
	{
		ll sumtmp = 0;
		sumtmp += AsumOE[i];
		if (i < N - 1)
		{
			sumtmp += AsumOE[N + i % 2];
			sumtmp -= AsumOE[i + 1];
		}
		x[i] = xsum - sumtmp * 2;
		cout << x[i] << " ";
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 2048
#include<bits/stdc++.h>
using namespace std;
//#pragma comment(linker, "/STACK:102400000,102400000")
typedef long long ll;
typedef pair<int,int> P;
#define ls(x) (x<<1)
#define rs(x) (x<<1|1)
#define lowbit(x) (x&-x)
const ll INF=0x3f3f3f3f;
const double EPS=1e-7;
const int N=3e5+10;
const ll mod=1e9+7;
const ll MOD=998244353;
inline ll read()  
{  ll f=1,x=0;char ch=getchar();
   for(;ch>'9'||ch<'0';ch=getchar())if(ch=='-') f=-1;
   for(;ch<='9'&&ch>='0';ch=getchar())x=(x<<3)+(x<<1)+(ch^48);
   return x*f;
}
ll n,ans,x,k,d;
ll a[N];
int main()
{  cin>>x>>k>>d;
   x=abs(x);
   ll cnt=x/d;
   if(cnt>=k)
   {  printf("%lld\n",x-d*k);
   }
   else
   {  k=k-cnt;
      if(k%2==1)printf("%lld\n",-(x%d-d));
      else printf("%lld\n",x%d);
   }
}

Measured memory_bytes: 3760
<?php
$input = STDIN;

$n = trim(fgets($input));

$seq = explode(' ', trim(fgets($input)));

// Bubble Sort
$cnt = 0;
for ($i = 0; $i < $n; $i++) {
    for ($j = $n - 1; $j > $i; $j--) {
        if ($seq[$j] < $seq[$j-1]) {
            list($seq[$j-1], $seq[$j]) = array($seq[$j], $seq[$j-1]);
            $cnt++;
        }
    }
}

print implode(' ', $seq) . "\n";
print $cnt . "\n";


Measured memory_bytes: 9284
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define cool ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	#define int  long long int
	#define pb push_back
	#define fe first
    #define lb lower_bound 
    #define ub upper_bound
    #define pii pair<pair<int,int>,pair<int,int> >
	#define se second
	#define endl "\n"
	#define pi pair<int, int>
	#define vi vector<int> 
	#define vvi vector<vi>
    #define bs   binary_search
	#define rep(i,a,b) for(int i=a;i<b;i++)
	#define rep1(i,a,b) for(int i=a;i<=b;i++)	
    #define all(c) (c).begin(),(c).end()
    #define sz(x)       (int)x.size() 
	#define PI 3.14159265358979323846
    
	 const int N =2e5+5;
    
     int mod= 1e9+7,INF=1e17;
     
     int dx[4]={0,0,+1,-1};
     int dy[4]={+1,-1,0,0};
 
     void solve(){
         
         int l,r,f1=0;
         cin>>l>>r;
         
       
        
         int vg=2019;
        
        if(l%vg==0 || r%vg==0){
		   cout<<0<<endl;
		   return;		
		}
		
		int nx1=l/vg,nx2=r/vg;
		if(abs(nx1-nx2)>=1){
			cout<<0<<endl;
			return;
		}
		
		int m1=l%vg,m2=r%vg;
		int ans=INF;
		rep(i,l,r+1){
			rep(j,i+1,r+1){
				ans=min(ans,(i*j)%vg);
			} 
		}
		
		cout<<ans;	
			
			  
	 }
	
      int32_t main() {
	    cool;
	    int t=1;
        //cin>>t;
	    while(t--)
	       solve();
	       
	       
	       return 0;	   
	   }


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

signed main() {
    int n;
    cin >> n;
    vector<int> a;
    int max_v = 0;
    int sub_max_v = 0;
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        if (x > max_v) {
            sub_max_v = max_v;
            max_v = x;
        }
        else if (x > sub_max_v) {
            sub_max_v = x;
        }
        a.push_back(x);
    }
    for (int i = 0; i < n; i++) {
        if (a[i] == max_v)
            cout << sub_max_v << "\n";
        else
            cout << max_v << "\n";
    }
}

Measured memory_bytes: 3312
S = input()
K = int(input())
check = 0
ans = 0
St = []
for s in S:
    if s != check:
        check = s
    else:
        check = 0
        ans += 1
ans *= K
if S[0] == S[-1]:
    st = 1
    en = 1
    for i in range(len(S)-1):
        if S[i] == S[i+1]:
            st += 1
        else:
            break
    for i in range(len(S)-1):
        if S[-1*(i+1)] == S[-1*(i+2)]:
            en += 1
        else:
            break
    if st % 2 == 1 and en % 2 == 1:
        ans += K - 1
if len(S) == 1:
    ans = K // 2
if len(set(list(S))) == 1:
    ans = len(S) * K // 2
print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
struct line
{
	int s,t;
	int next;
}a[2000001];
int head[7001];
int edge;
int mp[1001][1001];
inline void add(int s,int t)
{
	a[edge].next=head[s];
	head[s]=edge;
	a[edge].s=s;
	a[edge].t=t;
}
bool flag;
int v[7001];
bool vx[7001];
int s1,s2;
int tot;
int ss1[100001],ss2[100001];
inline void dfs1(int d)
{
	if(v[d]==1)
		ss1[tot]++;
	else
		ss2[tot]++;
	int i;
	for(i=head[d];i!=0;i=a[i].next)
	{
		int t=a[i].t;
		if(!v[t])
		{
			v[t]=3-v[d];
			dfs1(t);
		}
		else if(v[t]==v[d])
			flag=false;
	}
}
bool f[2001][2001];
int main()
{
	int n,m;
	scanf("%d%d",&n,&m);
	int i,j,s,t;
	for(i=1;i<=m;i++)
	{
		scanf("%d%d",&s,&t);
		mp[s][t]=1;
		mp[t][s]=1;
	}
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=n;j++)
		{
			if(!mp[i][j]&&i!=j)
			{
				edge++;
				add(i,j);
				//edge++;
			//	add(j,i);
			}
		}
	}
	flag=true;
	for(i=1;i<=n;i++) 
	{
		if(v[i]==0)
		{
			v[i]=1;
			tot++;
			dfs1(i);
		/*	s1=0;
			s2=0;
			dfs2(i);
			tot++;
			ss1[tot]=s1;
			ss2[tot]=s2;*/
		}
	}
	if(!flag)
	{
		printf("-1\n");
		return 0;
	}
	f[0][0]=true;
	for(i=0;i<tot;i++)
	{
		for(j=0;j<=n;j++)
		{
			if(!f[i][j])
				continue;
			f[i+1][j+ss1[i+1]]=true;
			f[i+1][j+ss2[i+1]]=true;
		}
		
	}
	long long ans=2100000000;
	for(i=0;i<=n;i++)
	{
		if(f[tot][i])
		{
			int xt=n-i;
			ans=min(ans,(long long)i*(i-1)/2+xt*(xt-1)/2);
		}
	}
	cout<<ans<<endl;
	//printf("%lld\n",ans);
	return 0;
}

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

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define printV(v) for(auto&& x : v){cout << x << " ";} cout << endl
#define printVV(vv) for(auto&& v : vv){for(auto&& x : v){cout << x << " ";}cout << endl;}
#define printP(p) cout << p.first << " " << p.second << endl
#define printVP(vp) for(auto&& p : vp) printP(p);

typedef long long ll;
typedef pair<int, int> Pii;
typedef tuple<int, int, int> TUPLE;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<Pii> vp;
const int inf = 1e9;
const int mod = 1e9 + 7;
typedef vector<vector<int>> Graph;

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

  string s;
  cin >> s;
  int n = s.size();

  rep(i, n - 1) {
    if (s[i] == s[i + 1]) {
      cout << i + 1 << " " << i + 2 << endl;
      return 0;
    }
  }

  rep(i, n - 2) {
    vi cnt(26);
    cnt[s[i] - 'a']++;
    cnt[s[i + 1] - 'a']++;
    cnt[s[i + 2] - 'a']++;
    if (*max_element(all(cnt)) >= 2) {
      cout << i + 1 << " " << i + 3 << endl;
      return 0;
    }
  }

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


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
#define N 100000
#define INF 100000000
typedef long long ll;
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) int(x.size())
#define IN(a) cin>>(a)
#define OUT(a) cout<<(a)<<endl
typedef pair<int,int> P;
const int MAX = 100005;
const int MOD = 1000000007;
int main(){
    ll n;
    cin>>n;
    ll tmp=n-1;
    ll cnt=0;
    map<ll,int>m;
    for(int i=2;i<=sqrt(n)+1;i++){
        while(tmp%i==0){
            tmp/=i;
            m[i]++;
        }
    }
    if(tmp!=1)m[tmp]++;
    ll w=0;
    for(int k=2;k<=sqrt(n);k++){
        tmp=n;
        while(tmp%k==0){
            tmp/=k;
        }
        if((tmp-1)%k==0)cnt++;
        if((n-1)%k==0)w++;
    }

    ll s=1;
    for(auto i:m){
        s*=(i.second+1);
    }
    s--;
    cnt+=s;
    cnt-=w;
    cnt++;
    OUT(cnt);
    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();
        ArrayList<Long> K_list = new ArrayList<Long>();
        long K = sc.nextLong();
        String str = Long.toBinaryString(K);
        int len = str.length();
        long K_2 = (1L<<(len-1))-1;
        long K_3 = (1L<<(len-1));

        K_list.add(K);
        long tmp = (1L<<(len-1));
        StringBuilder sb = new StringBuilder();
        sb.append(str.charAt(0));
        for (int i=len-2;i>=1;i--) {
            if (str.charAt(len-1-i)=='1') {
                StringBuilder sb_tmp = new StringBuilder(sb);
                sb_tmp.append('0');
                long K_tmp = (1L<<i)-1;
                sb_tmp.append(Long.toBinaryString(K_tmp));
                K_list.add(Long.parseLong(sb_tmp.toString(), 2));
            }
            sb.append(str.charAt(len-1-i));
        }
        K_list.add((1L<<(len-1))-1);
        // System.out.println(K_list);

        long ans_1 = 0L;
        long ans_2 = 0L;
        long ans_3 = 0L;
        long[] ans = new long[K_list.size()];
        for (int i=0;i<N;i++) {
            long A = sc.nextLong();
            long B = sc.nextLong();
            for (int j=0;j<K_list.size();j++) {
                if ((A|K_list.get(j))==K_list.get(j)) ans[j]+=B;
            }
        }
        long max = 0L;
        for (int i=0;i<K_list.size();i++) {
            max = Math.max(max, ans[i]);
        }
        System.out.println(max);
    }
}

Measured memory_bytes: 66244
x=[]
y=[]
while True:
    i,j=map(int,raw_input().split())
    if (i,j)==(0,0):
        break;
    x.append(i)
    y.append(j)
X=iter(x)
Y=iter(y)

for a in X:
    b=Y.next()
    if a<b:
        print('%d %d'%(a,b))
    else:
        print('%d %d'%(b,a))

Measured memory_bytes: 6372
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int a = stoi(s.substr(5,2));
  int b = stoi(s.substr(8,2));
  if (a <= 4 && b <= 30) {
    cout << "Heisei" << endl;
  } else {
    cout << "TBD" << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <tuple>
#include <cassert>

using namespace std;

#define all(c) (c).begin(), (c).end()
#define iter(c) __typeof((c).begin())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(c, i) for (iter(c) i = (c).begin(); i != (c).end(); ++i)
#define pb(e) push_back(e)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define mp(a,b) make_pair((a), (b))
#define mt(a,b,c) make_tuple((a),(b),(c))

typedef long long ll;

int main(){
    int n; cin >> n;
    vector<ll> a(n); rep(i,n) cin >> a[i];
    priority_queue<pair<ll,int>> pq;
    vector<ll> r(n), l(n);
    rep(i,n){
        if(!pq.empty()){
            while(!pq.empty() && pq.top().first > a[i]){
                int id = pq.top().second; 
                pq.pop();
                r[id] = i;
            }
        }
        pq.push(mp(a[i], i));
    }
    while(!pq.empty()){
        int id = pq.top().second;
        r[id] = n;
        pq.pop();
    }
    
    for(int i=n-1;i>=0;i--){
        if(!pq.empty()){
            while(!pq.empty() && pq.top().first > a[i]){
                int id = pq.top().second;
                pq.pop();
                l[id] = i;
            }
        }
        pq.push(mp(a[i], i));
    }
    while(!pq.empty()){
        int id = pq.top().second;
        l[id] = -1;
        pq.pop();
    }
/*
    rep(i,n) cout << a[i] << " "; cout << endl;
    rep(i,n) cout << r[i] << " "; cout << endl;
    rep(i,n) cout << l[i] << " "; cout << endl;
*/
    ll ans = 0;
    rep(i,n) {
        ans = ans + (a[i] * (r[i] - i) * (i - l[i]));
    }
    cout << ans << endl;
    return 0;
}

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

#define whole(f, x, ...)                                 \
  ([&](decltype((x)) whole) {                            \
    return (f)(begin(whole), end(whole), ##__VA_ARGS__); \
  })(x)

using namespace std;
using ll = long long;

void solve() {
  ll a, b, k;
  cin >> a >> b >> k;

  if (k <= a) {
    cout << a - k << ' ' << b << endl;

  } else if (k <= a + b) {
    cout << 0 << ' ' << a + b - k << endl;
  } else {
    cout << 0 << ' ' << 0 << endl;
  }
}

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

  solve();
  return 0;
}


Measured memory_bytes: 256
s = input()
if len(s) % 2 == 0:
    half_len = int(len(s)/2)
    f_half = s[:half_len]
    l_half = s[half_len:][::-1]
else:
    half_len = int((len(s)-1)/2)
    f_half = s[:half_len]
    l_half = s[half_len+1:][::-1]
counter = 0
for i in range(len(f_half)):
    if f_half[i] != l_half[i]:
        counter += 1
print(counter)

Measured memory_bytes: 38384
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <cstdlib>
#include<iomanip>
#define rep(i,x) for(int i=0;i<x;i++)
#define all(a) (a).begin(),(a).end()
using namespace std;
using ld = long double;
using ll = long long;
const ll INF = 1001001001;
typedef pair<ll, ll> P;
const ll mod = 1000000007;
ll gcd(ll a, ll b) {//a>b
    if (a < b)swap(a, b);
    if (a % b == 0) return b;
    else return gcd(b, a % b);
}


int main() {
    ll N;
    cin >> N;
    if (N > 17)cout << "Yes" << endl;
    else if (N == 4 || N == 8 || N == 12 || N == 7 || N == 14 || N == 16 || N == 11 || N == 15) {
        cout << "Yes" << endl;
    }
    else cout << "No" << endl;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

x, y = map(int, input().split())

if x<y:
    diff = abs(abs(x)-abs(y))
    if x*y>=0:
        print(diff)
        exit()
    else:
        print(diff+1)
        exit()


if y<x:
    diff = abs(abs(x)-abs(y))
    if x*y>0:
        print(diff+2)
    else:
        print(diff+1)


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

int main()
{	
	string s;

	while (cin >> s) {
		string t;
		int p = 0, q = s.find("@"), k;

		while (q < s.size() - 2) {
			k = stoi(s.substr(q + 1, 1));

			t += s.substr(p, q - p);
			for (int i = 0; i < k; i++)
				t += s[q + 2];

			p = q + 3;
			q = s.find("@", p);
		}

		t += s.substr(p, s.size() - p);

		cout << t << endl;
	}

	return 0;
}


Measured memory_bytes: 3044
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instr = lambda: sys.stdin.readline()
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
A = inintl()

st = [""]*n

cnt = 0

for a in A:
    cnt += 1
    st[a-1] = str(cnt)

print(" ".join(st))

Measured memory_bytes: 85696
#include<stdio.h>
int main(void){
	int a, b;
	scanf("%d",&a);
	scanf("%d",&b);
	if(a<=b){
		for(int i=0; i<b; i++){
			printf("%d", a);
		}
	}
	else{
		for(int j=0; j<a; j++){
			printf("%d", b);
		}
	}
	printf("\n");
	return 0;
}


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

using namespace std;

typedef long long ll;

int main() {
    int n; cin >> n;
    set<string> s;
    for (int i = 0; i < n; i++) {
        string t; cin >> t;
        s.insert(t);
    }
    cout << s.size();
    return 0;
}



Measured memory_bytes: 19180
#include <bits/stdc++.h>
#include <stdio.h>
 
using namespace std;
 
#define int long long
 
void solve();

signed main () {
	cout.precision(10);
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	#ifdef LOCAL
		freopen("input.txt", "r", stdin);
	#endif
	int t = 1; 
	// cin >> t;
	int tt = t;
	while (t--) { 
		solve();
	}
	return 0;
}

void solve() {
	int n;
	cin >> n;
	if (n % 2 == 0) {
		cout << 0.5;
	} 
	else {
		cout << (1.0 * ((n / 2) + 1)) / (1.0 * n);
	}
}		


Measured memory_bytes: 764
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        while (n-- > 0) {
            String s1 = scanner.next();
            String s2 = scanner.next();
            System.out.println(Main.LCSlength(s1, s2));
        }
		
	}
	
	/* Computes the length of the longest common subsequence of two given strings
	 Uses the algorithm from class with slight modifications to calculate the length of the longest common subsequence*/
	public static int LCSlength(String a, String b) {
		
		int m = a.length();
		int n = b.length();
		int[][] d = new int[m+1][n+1];
		/* Intialize the table. We initialize it with a value of 0 in the first row and column
		 because if one string is empty, then the length will be 0*/
		for (int i = 0; i <= m; i++) {
			d[i][0] = 0;
		}
		for (int j = 0; j <= n; j++) {
			d[0][j] = 0;
		}
		
		// Fill the table
		for (int i = 1; i <= m; i++) {
			for (int j = 1; j <= n; j++) {
				/* If the characters at this spot are equal, then the current cell will take on the value of the of the previous
				 iteration plus 1 (since the length of the common subsequence is now increased by 1) */
				if (a.charAt(i-1) == b.charAt(j-1)) {
					d[i][j] = d[i-1][j-1] + 1;
				}
				/* If they are not equal, then we look to the other cells that have iterated over the same location of both strings
				 and take the max value. */
				else {
					d[i][j] = Math.max(d[i][j-1], d[i-1][j]);
				}
				
			}
		}
		// At the end, we should have the correct length
		return d[m][n];
	}
}



Measured memory_bytes: 65612
import java.util.*;

public class Main{
	
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
  	int a=sc.nextInt(),b=sc.nextInt(),c=sc.nextInt();
    if(a!=b){
      if(a!=c){
        System.out.print(a);
      }else{
        System.out.print(b);
      }
    }else{
      System.out.print(c);
    }
  }
}


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

int main() {
        string s;
        cin >> s;
        cout << s;
        if (s[s.size()-1] == 's') {
                cout << "es" << endl;
        } else {
                cout << "s" << endl;
        }
}

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

using namespace std;

const int N = 234567, M = 2345, mod = 1e9 + 7;

void add(int& x, int y) {
  x += y;
  if (x >= mod) {
    x -= mod;
  }
}

void sub(int& x, int y) {
  x -= y;
  if (x < 0) {
    x += mod;
  }
}

int mul(int x, int y) {
  return (long long) x * y % mod;
}

int n, a[N], b[N], dp[M << 1][M << 1], fac[M << 2], ifac[M << 2], inv[M << 2];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  fac[0] = ifac[0] = inv[1] = 1;
  for (int i = 1; i < (M << 2); ++i) {
    if (i > 1) {
      inv[i] = mul(mod - mod / i, inv[mod % i]);
    }
    fac[i] = mul(fac[i - 1], i);
    ifac[i] = mul(ifac[i - 1], inv[i]);
  }
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i] >> b[i];
    ++dp[M - a[i]][M - b[i]];
  }
  int limit = 2000;
  for (int i = -limit; i <= limit; ++i) {
    for (int j = -limit; j <= limit; ++j) {
      add(dp[i + 1 + M][j + M], dp[i + M][j + M]);
      add(dp[i + M][j + 1 + M], dp[i + M][j + M]);
    }
  }
  auto binom = [&] (int n, int m) {
    return mul(fac[n], mul(ifac[m], ifac[n - m]));
  };
  int answer = 0;
  for (int i = 1; i <= n; ++i) {
    add(answer, dp[a[i] + M][b[i] + M]);
    sub(answer, binom(a[i] + b[i] << 1, a[i] << 1));
  }
  cout << mul(answer, mod + 1 >> 1) << '\n';
  return 0;
}

Measured memory_bytes: 75648
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
#define INF 1e9

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef vector < pair<int, int> > vii;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

ll n, x, ans, smallest;
vector<int>a;

int main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin >> n;
	smallest=INF;
	for(int i = 0; i < n; i++){
		cin >> x;
		ans+=x;
		if(x%10){
			smallest=min(smallest,x);
		}
	}
	if(ans%10){
		cout << ans << endl;
	}
	else{
		cout << max(ll(0),ans-smallest);
	}
	return 0;
}


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

class Program
{
    static void Main(string[] args)
    {
        var x = int.Parse(ReadLine());
        if (x < 1200) WriteLine("ABC");
        else WriteLine("ARC");
    }
}



Measured memory_bytes: 2776
#include<iostream>

#include<cmath>
#include<string>
#include <algorithm> 
using namespace std;

int main()
{
    int a,b,c;
    cin >> a >> b >> c;

    if(a==b){
        cout << c << endl;
    } else if(b==c){
        cout << a << endl;
    } else {
        cout << b << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>

typedef unsigned long long ll;

int main()
{
  ll N, K;
  ll l[50];
  ll sum = 0;
  std::cin >> N >> K;

  for (ll i = 0; i < N; i++) {
    std::cin >> l[i];
  }
  std::sort(l, l + N);

  for (ll i = 0; i < K; i++) {
    sum += l[N - 1 - i];
  }

  std::cout << sum << std::endl;

  return 0;
}


Measured memory_bytes: 256
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Security.Policy;

class Program
{
    const string Yes = "Yes";
    const string No = "No";
    const char White = '.';
    const char Black = '#';
    const long Mod = 1000000007;

    static void Main(string[] args) {
        checked {
#if DEBUG
            MyDebugger.Test(process, "../TextFile1.txt");
            //TestCaseMaker.MakeTestCase1("../TextFile2.txt");
            //MyDebugger.Test(process, "../TextFile2.txt");
#else
            object ret = process(new StreamReader(Console.OpenStandardInput()));
            Console.WriteLine(ret);
#endif
        }
    }

    static object process(TextReader input) {
        var spl = input.ReadLine().Split(' ');
        var q = long.Parse(spl[0]);
        var h = long.Parse(spl[1]);
        var s = long.Parse(spl[2]);
        var d = long.Parse(spl[3]);

        var n = long.Parse(input.ReadLine());

        var qq = q * 4 * 2;
        var hh = h * 2 * 2;
        var ss = s * 2;
        var dd = d;

        var min = long.MaxValue;
        min = Math.Min(qq, min);
        min = Math.Min(hh, min);
        min = Math.Min(ss, min);
        min = Math.Min(dd, min);

        long g = (n / 2) * min;

        if(n % 2 == 1) {
            min = long.MaxValue;
            min = Math.Min(qq / 2, min);
            min = Math.Min(hh / 2, min);
            min = Math.Min(ss / 2, min);

            g += min;
        }

        return g;
    }

    static long[] ToIntArray(string strs, int n) {
        var ret = new long[n];
        if(n == 0) return ret;
        var spl = strs.Split(' ');
        for (int i = 0; i < n; i++)
            ret[i] = long.Parse(spl[i]);
        return ret;
    }
}


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

using ll = long long;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n); i > 0; i--)
#define all(n) n.begin(), n.end()
#define print(n) cout << n << endl

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

    ll n;
    string temp;
    unordered_set<string> s;
    cin  >> n;

    rep(i,n){
        cin >> temp;
        s.insert(temp);
    }
    print(s.size());
    return 0;
}

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

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

  int kmax = (N-1)*(N-2)/2;
  if (kmax < K) {
    cout << "-1" << endl;
    return 0;
  }

  cout << N-1+kmax-K << endl;
  REP(i,N-1) {
    cout << "1 " << i+2 << endl;
  }
  int n0 = 2;
  int n1 = 3;
  REP(i,kmax-K) {
    cout << n0 << " " << n1 << endl;
    if (n1==N) { n0++; n1=n0+1; }
    else n1++;
  }
}


Measured memory_bytes: 256
/* 
	Author: ankrypt
*/


#include <bits/stdc++.h>

using namespace std;

#define MOD 1000000007
#define ll long long int
#define u64 unsigned long long int

ll N;
ll hashCnt[500];
ll arr[305];
ll vis[305][305][305];
double dp[305][305][305];

double rec(ll a, ll b, ll c) {

	if(a == 0 && b == 0 && c == 0) {
		return 0;
	}
	if(a < 0 || b < 0 || c < 0) {
		return 0;
	}

	double &ans = dp[a][b][c];
	if(vis[a][b][c]) {
		return ans;
	}
	vis[a][b][c] = 1;
	ans = N + a * rec(a - 1, b, c) + b * rec(a + 1, b - 1, c) + c * rec(a, b + 1, c - 1);
	ans /= (a + b + c);
	return ans;
}

int main() {
	scanf("%lld", &N);
	for(int i = 0; i < N; i++) {
		scanf("%lld", &arr[i]);
		hashCnt[arr[i]]++;
	}	
	double finalAns = rec(hashCnt[1], hashCnt[2], hashCnt[3]);
	printf("%0.12lf\n", finalAns);
	return 0;
}
/*
	Powered by Buggy Plugin
*/


Measured memory_bytes: 438528
def main():
    N,M,K = map(int,input().split())
    if K == 0 or K == N*M:
        return ('Yes')
    ans_dict = {}
    ans_dict[K] = False
    for i in range(N):
        for j in range(M+1):
            ans_dict[i*M + (N-i-i)*j] = True
    if ans_dict[K] == True:
        return('Yes')
    else:
        return('No')

print(main())


Measured memory_bytes: 29832
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for(int i=0; i<(int)n; i++)
#define rep2(i, m, n) for(int i=(int)m; i<(int)n; i++)
#define ALL(a) a.begin(), a.end()
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
const ll INF = 100100100100;
const int MOD = 1000000007;
const ld EPS = 1e-10;

int main(){
  ll N, M; cin >> N >> M;
  vector<ll> A(N);
  rep(i, N) cin >> A[i];
  sort(ALL(A));

  vector<ll> cumA(N+1);
  rep(i, N) cumA[i+1] = cumA[i] + A[i];
  
  auto f = [&] (ll X) {
    ll num = 0;
    ll tot = 0;
    rep(i, N) {
      ll j = lower_bound(ALL(A), X - A[i]) - A.begin();
      num += N - j;
      tot += (N-j) * A[i];
      tot += cumA[N] - cumA[j];
    }
    return make_pair(num, tot);
  };

  ll ng = ll(2e5) + 5;
  ll ok = 0;
  while (llabs(ng - ok) > 1) {
    ll m = (ng + ok) / 2;
    auto nt = f(m);
    if (nt.first >= M) ok = m;
    else ng = m;
  }
  auto nt = f(ok);
  ll ans = nt.second;
  ans -= (nt.first - M) * ok;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1792