akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int sort(vector<int> A,int N){
  int temp,i,j;
  for(int i = 1;i < N;i++){
    temp = A.at(i);
    j = i - 1;
    while(j >= 0 && A.at(j) < temp){
      A.at(j+1) = A.at(j);
      j--;
    }
    A.at(j+1) = temp;
  }
 /* for(int i = 0;i<N;i++){
    cout << A.at(i);
  } */
}
int main() {
  int N,K;
  cin >> N >> K;
  
  vector<int> A(N);
  for(int i = 0;i < N;i++){
    cin >> A.at(i); 
  }
  
  sort(A.begin(),A.end());
  reverse(A.begin(),A.end());
  
  int sum = 0;
  for(int i = 0;i<K;i++){
    sum += A.at(i);
  }
  cout << sum << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	int i;
	vector<int> v;
	cin >> i;
	v.pb(i);
	cin >> i;
	v.pb(i);
	cin >> i;
	v.pb(i);
	sort(ALL(v));
	int ans = v[0] - v[1] + v[1] - v[2];  
	cout << abs(ans)<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}

int main(){
  
  long long n;
  double l;
  cin>>n>>l;
  double t[n];
  REP(i,n){
    cin>>t[i];
  }
  
  double x = 0,y = 0;
  long long all_ = n*(n-1)*(n-2)/6LL;
  REP(i,n){
    for(int j = i+1; j<n; j++){
      
      double mnum = j-i-1;
      double pnum = n-2-(j-i-1);
      x -= mnum*cos(PI*(t[i]+t[j])/l);
      //x += mnum*cos(PI*(t[i]+t[j]+l)/l);
      x += pnum*cos(PI*(t[i]+t[j])/l);
      y -= mnum*sin(PI*(t[i]+t[j])/l);
      //y += mnum*sin(PI*(t[i]+t[j]+l)/l);
      y += pnum*sin(PI*(t[i]+t[j])/l);
      
    }
  }
  
  x /= (double)all_;
  y /= (double)all_;
  cout<<fixed<<setprecision(15)<<x<<' '<<y<<endl;
  return 0;
}


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

#define MOD (1000000000+7)
#define MAXB 61

long long N;
long long dp[MAXB + 1][3];

int main() {
	cin >> N;

	dp[0][0] = 1;
	for (int i = 0; i < 61; i++) {
		for (int j = 0; j < 3; j++) {
			for (int x = 0; x < 2; x++) {
				for (int y = x; y < 2; y++) {
					int s = (N >> i & 1) - x - y - j;
					dp[i + 1][(1 - s) / 2] += dp[i][j];
					dp[i + 1][(1 - s) / 2] %= MOD;
				}
			}
		}
	}
    long long ans = dp[61][0];

	cout << ans << endl;

	return 0;
}


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

typedef long long ll;

#define rep(i, n) REP(i, 0, n)
#define REP(i, s, e) for(int i = (int)s; i < (int)(e); ++i)

#define X real()
#define Y imag()
#define x(p) real(p)
#define y(p) imag(p)
#define curr(P, i) P[i]
#define next(P, i) P[(i+1)%P.size()]
#define prev(P, i) P[(i-1+P.size())%P.size()]

const double EPS = 1e-8;
const double INF = 1e12;
const double PI = acos(-1);

typedef double D;
typedef complex<D> P;
namespace std{
  bool operator < (const P& a, const P& b) {
    return x(a) != x(b) ? x(a) < x(b) : y(a) < y(b);
  }
}

D dot(const P& a, const P& b) {
  return x(conj(a)*b);
}
D cross(const P& a, const P& b) {
  return y(conj(a)*b);
}

struct L : public vector<P> {
  L(const P&a, const P& b) {
    push_back(a);
    push_back(b);
  }
};

typedef vector<P> G;

struct C {
  P p; D r;
};

int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if(cross(b, c) > 0) return +1; //ccw
  if(cross(b, c) < 0) return -1; //cw
  if(dot(b, c) < 0)   return +2; //c-a-b on line
  if(norm(b) < norm(c)) return -2; //a-b-c on line
}

P projection(const L& l, const P& p) {
  D t = dot(p - l[0], l[0] - l[1]) / norm(l[0]- l[1]);
  return l[0] + t * (l[0] - l[1]);
}
P refrection(const L& l, const P& p) {
  return p + 2.0 * (projection(l, p) - p);
}
int main() {
  D x1, y1, x2, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  L l{P(x1, y1), P(x2, y2)};
  int q;
  cin >> q;
  cout << fixed << setprecision(20);
  rep(i, q) {
    D x, y;
    cin >> x >> y;
    auto p = refrection(l, P{x, y});
    cout << x(p) << " " << y(p) << endl;
  }
  return 0;
}

Measured memory_bytes: 3344
#pragma GCC optimize("O3")
#pragma GCC target("arch=corei7-avx")

#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <cassert>
#include <cmath>
#include <queue>
#include <ctime>

using namespace std;

#define REP(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define SZ(a) (int)(a).size()
#define ALL(a) (a).begin(), (a).end()

int ex[555][555];
int pref[555][555];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, m, q;
    cin >> n >> m >> q;
    REP(i, m) {
        int L, R;
        cin >> L >> R;
        ex[L][R]++;
    }
    for (int i = 1; i <= n; i++) {
        pref[i][0] = 0;
        for (int j = 1; j <= n; j++) {
            pref[i][j] = pref[i][j - 1] + ex[i][j];
        }
    }
    REP(i, q) {
        int L, R;
        cin >> L >> R;
        int res = 0;
        for (int j = L; j <= R; j++) {
            res += pref[j][R] - pref[j][j - 1];
        }
        cout << res << "\n";
    }
    return 0;
}

