akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <string>

typedef long long ll;
using namespace std;

int main()
{
    int sx, sy, tx, ty;
    cin >> sx >> sy >> tx >> ty;

    const int dx = tx - sx, dy = ty - sy;

    //1回目行き
    cout << string(dy, 'U') << string(dx, 'R');

    //1回目帰り
    cout << string(dy, 'D') << string(dx, 'L');

    //2回目行
    cout << 'L' << string(dy + 1, 'U') << string(dx + 1, 'R') << 'D';

    //2回目帰り
    cout << 'R' << string(dy + 1, 'D') << string(dx + 1, 'L') << 'U';

    cout << endl;
    return 0;
}

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

using namespace std;
 
#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back
 
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<bool> VB;

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

}

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



const int N = 1e5 + 5;



int n, MOD, dp1[N], dp2[N];
vector < int > g[N];

void dfs1(int v, int pr = -1){
    dp1[v] = 1;
    for(int to : g[v]){
        if(to == pr){
            continue;
        }
        dfs1(to, v);
        dp1[v] = 1LL * dp1[v] * (dp1[to] + 1) % MOD;
    }
}

void dfs2(int v, int pr = -1){
    if(pr != -1){
        g[v].erase(find(g[v].begin(), g[v].end(), pr));
    }
    if(g[v].empty()){
        return;
    }
    vector < int > pref((int)g[v].size() + 1),
                   suf((int)g[v].size() + 1);
    pref[1] = (dp1[g[v][0]] + 1) % MOD;
    for(int i = 2; i <= (int)g[v].size(); i++){
        pref[i] = 1LL * pref[i - 1] * (dp1[g[v][i - 1]] + 1) % MOD;
    }
    suf[(int)g[v].size()] = (dp1[g[v].back()] + 1) % MOD;
    for(int i = (int)g[v].size() - 1; i >= 1; i--){
        suf[i] = 1LL * suf[i + 1] * (dp1[g[v][i - 1]] + 1) % MOD;
    }
    for(int i = 1; i <= (int)g[v].size(); i++){
        int to = g[v][i - 1];
        int cur = (dp2[v]) % MOD;
        if(i - 1 >= 1){
            cur = 1LL * cur * pref[i - 1] % MOD;
        }
        if(i + 1 <= (int)g[v].size()){
            cur = 1LL * cur * suf[i + 1] % MOD;
        }
        cur = (cur + 1) % MOD;
        dp2[to] = cur;
        dfs2(to, v);
    }
}
int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin >> n >> MOD;
    for(int i = 1; i < n; i++){
        int x, y;
        cin >> x >> y;
        g[x].push_back(y);
        g[y].push_back(x);
    }
    dfs1(1);
    dp2[1] = 1;
    dfs2(1);
    for(int i = 1; i <= n; i++){
        cout << 1LL * dp1[i] * dp2[i] % MOD << "\n";
    }
    return 0;
}


Measured memory_bytes: 17664
#include <string>
#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
    string s;
    cin >> s;
    int num = 0;

    for (int i = 0; i < 4; i++)
    {
        if (s[i] == '+')
        {
            num++;
        }
        else
        {
            num--;
        }
    }

    printf("%d", num);
}


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

#define MAX_N 200000
#define MAX_R 1000000000

int main() {
  int n, lst_r[MAX_N];

  cin >> n;
  rep(i, n) cin >> lst_r[i];

  int min_r = lst_r[0], ans = -1 * MAX_R;
  rep(i, n - 1) {
    int idx = i + 1;
    if (lst_r[idx] - min_r > ans) ans = lst_r[idx] - min_r;
    if (lst_r[idx] < min_r) min_r = lst_r[idx];
  }
  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 3880
#include<bits/stdc++.h>
#define int long long
#define mod 1000000007
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define sa(a,n) for(int i =0 ; i<n ; i++) cin>>a[i]
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define pb push_back
#define inf 2e18
#define scan() int n; cin>>n ; int a[n]; for(int i = 0 ; i<n ; i++) cin>>a[i]
#define print(a,n) for(int i = 0 ; i < n ; i++) cout<<a[i]<<' '
#define mem(a,v) memset(a,v,sizeof(a))
#define pii pair<int,int>
#define mkp make_pair
using namespace std;
#define N 200005

int n;
double a[3004];
double catche[3004][3004];
int vis[3004][3004];

double dp (int idx, int head){
    if(idx>n){
        int tails=(idx-1-head);
        if(head>tails)return 1;
        return 0;

    }
    double &ans=catche[idx][head];
    if(vis[idx][head]==1){
        return ans;
    }
    vis[idx][head]=1;
    
    ans=dp(idx+1,head+1)*a[idx];
 //   int tail=idx-head-1;
    ans+=dp(idx+1,head)*(1-a[idx]);
    return ans;
}


int32_t main(){
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        cout.tie(NULL);

        cin >> n;
        int i;
        
        for(i=1; i<=n; i++){
            cin >> a[i];
        }
        double r=dp(1,0);
        cout << fixed << setprecision(12) << r<< '\n';

}

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

 using namespace std;
 typedef long long ll;
 #define rep(i, n) for(int i = 0; i < (int)(n); i++)

 int main() {
   int N, ans = 0;
   string S;
   cin >> N >> S;

   for (int i = 0; i < N; i++) {
     if (S.at(i) == '*') continue;
     for (int j = i + 1; j < N; j++) {
       if (S.at(i) == S.at(j)) S.at(j) = '*';
       else break;
     }
   }

    rep(i, N) {
      if (S.at(i) != '*') ans++;
    }
    cout << ans << endl;
 }


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define N 1000000007
#include<fstream>
using namespace std;
vector<vector<long>>adj;
vector<vector<long>>adjf;
map<long,bool>vis,viss;
map<pair<long,long>,bool>f;
map<long,long>aa,bb,cc;
unsigned long long power(unsigned long long x, 
                         long long y, long long p) 
{ 
    unsigned long long res = 1; // Initialize result 
  
    x = x % p; // Update x if it is more than or 
    // equal to p 
  
    while (y > 0) { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res * x) % p; 
  
        // y must be even now 
        y = y >> 1; // y = y/2 
        x = (x * x) % p; 
    } 
    return res; 
} 
  
// Returns n^(-1) mod p 
unsigned long long modInverse(unsigned long long n, long long p) 
{ 
    return power(n, p - 2, p); 
} 

unsigned long long ncrmp(unsigned long long n, 
                                 long long int r, long long int p) 
{ 
    // Base case 
    if (r == 0) 
        return 1; 
  
    
    unsigned long long fac[n + 1]; 
    fac[0] = 1; 
    for (int i = 1; i <= n; i++) 
        fac[i] = (fac[i - 1] * i) % p; 
  
    return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p; 
} 
int main(){
 
      
  long n; double t;
  cin>>n;
  vector<double>p;
  for(long i=0;i<n;i++){cin>>t; p.push_back(t);}
  
  double dp[n+1][n+1];        //dp[i][j] is getting j heads considering first i coins
  for(long i=1;i<=n;i++){
      dp[0][i]=0;    //as we cant get non zero number of heads without considering any elemnt  
      
  }
  dp[0][0]=1; //imp

  for(long i=1;i<n;i++){
     dp[i][0]=dp[i-1][0]*(1-p[i-1]); 
      
  }
  for(long i=1;i<=n;i++){
      for(long j=1;j<=n;j++){
          dp[i][j]=dp[i-1][j]*(1-p[i-1])+dp[i-1][j-1]*p[i-1];
      }
  }
  double ans=0;
  for(long i=(n+1)/2;i<=n;i++){
      ans=ans+dp[n][i];
  }
  cout<<fixed<<setprecision(10)<<ans<<endl;
     return 0;                               
}


Measured memory_bytes: 74204
#include <stdio.h>

void ExEuclidean(int a, int b, int *x, int *y);

int main(void){
  int a, b, x, y;

  scanf("%d%d", &a, &b);
  ExEuclidean(a, b, &x, &y);
  printf("%d %d\n", x, y);
  return 0;
}