Measured memory_bytes: 3072
N = int(input())
L = input().split()
for i in range(N):
  L[i]=int(L[i])

L.sort()
L.reverse()

Alice = 0
Bob = 0

for i in range(N):
  if i%2 == 0:
    Alice += L[i]
  else:
    Bob += L[i]

print(Alice-Bob)


Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int i, j, k;
        for(i = 0; ; i++) {
            int H = sc.nextInt();
            int W = sc.nextInt();
            if(H == 0 || W == 0) break;
            for(j = 0; j < H; j++) {
                if(j % 2 == 0) {
                for(k = 0; k < W; k++) {
                    if(k % 2 == 0){
                    System.out.print("#");
                    } else {
                        System.out.print(".");
                    }
                }
            } else {
                for(k = 0; k < W; k++) {
                    if(k % 2 == 1){
                    System.out.print("#");
                    } else {
                        System.out.print(".");
                    }
                }
            }
                System.out.println("");
            }
            System.out.println("");
        }
    }
}


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

public class Main {
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();

        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] h = new int[n];
        int[] tmp = new int[n];

        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
            tmp[i] = h[i];
        }

        for (int i = 0; i < m; i++) {
            int a = sc.nextInt() - 1;
            int b = sc.nextInt() - 1;

            if (h[a] > h[b])
                tmp[b] = 0;
            else if (h[b] > h[a])
                tmp[a] = 0;
            else {
                tmp[a] = 0;
                tmp[b] = 0;
            }
        }

        int ans = 0;
        for (int i : tmp) {
            if (i > 0)
                ans++;
        }

        System.out.println(ans);
    }

    static class MyScanner {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
        StringTokenizer tokenizer;

        String next() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(reader.readLine());
                }
            } catch (IOException ignored) {
            }
            return tokenizer.nextToken();
        }

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

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}

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

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