void ExEuclidean(int a, int b, int *x, int *y){
  int r, q, temp, x1 = 1, y1 = 0, x2 = 0, y2 = 1;

  if (a < b){
    temp = a;   a = b;    b = temp;
    temp = x1;  x1 = x2;  x2 = temp;
    temp = y1;  y1 = y2;  y2 = temp;
  }
  while(b != 0){
    q = a / b;
    r = a % b;
    x1 -= x2 * q;
    y1 -= y2 * q;
    temp = x1;  x1 = x2;  x2 = temp;
    temp = y1;  y1 = y2;  y2 = temp;
    a = b;
    b = r;
  }
  *x = x1;
  *y = y1;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B;
string S;
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
typedef pair<ll,ll> P;

int main(){
    cin>>N;
    vec a(N);
    rep(i,N) cin>>a[i];
    ll minus = 0;
    rep(j,60){
        ll num = 0;
        rep(i,N) num += (a[i]>>j)&1;
        ll kumi = (num == 0 ? 0 : num * (num - 1) / 2);
        (minus += ((kumi%MOD) * ((1LL<<(j + 1))%MOD))%MOD)%=MOD;
    }
    ll ans = MOD - minus;
    rep(i,N){
        (ans += ((N - 1) * (a[i]%MOD))%MOD)%=MOD;
    }
    cout<<ans%MOD<<endl;
}


Measured memory_bytes: 2688
def euclidean(x, y):
    b = max(x, y)
    s = min(x, y)
    while True:
        ns = b % s
        if ns == 0:
            return s
        b = s
        s = ns

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

W = set()
for n in range(N):
    if n == 0:
        v = A[n]
    elif n == 1:
        nW = set()
        nW.add(v)
        nW.add(A[n])
        v = euclidean(v, A[n])
        W = nW
    else:
        nW = set()
        nW.add(v)
        for w in W:
            nW.add(euclidean(w, A[n]))
        v = euclidean(v, A[n])
        W = nW
print(max(W))


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

int main() {
	int x;
	cin >> x;
	int ans = 0;
	ans += x / 500 * 1000;
	x %= 500;
	ans += x/5 * 5;
	cout << ans << endl;
	return 0;
}

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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    string S, T; cin >> S >> T;
    bool flag = true;
    rep(i, S.size()){
        if (S[i] != T[i]){flag = false; break;}
    }
    string ans = flag ? "Yes" : "No";
    cout << ans << endl;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 3656
#include <cstdio>
#include <iostream>
#define N 101
using namespace std;
int h,w,n,a[N*N],idx,id[N][N],col[N*N];
int main(){
	scanf("%d%d%d",&h,&w,&n);
	for(int i=1;i<=n;++i)scanf("%d",&a[i]);
	for(int i=1;i<=h;++i)
		for(int j=i&1 ? 1:w;i&1 ? j<=w:j;i&1 ? ++j:--j)id[i][j]=++idx;
    for(int i=1,j=1;i<=h*w;++i){
	    if(!a[j])++j;
		--a[col[i]=j];
	}
	for(int i=1;i<=h;++i){
		for(int j=1;j<=w;++j)printf("%d ",col[id[i][j]]);
		printf("\n");
	}    
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define sz(V) ((int)(V).size())
#define allv(V) ((V).begin()),((V).end())
#define befv(V) ((V)[(sz(V)-2)])
#define sorv(V) sort(allv(V))
#define revv(V) reverse(allv(V))
#define univ(V) (V).erase(unique(allv(V)),(V).end())
#define clv(V) (V).clear()
#define upmin(a,b) (a)=min((a),(b))
#define upmax(a,b) (a)=max((a),(b))
#define rb(x) ((x)&(-(x)))
#define cb(x) (x)=(!(x))
#define INF (0x3f3f3f3f)
#define INFLL (0x3f3f3f3f3f3f3f3fll)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

const int MOD = 1000000007;
const int MAXN = 55;

int dp[MAXN][MAXN*2][MAXN*2];

int B[MAXN], C[MAXN];

int A[MAXN*2];

int N, Ans;

void add(int &a, ll b) { a = ((b+a) % MOD + MOD) % MOD; }

int main() {
	ios::sync_with_stdio(false);

	cin >> N;
	if(1 == N) {
		puts("1");
		return 0;
	}
	for(int i = 1; i < N*2; i++) cin >> A[i];

	{
		sort(A+1, A+N*2);
		vector<int> V;
		for(int i = 1; i < N*2; i++) V.eb(A[i]);
		univ(V);
		for(int i = 1; i < N*2; i++)
			A[i] = int(lower_bound(allv(V), A[i]) - V.begin()) + 1;
	}

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

	B[1] = C[1];
	dp[1][1][1] = 1;
	for(int i = 1; i < N; i++) {
		for(int j = 1; j <= C[i]-B[i]+1; j++) {
			for(int k = 1; k <= j; k++) {
				int ret = dp[i][j][k];
				if(!ret) continue;

				int lc = B[i] - B[i+1], rc = C[i+1] - C[i];
				for(int l = 1; l <= k+lc; l++)
					add(dp[i+1][j+lc+rc - max(0, k+lc-l-1)][l], ret);
				for(int l = k+lc+1; l <= j+lc+rc; l++)
					add(dp[i+1][j+lc+rc - max(0, l-k-lc-1)][k+lc+1], ret);
			}
		}
	}

	for(int i = 1; i <= C[N]-B[N]+1; i++) for(int j = 1; j <= i; j++)
		add(Ans, dp[N][i][j]);
	cout << Ans << endl;
	return 0;
}

Measured memory_bytes: 1536
#include<bits/stdc++.h>
using namespace std;
#define mem(a) memset(a,0,sizeof(a))
#define ll long long
//想了好久简便算法，突然发现好像不会超时。。。 
int main()
{
	ll need,sum=100;
	int year=0;
	cin>>need;
	while(sum<need)
	{
		sum=sum+sum/100;
		year++;
	}
	cout<<year;
	return 0;
}

Measured memory_bytes: 3636
#include "bits/stdc++.h"
// Begin Header {{{
#define all(x)          (x).begin(), (x).end()
#define rep(i, s, n)    for (i64 i = (s), i##_limit = (n); i < i##_limit; ++i)
#define repr(i, s, t)   for (i64 i = (s), i##_limit = (t); i >= i##_limit; --i)
#define var(type, ...)  type __VA_ARGS__; read(__VA_ARGS__);
#ifndef DBG
#define dump(...)
#endif
using namespace std;
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T, class U> inline bool chmax(T &a, const U &b) { return b > a && (a = b, true); }
template <class T, class U> inline bool chmin(T &a, const U &b) { return b < a && (a = b, true); }
constexpr int INF  = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;

template <class T>
inline vector<T> makeV(const T &initValue, size_t sz) {
    return vector<T>(sz, initValue);
}

template <class T, class... Args>
inline auto makeV(const T &initValue, size_t sz, Args... args) {
    return vector<decltype(makeV<T>(initValue, args...))>(sz, makeV<T>(initValue, args...));
}

template <class T>
inline istream& operator>> (istream &is, vector<T> &vec) {
    for (auto &e : vec) is >> e;
    return is;
}

inline void read() {}

template <class Head, class... Tail>
inline void read(Head &head, Tail&... tail) { cin >> head; read(tail...); }

inline void print() { cout << "\n"; }

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

template <class T>
inline ostream& operator<< (ostream &os, const vector<T> &vec) {
    static constexpr const char *delim[] = { " ", "" };
    for (const auto &e : vec) os << e << delim[&e == &vec.back()];
    return os;
}

template <class Container>
struct Rev {
    Container &x_;
    inline Rev(Container &x): x_(x) {}
    inline auto begin() { return rbegin(x_); }
    inline auto end() { return rend(x_); }
};
// }}} End Header

signed main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr);

    var(int, N);
    vector<int> a(N);
    vector<int> pos(N + 1);

    rep(i, 0, N) {
        read(a[i]);
        --a[i];
        pos[a[i]] = i;
    }

    vector<int> dp(N);
    repr(i, N-1, 0) {
        if (pos[a[i] + 1] > i) {
            dp[i] = dp[pos[a[i] + 1]] + 1;
        } else {
            dp[i] = 1;
        }
    }

    print(N - *max_element(all(dp)));

    return 0;
}


Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
vector<long>moves;
vector<long>dp;
long l;
unordered_set<long> moove;
int calculateMex(unordered_set<int> Set) 
{ 
    int Mex = 0; 
  
    while (Set.find(Mex) != Set.end()) 
        Mex++; 
  
    return (Mex); 
} 
long grundy(long n){
    if(n<l) return 0;
    if(dp[n]!=-1)return dp[n];
    if(n==0) return 0; 
    if(moove.find(n)!=moove.end())return 1;
    unordered_set<int> s;
    for(int i=0;i<moves.size();i++){
        s.insert((n-moves[i]>=0)?grundy(n-moves[i]):1);
    }
    dp[n]=calculateMex(s);
    //0cout<<n<<"-->"<<dp[n];
    return dp[n];
}
int main(){
    // unordered_set<int> move;
    // vector<int>moves
    long n,k;
    cin>>n>>k;
    dp.resize(k+1,-1);
    moves.resize(n);
    l=1e6;
    for(int i=0;i<n;i++){
        cin>>moves[i];
        l=min(moves[i],l);
        moove.insert(moves[i]);
    }
    // grundy(k);
    if(grundy(k)==0) cout<<"Second";
    else cout<<"First";
    return 0;
    
    
}

Measured memory_bytes: 24960
#include <iostream>
#include <string>
using namespace std;
#define rep(i,n) for((i)=0;(i)<(n);(i)++)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
typedef long long ll;
typedef long double ld;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
int main(){
  ll n,m,k,i,j,result=0;
  int a[200010]={0};
  string s;
  cin >> n;
  rep(i,n) cin >> a[i];
  m=0;
  rep(i,n){
    if(a[i]!=i+1) m++;
  }
  cout << (m<=2 ? "YES" : "NO") << endl;
  return 0;
}

Measured memory_bytes: 4348
#include<bits/stdc++.h>
using namespace std;
int main(){
  string x;
  for(int i=0;i<26;++i) x+='A'+i;
  for(int i=0;i<26;++i) x+='a'+i;
  x+=x;
  int n;
  while(cin>>n,n){
    int k[n];
    for(int i=0;i<n;++i) cin>>k[i];
    string s,t;
    cin>>s;
    for(int i=0,j=0;i<s.size();++i,++j){
      if(j==n) j=0;
      for(int l=x.size()-1;;--l){
	if(s[i]==x[l]){
	  t+=x[l-k[j]];
	  break;
	}
      }
    }
    cout<<t<<endl;
  }
  return 0;
}

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

using namespace std;

#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

int main()
{
    FAST();
    int n,ans=0;
    double d,x,y;
    cin >> n >> d;
    while(n--)
    {
        cin >> x >> y;
        if(sqrt(x*x+y*y) <= d)++ans;
    }
    cout << ans;
    return 0;
}


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

using namespace std;

char d[100004];
long long k, cnt=0;
vector<long long> v;

int main() {
    scanf("%s",d);
    scanf("%lld",&k);
    char bef=d[0]; int cc=1;
    for (long long i=1; i<strlen(d); i++) {
        if (bef==d[i]) cc++;
        else {
            v.push_back(cc); cc=1;
            bef=d[i];
        }
    }
    if (cc!=1) v.push_back(cc);
    /* for (int i=0; i<v.size(); i++) printf("%d ",v[i]);
    printf("\n"); */
    if (v.size()==1) {
        printf("%lld",(v[0]*k)/2);
    }
    else if (v.size()==0 && strlen(d)>1) {
        if (d[0]==d[strlen(d)-1]) printf("%lld",k-1);
        else printf("0");
    }
    else if (v.size()==0 && strlen(d)==1) {
        printf("%lld",k/2);
    }
    else if (d[strlen(d)-1]==d[0] && k>1) {
        for (long long i=1; i<v.size()-1; i++) cnt+=v[i]/2;
        cnt=cnt*k;
        cnt+=(v[0]+v[v.size()-1])/2*(k-1);
        cnt+=v[0]/2+v[v.size()-1]/2;
        printf("%lld",cnt);
    }
    else {
        for (int i=0; i<v.size(); i++) cnt+=v[i]/2;
        printf("%lld",cnt*k);
    }
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){

	int i,j,tmp,card[5]={0},pair[5],count[4];
	char *rank[30];
	while(scanf("%d,%d,%d,%d,%d",&card[0],&card[1],&card[2],&card[3],&card[4])!=EOF){
		for(i=0;i<5;i++) pair[i]=0;
		for(i=0;i<4;i++) count[i]=0;
		*rank="";

		for(i=0;i<5;i++){
			for(j=1;j<5-i;j++){
				if(card[j-1]>card[j]){
					tmp=card[j-1];
					card[j-1]=card[j];
					card[j]=tmp;
				}
			}
		}

		for(i=0;i<5;i++){
			for(j=0;j<5;j++){
				if(card[i]==card[j]){
					pair[i]++;
				}
			}
		}

		for(i=0;i<5;i++){
			if(pair[i]==4){
				*rank="four card";
				break;
			}
			else if(pair[i]==2){
				for(j=0;j<5;j++){
					if(pair[j]==3){
						*rank="full house";
						break;
					}
				}
				if(*rank=="full house") break;
			}
			else if(pair[i]==3){
				for(j=0;j<5;j++){
					if(pair[j]==2){
						*rank="full house";
						break;
					}
				}
				if(*rank=="full house") break;
				*rank="three card";
			}
			if(pair[i]==2) count[1]++;
		}
		if(card[0]+1==card[1] && card[0]+2==card[2] && card[0]+3==card[3] && card[0]+4==card[4]) *rank="straight";
		else if(card[0]+9==card[1] && card[0]+10==card[2] && card[0]+11==card[3] && card[0]+12==card[4]) *rank="straight";
		else if(count[1]==4) *rank="two pair";
		else if(count[1]==2 && *rank=="") *rank="one pair";
		else if(*rank=="") *rank="null";

		printf("%s\n",*rank);

	}





	return 0;

}

Measured memory_bytes: 580
# 最大値と最小値を調べておいて、それを掛け合わせる

n = int(input())
left_heights = list(map(int, input().split()))
right_heights = list(map(int, input().split()))

minimum = [-1] * n
maximum = [10**10] * n

l_max = 0
for i in range(n):
    if left_heights[i] > l_max:
        maximum[i] = left_heights[i]
        minimum[i] = left_heights[i]
    else:
        maximum[i] = left_heights[i]
        minimum[i] = 1
    l_max = left_heights[i]

r_max = 0
for i in reversed(range(n)):
    if right_heights[i] > r_max:
        if minimum[i] <= right_heights[i] <= maximum[i]:
            maximum[i] = right_heights[i]
            minimum[i] = right_heights[i]
        else:
            print(0)
            exit()
    else:
        if r_max >= minimum[i]:
            maximum[i] = min(right_heights[i], maximum[i])
            minimum[i] = max(1, minimum[i])  # 多分この行は不要
        else:
            print(0)
            exit()

    r_max = right_heights[i]

mod = 10**9 + 7
ans = 1
for mi, ma in zip(minimum, maximum):
    ans *= ma - mi + 1
    ans %= mod
print(ans)


Measured memory_bytes: 24548
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> VI;

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 (a>b) { a=b; return 1; } return 0; }
#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 all(x) (x).begin(),(x).end()