int main() {
    int N;
    string S;
    cin >> N >> S;

    vector<int> R(N), G(N), B(N);
    rep(i, N) {
        if (S[i] == 'R')
            ++R[i];
        else if (S[i] == 'G')
            ++G[i];
        else
            ++B[i];
    }

    for (int i = 1; i < N; ++i) {
        R[i] += R[i - 1];
        G[i] += G[i - 1];
        B[i] += B[i - 1];
    }

    ll ans = 0;
    for (int i = 0; i < N - 2; ++i) {
        for (int j = i + 1; j < N - 1; ++j) {
            if (S[i] == S[j])
                continue;

            if ((S[i] == 'R' && S[j] == 'G') || (S[i] == 'G' && S[j] == 'R')) {
                ans += B[N - 1] - B[j];
                if (j - i < N - j)
                    ans -= (S[j + j - i] == 'B');
            } else if ((S[i] == 'G' && S[j] == 'B') || (S[i] == 'B' && S[j] == 'G')) {
                ans += R[N - 1] - R[j];
                if (j - i < N - j)
                    ans -= (S[j + j - i] == 'R');
            } else if ((S[i] == 'R' && S[j] == 'B') || (S[i] == 'B' && S[j] == 'R')) {
                ans += G[N - 1] - G[j];
                if (j - i < N - j)
                    ans -= (S[j + j - i] == 'G');
            }
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3664
import sys
input = sys.stdin.buffer.readline

def divisors(n) -> list:
  res = []
  for i in range(1, int(n ** 0.5) + 1):
    if n % i == 0:
      res.append(i)
      if i != n // i:
        res.append(n // i)
  res = sorted(res)[::-1]
  return res

N, K = map(int, input().split())
A = list(map(int, input().split()))

div = divisors(sum(A))

for d in div:
  arr = []
  for a in A:
    if a % d != 0:
      arr.append(d - a % d)
    else:
      arr.append(0)
  arr = sorted(arr)[::-1]
  tmp = sum(arr[sum(arr) // d:])
  if tmp <= K:
    print(d)
    exit()

Measured memory_bytes: 41708
#include<stdio.h>


// 1000keta dato int gata dato afureru.dousiyou.
// sokka. hairetsu ni hito-keta dutu irete ikeba yoi youna kiga site kita.


int main(void)
{
  int i,cnt;
  char num[1001];
  while(1)
    {
      scanf("%s",num);// num ha address nanode ampersand ha iranai
      if(num[0] == '0')break;
      // minus ha kanngaenai
      cnt = 0;
      for( i = 0;num[i]!='\0' ;i++)/* char gata no syuutan ha '\0' de aru. '\0'ni narumade suuji wo tashite iku */
      /*        for( i = 0;num[i] ;i++) */
        cnt += num[i] - '0';// num[i]niha ascii code ga haitteiru. 0no ascii code wo hikuto suuchi ni naru
      printf("%d\n",cnt);
    }
  return 0;
}

Measured memory_bytes: 536
#include <cstddef>
#include <cstdint>
#include <vector>

namespace null_null {

using i32 = std::int_fast32_t;
using i64 = std::int_fast64_t;
using u32 = std::uint_fast32_t;
using u64 = std::uint_fast64_t;
using usize = std::size_t;

constexpr usize operator"" _z(unsigned long long x) noexcept {
  return static_cast<usize>(x);
}

template <typename T>
std::vector<T> make_v(usize a) { return std::vector<T>(a); }
template <typename T, typename... Ts>
auto make_v(usize a, Ts... ts) {
  return std::vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}

template <typename T, typename V>
typename std::enable_if<std::is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }
template <typename T, typename V>
typename std ::enable_if<std::is_class<T>::value != 0>::type
fill_v(T &t, const V &v) {
  for (auto &e : t) fill_v(e, v);
}

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

} // namespace null_null

#include <algorithm>
#include <iostream>
#include <utility>

namespace null_null {

void main_() {
  i64 A, B;
  std::cin >> A >> B;

  if ((A + B) % 2 == 1) {
    std::cout << "IMPOSSIBLE" << std::endl;
  } else {
    std::cout << (A + B) / 2 << std::endl;
  }
}

} // namespace null_null

int main() {
  null_null::main_();
  return 0;
}


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

int main()
{
    int N;
    cin >> N;
    map<int, int> A;
    int Ai;
    long long vsum = 0;
    for(int i=0;i<N;i++){
        cin >> Ai;
        if(A.count(Ai)==0) A[Ai] = 0;
        A[Ai]++;
        vsum += Ai;
    }
    int Q;
    cin >> Q;

    int Bi, Ci;
    vector<long long> res(Q);
    for(int i=0; i<Q; i++){
        cin >> Bi >> Ci;
        if(A.count(Bi)==0){
            res[i] = vsum;
            continue;
        }
        if(A.count(Ci)==0) A[Ci] = 0;
        vsum += (Ci - Bi) * A[Bi];
        A[Ci] += A[Bi];
        A[Bi] = 0;
        res[i] = vsum;
    }
    for(auto v : res) cout << v << endl;

    return 0;
}

Measured memory_bytes: 7920
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner cin =new Scanner(System.in);
        int n=cin.nextInt();
        int k=cin.nextInt();
        int q=cin.nextInt();
        int num=k-q;

        int []an = new int[n];
        for(int i=0;i<n;i++)
            an[i]=num;


        while( q-->0 ){
            int t=cin.nextInt();
            an[--t]++;
        }
        for(int i=0;i<n;i++){
            if(an[i]>0)
                System.out.println("Yes");
            else
                System.out.println("No");
        }


        cin.close();
    }

}


Measured memory_bytes: 67992
#include<bits/stdc++.h>
using namespace std;
int a[101010];
int one,two,n,id;
int gcd(int x,int y)
{
	if (y==0) return x;
	return gcd(y,x%y);
}
bool dfs()
{
	//cerr<<dfs<<endl;
	--a[id];
	two=0; one=0;
	int x=a[1];
	for (int i=2;i<=n;++i) x=gcd(x,a[i]);
	for (int i=1;i<=n;++i)
	{
		a[i]/=x;
		if (a[i]%2==0) ++two;
		else ++one,id=i;
	}
	if (two%2==1) return 0;
	else if (one>=2 || a[id]==1) return 1;
	return (!dfs());
}
int main()
{
	//freopen("gold.in","r",stdin);
	//freopen("gold.out","w",stdout);
	scanf("%d",&n);
	for (int i=1;i<=n;++i) scanf("%d",&a[i]);
	for (int i=1;i<=n;++i)
	{
		if (a[i]%2==0) ++two;
		else ++one,id=i;
	}
	if (two%2==1) printf("First\n");
	else if (one>=2 || a[id]==1) printf("Second\n");
	else if (dfs()) printf("First\n");
	else printf("Second\n");
	return 0;
}

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

#define MAX 100002

int n;
int m;
int q;


vector<int> v[MAX];


int ans[MAX];




deque<pair<int, int> > vv[MAX];


bool use[MAX][12];
int dp[MAX][12];

int gett(int node, int d){
	pair<int, int> f = make_pair(d, -1);
	int id = lower_bound(vv[node].begin(), vv[node].end(), f) - vv[node].begin();
	return vv[node][id].second;
}
inline int dfs(int b, int d){
	if (d == 11)return -1;
	if (use[b][d])return dp[b][d];
	use[b][d] = true;
	int mx = gett(b,d);
	for (int i = 0; i < v[b].size(); i++){
		int go = v[b][i];
		mx=max(mx,dfs(go, d + 1));
	}
	dp[b][d] = mx;
	return mx;
}
map<int, int> mp;

int main(){
	cin >> n >> m ;
	for (int i = 0; i < m; i++){
		int a, b;
		scanf("%d%d", &a, &b);
		a--;
		b--;
		v[a].push_back(b);
		v[b].push_back(a);
	}
	cin >> q;
	for (int i = 0; i < n; i++){
		vv[i].push_back(make_pair(INT_MAX, -1));
	}
	for (int i = 0; i < q; i++){
		int b, dd, cc;
		scanf("%d%d%d", &b, &dd, &cc);
		b--;
		while (vv[b].front().first < dd){
			vv[b].pop_front();
		}
		vv[b].push_front(make_pair(dd, i));
		mp[i] = cc;
	}
	mp[-1] = 0;
	for (int i = 0; i < n; i++){
		int f = dfs(i, 0);
		printf("%d\n", mp[f]);
	}
	return 0;
}

Measured memory_bytes: 117240
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

#[allow(unused_imports)]
use std::cmp::{min, max};

#[allow(unused_imports)]
use std::io::Write;

fn main() {
    input!{
      mut n: usize,
    }
    let mut luca = vec![0u64; 87];
    luca[0] = 2;
    luca[1] = 1;
    for i in 2..n+1 {
        luca[i] = luca[i-1] + luca[i-2];
    }
    println!("{}", luca[n]);
}


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

int main()
{	
	int p, q, r;
	cin >> p >> q >> r;
	int ans = INF;
	ans = min(ans, p+q);
	ans = min(ans, q+r);
	ans = min(ans, r+p);
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
#include <bits/stdc++.h> 
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define pll pair<ll,ll>
#define pint pll
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
  int n;
  cin >> n;
  ll index[n];
  ll p[n]={};
  rep(i,n){
    cin >> p[i];
    index[p[i]-1]=i;
  }
  ll ans=0;
  ll m=inf;
  rep(i,n){
    if(m>index[i]){
      ans++;
      m=min(m,index[i]);
    }else m=min(m,index[i]);
  }
  cout << ans << endl;
return 0;}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
    using namespace std;
    #define ll long long int
    #define f(i,n) for(ll i=0;i<n;i++)
    #define fz for(ll j=i+1;j<n;j++)
    #define f2(i,n) for(ll i=1;i<=n;i++)
    #define endl "\n"
    #define vll vector <ll>
    #define sz(a) (ll)a.size()
    #define mod 1000000007
    #define pb push_back
    #define inf 1e13+5

    ll gcd(ll a, ll b){if(b==0)return a;return gcd(b, a%b);}
    ll lcm(ll a, ll b){return a*b/gcd(a, b);}
    ll fexp(ll a, ll b){ll ans = 1;while(b){if(b&1) ans = ans*a%mod; b/=2;a=a*a%mod;}return ans;}
    ll inverse(ll a, ll p){return fexp(a, p-2);} 


    
    
    void solve(){
      ll n;cin>>n;ll k;cin>>k;
      ll a[n];f(i,n)cin>>a[i];
      sort(a,a+n);
      ll ans[k+1]={0};
      ans[a[0]]=1;
      for(ll i=a[0]+1;i<=k;i++){
          for(ll j=0;j<n;j++){
              if(i-a[j]>=0){
                  if(ans[i-a[j]]==0){
                      ans[i]=1;
                      break;
                  }
              }
          }
      }
      if(ans[k]==1){
          cout<<"First\n";
      }
      else cout<<"Second\n";
                                                                                    

    }


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

        

        ll t;
        t=1;
        // cin>>t;
        while(t--){
            solve();
        }

       
        
        return 0;
    }

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

using ll = long long;
#define ALL(c) (c).begin(), (c).end()
const int MOD = 1000000007;

int main() {
    int n, t;
    cin >> n >> t;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    int mx = a[n - 1];
    int d = 0;
    int c = 0;
    for (int i = n - 2; i >= 0; i--) {
        if (mx - a[i] > d) {
            d = mx - a[i];
            c = 1;
        } else if (mx - a[i] == d) {
            c++;
        }
        if (mx < a[i]) {
            mx = a[i];
        }
    }
    cout << c << endl;
}


Measured memory_bytes: 640
#coding: utf-8
import math
import heapq

MOD = 10**9+7

def combination(n, r):
    r = min(r, n-r)
    numer = denom = 1
    for i in range(1, r+1):
        numer = numer * (n+1-i) % MOD
        denom = denom * i % MOD
    return numer * pow(denom, MOD-2, MOD) % MOD


X,Y = map(int, input().split())

if (X+Y)%3!=0:
    print(0)
else:
    a = (2*X-Y)//3
    b = (2*Y-X)//3
    if a<0 or b<0:
        print(0)
    else:
        print(combination(a+b, a))


Measured memory_bytes: 3188
def main():
    while True:
        try:
            A = list(map(int,input().split()))
            B = list(map(int,input().split()))
            hit_count = 0
            blow_count = 0
            for i in range(4):
                for j in range(4):
                    if A[i] == B[i]:
                        hit_count += 1
                        break
                    if A[i] == B[j]:
                        blow_count += 1
                        break
            print(str(hit_count)+ " " + str(blow_count))
        except EOFError:
            break




if __name__ == '__main__':
    main()



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

using namespace std;
typedef long long ll;
typedef long long ll;

int main() {
  ll N;
  cin >> N;
  string ans = "";
  if (!N) {
    cout << '0' << endl;
    return 0;
  }
  while (N) {
    ll r = N % 2;
    if (r < 0) r += 2;
    ans += to_string(r);
    N = (N - r) / (-2);
  }
  reverse(ans.begin(), ans.end());
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include <vector>
#include<stack>
#include<queue>
#include<map>
#include<algorithm>
#include<iomanip>
#include<cmath>
#include<bitset>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using pii = pair<int, int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define vsort(v) sort(v.begin(), v.end())
#define rv(v) reverse(v.begin(), v.end())
#define ll long long
#define PI 3.141592653589793
using vll = vector<ll>;
using Graph = vii;
const ll MOD = 1e9 + 7;

int n;
ll dp[100005];
int h[10000];

int main() {
	ll x;
	cin >> x;
	if (x == 2) {
		cout << 2 << endl;
		return 0;
	}
	if (x % 2 == 0) x++;

	ll k;
	for (ll i= x;; i += 2){
		k = 0;
		for (ll j = 3; j <= sqrt(i); j += 2)
		{
			if (i % j == 0)
			{
				k = 1;
				break;
			}
		}
		if (k == 0) {
			cout << i << endl;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#pragma warning(disable:4996)
#include <bits/stdc++.h>

using namespace std;

//macro
#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define EPS (1e-8)
#define equals(a,b)(fabs((a)-(b))<EPS)

using ll = long long;
using ull = unsigned long long;
using vb = vector<bool>;
using vi = vector<int>;
using vll = vector<ll>;
using vs = vector<string>;
using vvb = vector<vb>;
using vvi = vector<vi>;
using vvll = vector<vll>;
//func
template<typename A, typename T>void assign2d(A&arr, ll H, ll W, T t) { arr.resize(H); REP(i, H) arr[i].assign(W, t); }
template<class T> ostream &operator<<(ostream &os, const vector<T> &v) { int n = v.size(); REP(i, n)os << v[i] << (i == n - 1 ? "" : " "); return os; }
template <class T = int> inline T IN() { T x; cin >> x; return x; }
template<class T> inline void OUT(const T &x) { cout << x << "\n"; }
void YESNO(bool c) { OUT(c ? "YES" : "NO"); };
void YesNo(bool c) { OUT(c ? "Yes" : "No"); };
struct pre_ { pre_() { cin.tie(nullptr); ios::sync_with_stdio(false); /*cout << fixed << setprecision(6);*/ } } pre__;

int main() {
	string S;
	cin >> S;
	replace(ALL(S), ',', ' ');
	OUT(S);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
     
#define pll pair <long long,long long>
#define pb push_back
#define ll long long
#define ff first
#define ss second
#define vll vector <ll>
#define NFS ios_base::sync_with_stdio(0); cin.tie(NULL);
#define endl '\n'
#define M 1000000007   
using namespace std;

void solve()
{
	int n;
	cin>>n;
	if (n%1000!=0)
	{
		int q=(n/1000)+1;
		cout<<q*1000-n;
	}else{
		cout<<"0";
	}
}
 
int main()
{
    NFS
 	int t=1;
 	//cin>>t;
 	while(t--)
 	{
 		solve();
 	}
    return 0;
}

Measured memory_bytes: 3628
import sys

s = input()
K = int(input())

chars = sorted(set(s))
n = len(s)

for j in range(min(3, len(chars))):
  ans = chars[j]
  K -= 1
  if K == 0:
    print(ans)
    break
  while True:
    places = []
    index = -1
    while True:
      index = s.find(ans, index+1)
      if index == -1:
        break
      places.append(index)
      
    if len(ans) == len(s) - places[0]:
      break

    next_char = 'z' * 6
    for k in places:
      if k >= len(s)-len(ans):
        break
      next_char = min(next_char, s[k+len(ans)])

    ans += next_char
    K -= 1
    if K == 0:
      print(ans)
      sys.exit()

Measured memory_bytes: 3188
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>

using namespace std;
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(),(x).end()

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);};
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

//FUNCTION

void solve(void)
{
  int A,B; cin>>A; cin>>B; 
  if((A*B)%2 == 0)
  {
    cout<<"Even"<<endl;
  }
  else
  {
    cout<<"Odd"<<endl;
  }
  
  
  return;
}

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

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
 
int main(){
  int N,K;
  int l[50];
  int i,j;
  int temp;
  int sum = 0;
  
  scanf("%d %d",&N,&K);
 
  for(i = 0;i < N;i++){
    scanf("%d",&l[i]);
  }
 
  for(i = 0;i < K;i++){
    for(j = 0;j < N;j++){
      if(l[temp] < l[j]){
	temp = j;
      }
    }
    sum += l[temp];
    l[temp] = 0;
  }
  printf("%d",sum);
  return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<stack>
using namespace std;
#define REP(i,n) for(int i=0;i<(int)(n);i++)

const int NMAX = 65536, MMAX = 32, INF = 10000000;
int dp[NMAX];
int d[MMAX];

int main() {
  int M, N;
  cin >> N >> M;
  REP(i, M) {
    cin >> d[i];
  }

  REP(i, N+2) {
    dp[i] = INF;
  }
  dp[0] = 0;

  REP(m, M) {
    REP(n, N+1) {
      int cmp = (n - d[m] >= 0 ? dp[n - d[m]] + 1 : INF);
      dp[n] = min(dp[n], cmp);
    }
  }
  
  cout << dp[N] << endl;
}

Measured memory_bytes: 1356
#include <stdio.h>

int search(int *,int ,int);

int main(){
  int c=0,i,n,q,s[10001],t;

  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    scanf("%d",&s[i]);
  }
  
  scanf("%d",&q);
  
  for(i=0;i<q;i++){
    scanf("%d",&t);
    c += search(s,t,n);
   }
  printf("%d\n",c);

  return 0;
}

int search(int s[],int t,int n){
  int i = 0;

  while(s[i] != t){
    i++;
    if(i == n)return 0;
  }
  
  return 1;
}



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

using namespace std;

double getDis(pair<int, int> a, pair<int, int> b){
    double xv = a.first - b.first;
    double yv = a.second - b.second;
    return pow(xv * xv + yv * yv, 0.5);
}

int main(void){
    int n;
    cin >> n;
    vector<pair<int, int> > pos(n);
    for(int i = 0; i < n; i++){
        int x, y;
        cin >> x >> y;
        pos[i] = make_pair(x, y);
    }
    vector<int> x(n);
    for(int i = 0; i < n; i++){
        x[i] = i;
    }
    double dis = 0;
    int kumi = 0;
    do{
        kumi++;
        for(int i = 0; i < n-1; i++){
            dis += getDis(pos[x[i]], pos[x[i+1]]);
        }
    }while(next_permutation(x.begin(), x.end()));
    dis /= kumi;
    cout << fixed << setprecision(10) <<  dis << endl;
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
using LP = pair<int, int>;
using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())

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 double PI=3.14159265358979323846;

int mod = 1e9+7;
const long long INF = 1LL<<60;

int main(){
  string S;
  cin >> S;
  if(S=="ABC"){
    cout << "ARC" << endl;
  }else{
    cout << "ABC" << endl;
  }
  return 0;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll INF = 3000000000000000000; //10^18
const int inINF = 1000000000; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
    ll H, W, M;
    cin >> H >> W >> M;
    vector<ll> h(M), w(M);
    for (int i = 0; i < M; i++) {
        cin >> h[i] >> w[i]; h[i]--; w[i]--;
    }

    vector<ll> yoko(H, 0);
    vector<ll> yy(H);
    vector<ll> tate(W, 0);
    vector<ll> tt(W);

    for (ll i = 0; i < M; i++) {
        yoko[h[i]]++;
        tate[w[i]]++;
    }    
    for (ll i = 0; i < H; i++) {
        yy[i] = yoko[i];
    }
    for (ll i = 0; i < W; i++) {
        tt[i] = tate[i];
    }

    sort(ALL(yoko), greater<ll> ());
    sort(ALL(tate), greater<ll> ());

    ll Y, T;
    Y = 0; T = 0;
    for (ll i = 0; i < H; i++) {
        if(yoko[i] == yoko[0]){
            Y = i+1;
        }
        else{
            break;
        }
    }
    for (ll i = 0; i < W; i++) {
        if(tate[i] == tate[0]){
            T = i+1;
        }
        else{
            break;
        }
    }

    ll ma = yoko[0] + tate[0];
    ll cnt = 0;
    for (int i = 0; i < M; i++) {
        if(yy[h[i]] + tt[w[i]] == ma){
            cnt++;
        }
    }

    if(cnt == Y*T){
        printf("%lld\n", ma - 1);
    }
    else{
        printf("%lld\n", ma);
    }
    // printf("%lld\n", ma);
    // printf("%lld\n", Y);
    // printf("%lld\n", T);


}

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

using namespace std;
#define int long long
#define maxn 666666
int n,m;

signed main(){
	cin>>n>>m;
	if(m==1){
		cout<<"0";return 0;
	}
	int ans=n;
	ans=min(ans,n%m);
	ans=min(ans,m-n%m);
	cout<<ans;
	return 0;
}

/*
3
1 3 4
6 7 9
1 1 2 3

*/

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <numeric>
#include <functional>
#include <string> 
#include <vector>
#include <bitset>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>

using namespace std;
using ll = long long;

template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;

#define REP(i,n) for(int i = 0; i < int(n); i++)
#define FOR(i, m, n) for(int i = int(m);i < int(n);i++)
#define ALL(obj) (obj).begin(),(obj).end()

const ll MOD = (ll)1e9 + 7;
const ll HINF = (ll)1e18;
const ll LINF = (ll)1e9;
const long double PI = 3.1415926535897932384626433;

vector<int> dy = { 0,0,1,-1 };
vector<int> dx = { 1,-1,0,0 };

template<class T> void corner(bool flg, T hoge) {
	if (flg) {
		cout << hoge << endl;
		exit(0);
	}
	else return;
}

template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {
	o << "{"; for (auto &x : obj) o << " {" << x.first << " : " << x.second << "}" << ","; o << " }"; return o;
}

template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {
	o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;
}

template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {
	o << "{"; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "}"; return o;
}

template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {
	o << "{" << obj.first << ", " << obj.second << "}"; return o;
}

template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {
	o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;
}

void print(void) {
	cout << endl;
}

template <class Head> void print(Head&& head) {
	cout << head;
	print();
}

template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {
	cout << head << " ";
	print(forward<Tail>(tail)...);
}

void YN(bool flg) {
	cout << ((flg) ? "YES" : "NO") << endl;
}

void Yn(bool flg) {
	cout << ((flg) ? "Yes" : "No") << endl;
}

void yn(bool flg) {
	cout << ((flg) ? "yes" : "no") << endl;
}

int main() {
	int N; cin >> N; 
	V<int> D(N); REP(i, N) cin >> D[i];
	int M; cin >> M;
	V<int> T(M); REP(i, M) cin >> T[i];

	map<int, int> mp;
	REP(i, N) mp[D[i]]++;
	bool flg = true;
	REP(i, M) {
		if (mp[T[i]] == 0) flg = false;
		else mp[T[i]]--;
	}
	YN(flg);
	
	return 0;
}



Measured memory_bytes: 11136
n, p = map(int, raw_input().split())
fac = {}
primes = [1]*(10**6 + 200)
i = 2
prim = []
while i <= 10**6 + 100:
    if primes[i]:
        prim.append(i)
        j = i*2
        while j <= 10**6 + 100:
            primes[j] = 0
            j += i 
    i += 1 
for i in prim:
    while p%i == 0:
        p /= i 
        fac[i] = fac[i] + 1 if i in fac else 1
if p > 1:
    fac[p] = 1
ans = 1
for i in fac:
    if fac[i] >= n:
        ans *= i**(fac[i]/n)
print ans

Measured memory_bytes: 12932
#include <iostream>
#define N 50
using namespace std;
typedef struct circle{
  int x,y,z,r;
  long long l;
} Circle;
typedef struct point{
  int x,y,z;
} Point;

int main(){
  int n,q;
  double d;
  Point blue,red;
  Circle c[N];
  cin>>n>>q;
  for(int i=0;i<n;i++) cin>>c[i].x>>c[i].y>>c[i].z>>c[i].r>>c[i].l;
  while(q--){
    cin>>red.x>>red.y>>red.z>>blue.x>>blue.y>>blue.z;
    long long sum=0;
    for(int i=0;i<n;i++){
      int x=c[i].x-red.x,y=c[i].y-red.y,z=c[i].z-red.z;
      int x2=blue.x-red.x,y2=blue.y-red.y,z2=blue.z-red.z;
      int x3=c[i].x-blue.x,y3=c[i].y-blue.y,z3=c[i].z-blue.z;
      int t=(x*x2)+(y*y2)+(z*z2);
      int b_c=x*x2+y*y2+z*z2;
      int a_c=(-x2)*x3+(-y2)*y3+(-z2)*z3;
      d=x*x+y*y+z*z-(1.0*t*t)/(x2*x2+y2*y2+z2*z2);
      if(min(b_c,a_c)<0) d=min(x*x+y*y+z*z,x3*x3+y3*y3+z3*z3);
      if(d<=c[i].r*c[i].r) sum+=c[i].l;
    }
    cout<<sum<<endl;
  }
  return 0;
}

Measured memory_bytes: 1168
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rapido ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"

void solve()
{
   int n;cin>>n;
   vector<int>arr(n);
   for(int i=0;i<n;i++)
   cin>>arr[i];
   
   int ans=0;
   for(int i=0;i<n;i++)
   {
       for(int j=i+1;j<n;j++)
       ans+=arr[i]*arr[j];
   }
   cout<<ans<<endl;
}
int32_t main()
{
         rapido;
         int t;
         //cin>>t;
         t=1;
         while(t--)
         solve();
}

Measured memory_bytes: 3604
using System;
using System.Linq;

class D
{
	static void Main()
	{
		Func<int[]> read = () => Console.ReadLine().Split().Select(int.Parse).ToArray();
		var h = read();
		var qs = new int[h[1]].Select(_ => read()).OrderBy(x => x[1]).ThenBy(x => x[0]).ThenBy(x => x[2]).ToArray();

		var dp = Enumerable.Repeat(-1L, h[0] + 1).ToArray();
		dp[1] = 0;

		foreach (var q in qs)
		{
			if (dp[q[0]] == -1) continue;
			var d = dp[q[0]] + q[2];

			for (int i = q[1]; i > 0; i--)
			{
				if (dp[i] != -1 && dp[i] <= d) break;
				dp[i] = d;
			}
		}
		Console.WriteLine(dp[h[0]]);
	}
}


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

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()

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

    if (a == 1)
    {
        a *= 100;
    }
    if (b == 1)
    {
        b *= 100;
    }

    cout << (a == b ? "Draw" : a > b ? "Alice" : "Bob") << endl;
    return 0;
}


Measured memory_bytes: 3576
using namespace std;
#include<bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0);
#define END return EXIT_SUCCESS;
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR((I),0,(N))
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
#define IN2(P1,P2) cin>>(P1)>>(P2)
#define IN3(P1,P2,P3) cin>>(P1)>>(P2)>>(P3)
#define INS(I,N,V) REP((I),(N)) cin>>(V[I])
#define INS2(I,N,V1,V2) REP((I),(N)) cin>>(V1[I])>>(V2[I]);
#define INS3(I,N,V1,V2,V3) REP((I),(N)) cin>>(V1[I])>>(V2[I])>>(V3[I]);
#define OUT(P) cout<<(P)<<endl
#define OUT2(P1,P2) cout<<(P1)<<" "<<(P2)<<endl
#define OUT3(P1,P2,P3) cout<<(P1)<<" "<<(P2)<<" "<<(P3)<<endl
#define OUTS(I,N,V) REP((I),(N)) cout<<(V[i])<<endl
#define ALL(C) (C).begin(),(C).end()
#define RALL(C) (C).rbegin(),(C).rend()
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}

string N;
inline void solve(){
  IN(N);
  OUT(N[0]==N[2]?"Yes":"No");
}

int main(int argc,char**argv){
  BEGIN
  solve();
  END
}


Measured memory_bytes: 256
// Problem : C - Poll
// Contest : AtCoder Beginner Contest 155
// URL : https://atcoder.jp/contests/abc155/tasks/abc155_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/coder3101/cp-editor)

#include<bits/stdc++.h>
#define pb emplace_back
#define int long long
#define vi vector<int>
#define pii pair<int,int>
#define m_p(x,y) make_pair(x,y)
#define vp vector<pair<int,int>>
#define setbits(x) __builtin_popcountll(x)
#define f first
#define se second
#define iniz(n) memset(n,0,sizeof(n))
#define inin(n) memset(n,-1,sizeof(n))
#define inf LLONG_MAX
using namespace std;
template<typename T1,typename T2>istream &operator>>(istream &is, vector<pair<T1,T2>> &v) { for (pair<T1,T2> &t : v) is >> t.f>>t.se; return is; }
template<typename T>istream &operator>>(istream &is, vector<T> &v) { for (T &t : v) is >> t; return is; }
template<typename T>ostream &operator<<(ostream &os, const vector<T> &v) { for (const T &t : v) {os << t <<" ";} os << '\n'; return os; }
double pi=acos(-1.0);
int md=1000000007;
int abst(int a)
{return a<0?-a:a;}
struct HASH{
  size_t operator()(const pii &x)const{
    return (size_t) x.first * 37U + (size_t) x.second;}};

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

int Pow(int n,int x){int ans=1;
 while(x>0)
 {if(x&1)ans=(ans*n)%md;n=(n*n)%md;x=x>>1;}
 return ans;}

 vi fact,inv;
void inverse(int n)
{inv.resize(n+1);inv[0]=1;
for(int i=1;i<=n;i++)inv[i]=Pow(fact[i],md-2);}
void factorial(int n)
{fact.resize(n+1);fact[0]=1;
for(int i=1;i<=n;i++)fact[i]=(fact[i-1]*i)%md;}

int max(int a,int b){return a>b?a:b;}
int min(int a,int b){return a<b?a:b;}
bool cmp(pair<int,string> p1,pair<int,string> p2)
{
 if(p1.f==p2.f)
	return p1.se<p2.se;
	return p1.f>p2.f;
	
}
void solve()
{
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int n;cin>>n;
map<string,int> mp;
while(n--)
{
	string s;cin>>s;
	mp[s]++;
}
vector<pair<int,string>> v;
for(pair<string,int> p : mp)
v.pb(m_p(p.se,p.f));
sort(v.begin(),v.end(),cmp);
int x=v[0].f;
int i=0;
while(v[i].f==x)
{
	cout<<v[i].se<<"\n";
	i++;
}

}

int32_t main(){
ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
int t=1;
//cin>>t;
while(t--)
{
    solve();
}
}


Measured memory_bytes: 28016
from scipy.sparse.csgraph import csgraph_from_dense
from scipy.sparse.csgraph import floyd_warshall

n, m, energy = map(int, input().split())
edges = [[float('INF')]*n for _ in range(n)]

for i in range(m):
    a, b, c = map(int, input().split())
    edges[a-1][b-1] = c
    edges[b-1][a-1] = c

G = csgraph_from_dense(edges, null_value=float('INF'))
dist = floyd_warshall(G)

L_edges = [[float('INF')]*n for _ in range(n)]
for i in range(n-1):
    for j in range(i, n):
        if dist[i][j] <= energy:
            L_edges[i][j] = 1
            L_edges[j][i] = 1

G = csgraph_from_dense(L_edges, null_value=float('INF'))
answers = floyd_warshall(G)

Q = int(input())
for i in range(Q):
    s, t = map(int, input().split())
    ans = answers[s-1][t-1] - 1
    if ans == float('INF'):
        ans = -1
    print(int(ans))

Measured memory_bytes: 28612
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int ans = 0;
  for (int i = 1; i <= N; ++i) {
    if (int(log10(i)) % 2 == 0) {
      ++ans;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define pb push_back
using ll = long long;
using vin=vector<int>;
using vvin=vector<vin>;
using vll=vector<ll>;
using vvll=vector<vll>;
using vst=vector<string>;
using P = pair<ll,ll>;
const int inf=998244353;
const ll INF=9e18;
template <typename T> bool chmin(T &a, const T& b){if(a > b){a = b;return true;}return false;}
template <typename T> bool chmax(T &a, const T& b){if(a < b){a = b;return true;}return false;}
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };


int main(){cout<<fixed<<setprecision(20);
		   ll a,b,c;
           cin>>a>>b>>c;
           rep(i,0,20000000){
             if(a%2==1||b%2==1||c%2==1){
              cout<<i<<endl;
               return 0;
             }
             ll d=a,e=b,f=c;
             a=d/2+f/2;
             b=e/2+f/2;
             c=d/2+e/2;
             
           }
           cout<<-1<<endl;
}



Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
using ll = long long; using P = pair<int,int>;
using vl = vector<ll>; using vvl = vector<vl>;
#define mp make_pair
#define pb push_back
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(i,n) for (int i=(n-1);i >= 0;i--)
#define all(v) v.begin(),v.end()
#define sz(v) (int)((v).size())
#define MAX(v) *max_element(all(v))
#define MIN(v) *min_element(all(v))
#define Sort(v) sort(all(v))
#define Rev(v) reverse(all(v))
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
#define VEC(type,name,size) vector<type> name(size);in(name)
#define vv(type,name,h,...) vector<vector<type>>name(h,vector<type>(__VA_ARGS__))
#define VV(type,name,h,w) vector<vector<type>>name(h,vector<type>(w));in(name)
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cout << H << " ";
    debug_out(T...);
}
#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...) 
#endif
template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
    for (std::size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
    return os;
}
inline void IN(void){return;}
template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){cin >> first;IN(rest...);return;}
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;}
const ll INF = 1LL << 60;
const ll mod = 1000000007;
const int dx[8] = {1,0,-1,0,1,1,-1,-1}; const int dy[8] = {0,1,0,-1,1,1,-1,-1};

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    int k;
    cin >> k;
    string s;
    cin >> s;
    int n = sz(s);
    if(n<=k) cout << s << endl;
    else{
        rep(i,k) cout << s[i];
        cout << "..." << endl;
    }
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const int N = (3e3) + 3;
bool done1[N][N];
bool done2[N][N];
ll memo1[N][N];
ll memo2[N][N];
int n, a[N];

ll DP1(int i, int j);

ll DP2(int i, int j) {
	if (i > j) return 0;
	ll &ret = memo2[i][j];
	if (done2[i][j]) return ret;
	done2[i][j] = 1;
	ret = min(-a[i] + DP1(i + 1, j), -a[j] + DP1(i, j - 1));
	return ret;
}

ll DP1(int i, int j) {
	if (i > j) return 0;
	ll &ret = memo1[i][j];
	if (done1[i][j]) return ret;
	done1[i][j] = 1;
	ret = max(a[i] + DP2(i + 1, j), a[j] + DP2(i, j - 1));
	return ret;
}

int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; ++i) {
		scanf("%d", &a[i]);
	}
	ll ans = DP1(0, n - 1);
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 158976