int main() {
    int n;
    cin >> n;
    int ab, a, b, ba;
    ab = a = b = ba = 0;
    rep (i, n) {
        string s;
        cin >> s;
        rep(i, s.size() - 1) {
            if (s[i] == 'A' && s[i+1] == 'B') {
                ab++;
            }
        }
        if (s[0] == 'B' && s[s.size() - 1] == 'A') {
            ba++;
        } else if (s[0] == 'B') {
            b++;
        } else if (s[s.size() - 1] == 'A') {
            a++;
        }
    }
    int ans = ab;
    ans += max(ba - 1, 0);
    if (a > 0 && ba > 0) {
        ans++;
        a--;
    }
    if (b > 0 && ba > 0) {
        ans++;
        b--;
    }
    ans += min(a, b);
    cout << ans << endl;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll MOD = 1000000007;
const ll INF = 10000000000000000;
vector<int> x4 = {0, 1, 0, -1}, x8 = {0, 1, 1, 1, 0, -1, -1, -1};
vector<int> y4 = {1, 0, -1, 0}, y8 = {1, 1, 0, -1, -1, -1, 0, 1};
template<class T> struct edge { int from, to; T cost;};
template<class T> inline bool chmin(T& a, T b){if (a>b){a = b; return true;}return false;}
template<class T> inline bool chmax(T& a, T b){if (a<b){a = b; return true;}return false;}
template<class T> inline T powerM(T a,T b){if (b==0) return 1;
T tmp = powerM(a,b/2); if (b%2==0) return tmp*tmp%MOD; else return tmp*tmp%MOD*a%MOD; }
template<class T> inline T power(T a,T b,T m){ if (b==0) return 1;
  T tmp = power(a,b/2,m); if (b%2==0) return tmp*tmp%m; else return tmp*tmp%m*a%m; }
template<class T> inline T gcd(T a, T b){if (b==0) return a; return gcd(b, a%b);}
template<class T> inline T lcm(T a, T b){return a / gcd(a,b) * b;}
// ax+by=gcd(a,b)を解く
template<class T> inline T extgcd(T a,T b,T &x,T &y){if (b==0){x=1; y=0; return a;} T d=extgcd(b,a%b,y,x); y -= a/b*x; return d;}
void hey(){ cout <<"hey" <<endl; }


int r,c;

int main() {
  cin >>r >>c;
  vector<vector<int>> field(r+1, vector<int>(c+1, 0));
  rep(i, r) rep(j, c) cin >>field[i][j];
  rep(i, r) rep(j, c) field[i][c] += field[i][j];
  rep(j, c+1) rep(i, r) field[r][j] += field[i][j];
  rep(i, r+1){
    rep(j, c+1){
      cout <<field[i][j];
      if (j == c) cout <<endl;
      else cout <<" ";
    }
  }
}



Measured memory_bytes: 3164
#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
	// your code goes here
	ll n,x;
	cin>>n;
	vector<ll> v;
	unordered_map<ll,ll> mp;
	for(ll i=0;i<n;i++)
	{
		cin>>x;
		if(mp.find(x)==mp.end())
		{
			v.push_back(x);
		}
		mp[x]++;
	}
	ll cnt=0;
	for(ll i=0;i<v.size();i++)
	{
		if(mp[v[i]]<v[i])
			cnt+=mp[v[i]];
		else if(mp[v[i]]>v[i])
			cnt+=mp[v[i]]-v[i];
	}
	cout<<cnt<<endl;
	return 0;
}

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

N, M = list(map(int, input().split()))
h_list = list(map(int, input().split()))
h_dict = {i + 1: h for i, h in enumerate(h_list)}
h_set = set(h_dict.keys())
no_list = []

for _ in range(M):
    a, b = list(map(int, input().split()))
    if h_dict[a] == h_dict[b]:
        no_list.append(a)
        no_list.append(b)
    elif h_dict[a] > h_dict[b]:
        no_list.append(b)
    else:
        no_list.append(a)

no_set = set(no_list)
ans = len(h_set - no_set)

print(ans)


Measured memory_bytes: 35280
import java.util.*;

class Main {

    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int C = scan.nextInt();
        int p;
        int total = 0;
        for (int i = 0; i < C; i++) {
            p = scan.nextInt();
            total += p;   
        }
        
        if(total % (N + 1) == 0){
            System.out.println(total / (N+1));
            
       } else {
            System.out.println((total / (N+1)) + 1);
       
        }
    
    }
}


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

int main() {
    string S, T;
    cin >> S >> T;

    int res = 0;
    if (S[0] == T[0]) res++;
    if (S[1] == T[1]) res++;
    if (S[2] == T[2]) res++;

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
typedef long long ll;
using namespace std;
const int maxn=2e5+5;

int a[maxn];
int Abs(int x){return x>=0?x:-x;}
int main()
{
    int n,x,y,tn,d;
    scanf("%d%d%d",&n,&x,&y);
    tn=n-(y-x-1);
    for(int i=1;i<tn;i++)a[i]=tn-i;
    for(int i=x+1;i<y;i++)
    {
        d=min(i-x,y-i+1);
        for(int j=x;j>=1;j--)a[min(i-j,x-j+y-i+1)]++;
        d=min(y-i,i-x+1);
        for(int j=i+1;j<=n;j++)a[min(j-i,Abs(j-y)+i-x+1)]++;
    }
    for(int i=1;i<n;i++)printf("%d\n",a[i]);
}

Measured memory_bytes: 888
#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll long long
using namespace std;
const int N=100010;
struct node{
	int x,id;
}a1[N];
int n;
ll ans[N];
inline int read(){
	int x=0,f=0;
	char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return f?-x:x;
}
bool cmp(node i,node j){
	if(i.x!=j.x)return i.x>j.x;
	return i.id>j.id;
}
int main(){
	n=read();
	for(int i=1;i<=n;i++){a1[i].x=read();a1[i].id=i;}
	sort(a1+1,a1+n+1,cmp);
	a1[n+1].x=0;
	memset(ans,0,sizeof ans);
	for(int mn=n+1,i=1;i<=n+1;i++){
		if(a1[i].x!=a1[i-1].x)ans[mn]+=1ll*(i-1)*(a1[i-1].x-a1[i].x);
		mn=min(mn,a1[i].id);
	}
	for(int i=1;i<=n;i++)printf("%lld\n",ans[i]);
	return 0;
}

Measured memory_bytes: 2560
#include <string>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string.h>
#include <utility>
#include <queue>
#include <stack>
#include <iomanip>
#include <ctype.h>
#include <map>
#include <set>
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
#include <sstream>
#include <math.h>
#include <time.h>
#include <iostream>
#include <iomanip>
#include <unordered_set>
#include <unordered_map>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <tuple>
#include <cmath>
#include <stdio.h>      /* printf, fgets */
#include <stdlib.h>
#include <fstream>

using namespace std;

typedef long long LL;

#define FOR(i,n) for(int i = 0;i < n;i++)
#define MP make_pair
#define PB push_back
#define ALL(a) (a).begin(),(a).end()
#define PII pair<int, int>
#define PLL pair<long long, long long>
#define CLEAR(a) memset(a, 0, sizeof(a))
#define ERASE(a) memset(a, -1, sizeof(a))
#define INF 2000000007LL
#define y1 uu1
#define y2 uu2
const double EPS = 1E-12;
const double PI = acos(-1.0);
const LL mod = 1000000007;

using namespace std;

int n;
char dp[110005];

void solve() {
  cin >> n;
  dp[0] = 1;
  FOR(i, n) {
    if (dp[i]) {
      for (int j = 100; j <= 105; j++) {
        dp[i+j] = 1;
      }
    }
  }
  cout << (int)dp[n] << endl;
}

int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(0);
  solve();
  return 0;
}


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

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

const long long INF = 1LL << 60;

int main() {
  int n, k;
  cin >> n >> k;
  long long h[100100];

  for (int i = 0; i < n; i++) cin >> h[i];

  long long dp[101000];
  for (int i = 0; i < 101000; i++) dp[i] = INF;
  dp[0] = 0;

  for (int i = 0; i < n; i++)
    for (int j = 1; j <= k; j++) {
      chmin(dp[i+j], dp[i] + abs(h[i] - h[i+j]));
  }
  cout << dp[n-1] << endl;
}

Measured memory_bytes: 1792
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b)) < EPS)

using namespace std;

class Point{
  public:
  double x, y;

  Point(double x=0, double y=0): x(x), y(y) {}

  Point operator + (Point p) { return Point(x+p.x, y+p.y); }
  Point operator - (Point p) { return Point(x-p.x, y-p.y); }
  Point operator * (double a) { return Point(a*x, a*y); }
  Point operator / (double a) { return Point(x/a, y/a); }

  double abs() {return sqrt(norm()); }
  double norm() { return x*x+y*y; }

  bool operator < (const Point &p) const{
    return x!=p.x ? x<p.x : y<p.y;
  }

  bool operator == (const Point &p) const{
    return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS;
  }

};

//(?????¢??????)????????????????????¨????§????????????§??????
typedef Point Vector;

//???????????????
typedef struct Segment{
  Point p1, p2;
}Segment;

//??´??????????§??????????
typedef Segment Line;


//?????????????????????
double dot(Vector a, Vector b){
  return a.x*b.x+a.y*b.y;
}

//?????????????????????
double cross(Vector a, Vector b){
  return a.x*b.y-a.y*b.x;
}

//??´?????????(????????????????????????0????????´???)
bool isOrthogonal(Vector a, Vector b){
  return equals(dot(a,b), 0.0);
}
bool isOrthogonal(Point a1, Point a2, Point b1, Point b2){
  return isOrthogonal(a1- a2, b1-b2);
}
bool isOrthogonal(Segment s1, Segment s2){
  return equals(dot(s1.p2-s1.p1, s2.p2-s2.p1), 0.0);
}

//????????????(??????????????????????????§?????????0????????????)
bool isParallel(Vector a, Vector b){
  return equals(cross(a,b), 0.0);
}
bool isParallel(Point a1, Point a2, Point b1, Point b2){
  return isParallel(a1- a2, b1-b2);
}
bool isParallel(Segment s1, Segment s2){
  return equals(cross(s1.p2-s1.p1, s2.p2-s2.p1), 0.0);
}



int main(){
  int q;
  scanf(" %d", &q);
  for(int i=0; i<q; ++i){
    Segment a,b;
    scanf(" %lf %lf %lf %lf %lf %lf %lf %lf", &a.p1.x, &a.p1.y, &a.p2.x, &a.p2.y, &b.p1.x, &b.p1.y, &b.p2.x, &b.p2.y );

    if(isParallel(a,b)) printf("2\n");
    else if(isOrthogonal(a,b)) printf("1\n");
    else printf("0\n");
  }
}

Measured memory_bytes: 1204
#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 watch(x) cout<<(#x)<<"="<<(x)<<'\n'
#define mset(d,val) memset(d,val,sizeof(d))
#define setp(x) cout<<fixed<<setprecision(x)
#define forn(i,a,b) for(int i=(a);i<(b);i++)
#define fore(i,a,b) for(int i=(a);i<=(b);i++)
#define pb push_back
#define F first
#define S second
#define pqueue priority_queue
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef long double ld;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;
void amin(ll &a, ll b){ a=min(a,b); }
void amax(ll &a, ll b){ a=max(a,b); }
void YES(){cout<<"YES\n";} void NO(){cout<<"NO\n";}
void SD(int t=0){ cout<<"PASSED "<<t<<endl; }
const ll INF = ll(1e18);
const int MOD = 998244353;

const bool DEBUG = 0;
const int MAXN = 100005;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	
	ll d,t,s; cin>>d>>t>>s;
	if(d<=t*s) cout<<"Yes\n";
	else cout<<"No\n";
	
	return 0;
}


Measured memory_bytes: 3644
#include<stdio.h>
#include<vector>
#include<algorithm>
#include <string>
using std::string;
struct Info {
public:
	int i;
	string s;
	int p;
	bool operator< (const Info &b)const {
		if (s == b.s) {
			return p > b.p;
		}
		else {
			return s < b.s;
		}
	}
};


int main()
{
	int N = 0;
	std::vector<Info> info;
	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		char s[11];
		int q = 0;
		scanf("%s %d", s, &q);
		Info data = { i,s,q };
		info.push_back(data);
	}
	sort(info.begin(), info.end());
	for (int i = 0; i < N; i++) {
		printf("%d\n", info[i].i + 1);
	}
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int X = sc.nextInt();

        int count = 1;
        int D = 0;
        for (int i = 0; i < N; i++) {
            D +=sc.nextInt();
            if(D > X){
                break;
            }
            count++;
        }

        System.out.println(count);
    }

}


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

using namespace std;


int main(){
    int n,k;
    int temp;
    int mask = 0;
    scanf("%d %d",&n,&k);
    
    for(int i = 0; i < (1 << n);i++){
        if(__builtin_popcount(i) == k){
            printf("%d:",i);
            for(int j = 0;j < n;j++){
                if( i&(1<<j) ) printf(" %d",j);
            }
            printf("\n");
        } 
    }
    
    return 0;   
}



Measured memory_bytes: 3236
#include <bits/stdc++.h>
using namespace std;
int main(void){
    vector<vector<int>> c(3,vector<int>(3,0));
    for(int i=0;i<3;i++){
        for(int j=0;j<3;j++){
            cin>>c[i][j];
        }
    }
    for(int i=0;i<=100;i++){
        for(int j=0;j<=100;j++){
            for(int k=0;k<=100;k++){
                if((c[0][0]-i)==(c[1][0]-j)&&(c[0][0]-i)==(c[2][0]-k)){
                    if((c[0][1]-i)==(c[1][1]-j)&&(c[0][1]-i)==(c[2][1]-k)){
                        if((c[0][2]-i)==(c[1][2]-j)&&(c[0][2]-i)==(c[2][2]-k)){
                            cout<<"Yes"<<endl;
                            return 0;
                        }
                    }
                }
            }
        }
    }
    cout<<"No"<<endl;
}



Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
using namespace std;
int main(){
    string S;
    cin >> S;
    
    bool onezero = false;
    int count1 = 0;
    int count2 = 0;
    for(int i = 0;i < S.length();i++){   //101010....の順番の時
        if(onezero == false && S[i] == '1')onezero = true;
        else if(onezero == false && S[i] == '0'){count1++;onezero = true;}
        else if(onezero == true && S[i] == '1'){count1++;onezero = false;}
        else onezero = false;
    }
    
    onezero = true;
    for(int i = 0;i < S.length();i++){   //010101....の順番の時
        if(onezero == false && S[i] == '1')onezero = true;
        else if(onezero == false && S[i] == '0'){count2++;onezero = true;}
        else if(onezero == true && S[i] == '1'){count2++;onezero = false;}
        else onezero = false;
    }
    
    cout << min({count1, count2});
}



Measured memory_bytes: 512
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(true){
            int w = sc.nextInt();
            int h = sc.nextInt();
            if(w == 0&&h == 0) break;
            int[] dx = {1, 0, -1, 0};
            int[] dy = {0, 1, 0, -1};
            int[][] field = new int[2*h - 1][2*w - 1];

            for(int i = 0; i < 2*h-1; i++){
                if(i%2 == 0){
                    for(int j = 0; j < w-1; j++){
                        field[i][2*j + 1] = sc.nextInt();
                    }
                } 
                if(i%2 == 1){
                    for(int j = 0; j < w; j++){
                        field[i][2*j] = sc.nextInt();
                    }
                }
            }
            

            Queue<Integer> quex = new ArrayDeque<>();
            Queue<Integer> quey = new ArrayDeque<>();

            int[][] distance = new int[h][w];
            distance[0][0] = 1;

            quey.add(0);
            quex.add(0);
            while(!quey.isEmpty()){
                int y = quey.poll();
                int x = quex.poll();
                
                for(int dir = 0; dir < 4; dir++) {
                    int nh = y + dy[dir];
                    int nw = x + dx[dir];
                    if (nh < 0 || nh >= h || nw < 0 || nw >= w) continue;
                    if (field[nh+y][nw+x] == 1) continue; 
                    if (distance[nh][nw] != 0) continue;
                    distance[nh][nw] =distance[y][x] + 1;
                    if(nh==h-1 && nw==w-1) System.out.println(distance[h - 1][w - 1]);
                    quey.add(nh);
                    quex.add(nw);
                }
            }
            if(distance[h - 1][w - 1] == 0) System.out.println(0);
        }
        sc.close();
    }
}



Measured memory_bytes: 68320
def readinput():
    n=int(input())
    sList=[]
    for _ in range(n):
        sList.append(input())
    return n,sList

def main(n,sList):
    keihin={}
    for s in sList:
        if s in keihin:
            keihin[s]+=1
        else:
            keihin[s]=1
    return len(keihin)

if __name__=='__main__':
    n,sList=readinput()
    ans=main(n,sList)
    print(ans)


Measured memory_bytes: 38520
if __name__ == '__main__':
    s = input()
    count_i = 0
    count_j = 0
    for i in range(len(s)):
        if 0 == (i %2):
            if  s[i] == 'L':
                count_j = count_j +1
        else:
            if  s[i] == 'R':
                count_i= count_i+1
    if count_i ==0 and count_j==0:
        print('Yes')
    else:
        print('No')

Measured memory_bytes: 3060
import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		
		if(a+b==c||a+c==b||b+c==a){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	}

}


Measured memory_bytes: 10324
#include <iostream>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <algorithm>
#include <iomanip>
#include <string.h>
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
 
typedef long long lint;
 
using namespace std;
 
int main(){
  int A,B;
  char op;
  cin>>A>>op>>B;
  if(op=='+')cout<<A+B<<endl;
  else if(op=='-')cout<<A-B<<endl;
  return 0;
}


Measured memory_bytes: 256
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define bye return 0
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define min(...) min({__VA_ARGS__})
#define max(...) max({__VA_ARGS__})
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vvi = vector<vi>;
using vc = vector<char>;
using vs = vector<string>;
using vpii = vector<pii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
constexpr int dx[4] = {0, 0, -1, 1}, dy[4] = {-1, 1, 0, 0};
template<typename A, typename B> bool cmin(A &a, const B &b) { if (a > b) { a = b; return true; } else return false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { if (a < b) { a = b; return true; } else return false; }
namespace fpl {
  template<typename V, typename F> constexpr V fmap(V v, const F &f) { transform(all(v), v.begin(), f); return v; }
  template<typename V, typename F> constexpr V filterNot(V v, const F &f) { v.erase(remove_if(all(v), f), v.end()); return v; }
  template<typename V, typename F> constexpr V filter(V v, const F &f) { return filterNot(v, [&](typename V::value_type x) { return !f(x); }); }
  template<typename X, typename V, typename F> constexpr X fold(const X &x, const V &v, const F &f) { return accumulate(all(v), x, f); }
  template<typename V> constexpr typename V::value_type sum(const V &v) { return accumulate(all(v), 0); }
  constexpr bool odd(const int &n) { return n & 1; }
  constexpr bool even(const int &n) { return !odd(n); }
  template<typename V, typename F> constexpr bool andall(const V &v, const F &f) { bool b = true; for (auto &p : v) b &= f(p); return b; }
  template<typename V, typename F> constexpr bool orany(const V &v, const F &f) { bool b = false; for (auto &p : v) b |= f(p); return b; }
  constexpr int gcd(int a, int b) { int c = 0; while (a) { c = a; a = b % a; b = c; } return b; }
  constexpr int pows(int a, int b) { int c = 1; while (b) { if (odd(b)) c *= a; b >>= 1; a *= a; } return c; }
}
using namespace fpl;
// clang-format on

main {
  int n, a, b;
  cin >> n >> a >> b;
  if (n == 1) {
    cout << (a == b ? 1 : 0) << endl;
    bye;
  }
  if (a > b) {
    cout << 0 << endl;
    bye;
  }
  cout << (b - a) * (n-2) + 1 << endl;
  bye;
}


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


void solve(long long A, long long B, long long C){
  std::vector<long long> ABC{A,B,C};
  long long c = ABC[0]%2 + ABC[1]%2 + ABC[2]%2;
  long long counter = 0;
  if(c==1){
    for(auto i=0;i<3;++i){
      if(ABC[i]%2==0){
        ABC[i]+=1;
      }
    }
    counter = 1;
  }else if(c == 2){
    for(auto i=0;i<3;++i){
      if(ABC[i]%2==1){
        ABC[i]+=1;
      }
    }
    counter = 1;
  }
  sort(ABC.begin(), ABC.end());
  counter += (ABC[2]-ABC[0])/2 + (ABC[2]-ABC[1])/2;
  cout << counter << "\n";

}

// Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
  long long A;
  scanf("%lld",&A);
  long long B;
  scanf("%lld",&B);
  long long C;
  scanf("%lld",&C);
  solve(A, B, C);
  return 0;
}


Measured memory_bytes: 256
def main():
    S = input()
    gu = 0
    par = 0
    ans = 0
    for s in S:
        if s == 'g':
            if par < gu:
                ans += 1
                par += 1
            else:
                gu += 1
        else:
            if par < gu:
                par += 1
            else:
                ans -= 1
                gu += 1

    print(ans)



if __name__ == "__main__":
    main()

Measured memory_bytes: 70528
import sys

N, X = map(int, input().split())
x = list(map(int, input().split()))

x.append(X)
x.sort()

d = []
for i in range(N):
    d.append(x[i + 1] - x[i]) #階差

d.sort()

def gcd(a, b):
    while b > 0:
        a, b = b, a % b
    return a

D = d[0]
for i in range(len(d) - 1):
    D = gcd(d[i + 1], D)



print(D)


Measured memory_bytes: 14252
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   // 0-indexed昇順

int main() {
    int N, D; cin >> N >> D;
    cout << ceil((double)N / (2 * D + 1)) << endl;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
m = [0] * n
for i in a:
    m[i - 1] += 1
ans = 0
for i in m:
    if i >= 2:
        ans += i * (i - 1) // 2
for i in a:
    if m[i - 1] >= 2:
        print(ans - m[i - 1] * (m[i - 1] - 1) // 2 + (m[i - 1] - 1) * (m[i - 1] - 2) // 2)
    else:
        print(ans)

Measured memory_bytes: 83788
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#define pb push_back
#define fastio ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define ll long long
#define REP(i,a,b) for(int i=a;i<b;i++)
#define RREP(i,a,b) for(int i=a;i>b;i--)
#define mkp(a,b) make_pair(a,b)
#define all(v) v.begin(),v.end()
using namespace std;
bool compare(pair<int,int>& p1,pair<int,int>& p2)
{
    return p1.second<p2.second;
}
int main()
{
    fastio
    ll x;
    cin>>x;
    if(x>=30)
        cout<<"Yes\n";
    else
        cout<<"No\n";
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N; cin>>N;
  
  vector<int> d(N);
  for(int i=0; i<N; i++){
    cin>>d[i];
  }
  
  sort(d.begin(), d.end());
  
  int width=d[N/2]-d[N/2-1];
  
  cout<<width<<endl;
}

Measured memory_bytes: 640
//ABC 133 B Good Distance

#include <iostream>
#include <cmath>

using namespace std;

bool try_square_root_naive(int n) {
    int m = sqrt(n);
    if(abs(m*m - n) < 1e-6)  return true;
    else return false;
}

int main() {
    int n, d;
    cin >> n >> d;
    int x[n][d];
    int sum, cnt=0;
    for(int i=0; i<n; i++) for(int j=0; j<d; j++) cin >> x[i][j];

    for(int i=0; i<n-1; i++) {
        for(int j=i+1; j<n; j++) {
            sum =0;
            for(int k=0; k<d; k++) {
                sum += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]);
            }
            if(try_square_root_naive(sum)) cnt++;
        }
    }

    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 256