akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp11
{
    class Class58
    {
        static void Main()
        {
            var map = new int[3][];
            var frag = new int[2][];
            frag[0] = new int[2];
            frag[1] = new int[2];
            for(int i = 0; i < 3; i++)
            {
                map[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();
            }
            frag[0][0] = map[0][0] - map[0][1];
            frag[1][0] = map[0][0] - map[0][2];
            frag[0][1] = map[0][0] - map[1][0];
            frag[1][1] = map[0][0] - map[2][0];
            for(int i = 1; i < 3; i++)
            {
                if (frag[0][0] != map[i][0] - map[i][1]||frag[1][0] != map[i][0]-map[i][2])
                {
                    Console.WriteLine("No");
                    return;
                }
                if (frag[0][1] != map[0][i] - map[1][i] || frag[1][1] != map[0][i] - map[2][i])
                {
                    Console.WriteLine("No");
                    return;
                }
            }
            Console.WriteLine("Yes");
        }
    }
}


Measured memory_bytes: 13396
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Globalization;
using System.Diagnostics;



class Myon
{
    public Myon() { }
    public static int Main()
    {
        new Myon().calc();
        return 0;
    }

    Scanner cin;
    
    void calc()
    {
        cin = new Scanner();
        int A = cin.nextInt();
        int B = cin.nextInt();
        int C = cin.nextInt();
        int OK = Math.Min(A + B + 1, C);
        OK += B;
        Console.WriteLine(OK);
    }
}


class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

class XRand
{
    uint x, y, z, w;


    public XRand()
    {
        init();
    }

    public XRand(uint s)
    {
        init();
        init_xor128(s);
    }

    void init()
    {
        x = 314159265; y = 358979323; z = 846264338; w = 327950288;

    }

    public void init_xor128(uint s)
    {
        z ^= s;
        z ^= z >> 21; z ^= z << 35; z ^= z >> 4;
        z *= 736338717;
    }

    uint next()
    {
        uint t = x ^ x << 11; x = y; y = z; z = w; return w = w ^ w >> 19 ^ t ^ t >> 8;
    }

    public long nextLong(long m)
    {
        return (long)((((ulong)next() << 32) + next()) % (ulong)m);
    }

    public int nextInt(int m)
    {
        return (int)(next() % m);
    }

    public int nextIntP(int a)
    {
        return (int)Math.Pow(a, nextDouble());
    }

    public int nextInt(int min, int max)
    {
        return min + nextInt(max - min + 1);
    }


    public double nextDouble()
    {
        return (double)next() / uint.MaxValue;
    }

    public double nextDoubleP(double a)
    {
        return Math.Pow(a, nextDouble());
    }
}



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

int main(){
	int n;
	cin >> n;
	vector<int> l(n);
	rep(i,n){
		cin >> l[i];
	}
	bool ok = true;
	
	for (int j = 0; j < n; ++j) {
		int sum = 0;
		for (int i = 0; i < n; ++i) {
			if(i == j) continue;
			sum += l[i];
		}
		if(l[j] >= sum) ok = false;
	}
	
	if(ok){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
    return 0;
}



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

long long t1,t2,a1,a2,b1,b2;


int main(){

	cin>>t1>>t2;
	cin>>a1>>a2;
	cin>>b1>>b2;

	long long dif1 = t1*b1 - t1*a1 , dif2 = t2*b2 - t2*a2;
	if(dif1+dif2==0ll){
		cout<<"infinity"<<endl;
	}
	else if((dif1<0ll && dif2<0ll) || (dif1>0ll && dif2>0ll)){
		cout<<0<<endl;
	}
	else if((dif1<0 && dif1+dif2<0) || (dif1>0 && dif1+dif2>0)){
		cout<<0<<endl;
	}
	else{
		long long dif3=dif1+dif2;
		long long dif4 = abs(dif1)/abs(dif3);
		//cout<<abs(dif1)-dif4*abs(dif3)<<endl;
		dif4*=2ll;
		if(abs(dif1)%abs(dif3)!=0ll)dif4++;
		//cout<<"dif1 : "<<dif1<<endl;
		//cout<<"dif2 : "<<dif2<<endl;
		//cout<<"dif3 : "<<dif3<<endl;

		cout<<dif4<<endl;
	}



	return(0);
}

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

int N;
vector<string> S(100010);
vector<int> P(4, 0);

int main(){
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> S[i];
        if(S[i] == "AC") ++P[0];
        else if(S[i] == "WA") ++P[1];
        else if(S[i] == "TLE") ++P[2];
        else if(S[i] == "RE") ++P[3];
    }
    cout << "AC x " << P[0] << endl;
    cout << "WA x " << P[1] << endl;
    cout << "TLE x " << P[2] << endl;
    cout << "RE x " << P[3] << endl;
    return 0;
}

Measured memory_bytes: 6280
//I read the news today, oh boy
//About a lucky man who made the grade
#include <vector>
#include <iostream>
#include <iomanip>
#include <set>
#include <map>
#include <algorithm>
#include <queue>
#include <math.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz(x) int((x).size())
#define all(v) (v).begin(),(v).end()
#define trace(x) cerr << #x << " = " << x << endl
#define fastio ios_base::sync_with_stdio(0);cin.tie(0)
#define For(i,a,b) for(int i = int(a); i < int(b); ++i)
#define roF(i,a,b) for(int i = int(a); i >= int(b); i--)
using namespace std;

typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;
const int N=1e6;

const ld PI = acos(-1);

int main(){
	fastio;
	cout<<fixed<<setprecision(6);
	ld a, b, x; cin>>a>>b>>x;
	if(x<(a*a*b/2)){
		ld ans = (a*b*b)/(2*x);
		cout << atan(ans)*180/PI << endl;
	}else{
		ld ans = (2*a*a*b-2*x)/(a*a*a);
		cout << atan(ans)*180/PI << endl;
	}
	return 0;
}

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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

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

using ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

template<typename T> vector<T> make_vector(size_t sz){
	return vector<T>(sz);
}

template<typename T,typename... Ts> 
auto make_vector(size_t sz, Ts... ts){
	return vector<decltype(make_vector<T>(ts...))>(sz, make_vector<T>(ts...));
}

template<typename T,typename U,typename... V> 
typename enable_if<is_same<T, U>::value!=0>::type 
fill_value(U &u, const V... v){
	u=U(v...);
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_value(U &u, const V... v){
	for(auto &e:u){
		fill_value<T>(e,v...);
	}
}

const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};

const pid_t pid = getpid();
// Problem Specific Parameter:

int main(void){
	int n, k;
	cin >> n >> k;
	vector<int> d(n);
	rep(i, n) cin >> d[i];

	int ans = 0;

	rep(ai, n + 1)rep(bi, n + 1){
		if(ai + bi > n) continue;

		vector<int> aa, bb;
		rep(i, ai) aa.push_back(d[i]);
		rep(i, bi) bb.push_back(d[n - 1 - i]);
		sort(begin(aa), end(aa));
		sort(begin(bb), end(bb));

		rep(ar, ai + 1) rep(br, bi + 1){
			if(ai + bi + ar + br > k) continue;
			int cur = 0;
			rep(i, ar, ai) cur += aa[i];
			rep(i, br, bi) cur += bb[i];
			chmax(ans, cur);
		}
	}

	cout << ans << endl;

	return 0;
}

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

using namespace std;
using namespace __gnu_pbds;

typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define pb push_back

const int H = 10;
const int W = 1000;
int S[H + 1][W + 1];
int h, w, k;

int sum(int r1, int c1, int r2, int c2) {
    return S[r2 + 1][c2 + 1] - S[r2 + 1][c1] - S[r1][c2 + 1] + S[r1][c1];
}

bool calc(int mask, int lastCut, int currentCut) {
    int lastRow = 0;
    for(int i = 0 ; i < h ; i++) {
        if(mask&(1 << i) || i == h - 1) {
            int cnt = sum(lastRow, lastCut, i, currentCut);
            if(cnt > k) return false;
            lastRow = i + 1;
        }
    }
    return true;
}

int go(int lastCut, int mask) {
    if(calc(mask, lastCut, w - 1)) return 0;
    if(!calc(mask, lastCut, lastCut)) return (int) 1e9;
    int nextCut = lastCut;
    for(int bit = (1 << 15) ; bit > 0 ; bit >>= 1) {
        if(nextCut + bit >= w) continue;
        if(!calc(mask, lastCut, nextCut + bit)) continue;
        nextCut += bit;
    }
    return 1 + go(nextCut + 1, mask);
}

void create2DSs() {
    for(int i = 0 ; i <= h ; i++)
        for(int j = 1 ; j <= w ; j++)
            S[i][j] += S[i][j - 1];
    for(int j = 0 ; j <= w ; j++)
        for(int i = 1 ; i <= h ; i++)
            S[i][j] += S[i - 1][j];
}

void solve() {
    cin >> h >> w >> k;
    string row;
    for(int i = 0 ; i < h ; i++) {
        cin >> row;
        for(int j = 0 ; j < w ; j++)
            S[i + 1][j + 1] = row[j] == '1';
    }
    create2DSs();
    // try all horizontal cuts
    int res = (int) 1e9;
    for(int i = 0 ; i < (1 << (h - 1)) ; i++) {
        int cost = go(0, i) + __builtin_popcount(i);
        res = min(res, cost);
    }
    cout << res << "\n";
}

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

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

using namespace std;

//#define FILE_IO

int N;
int v[105];
int f[105];

int main()
{
    #ifdef FILE_IO
    freopen("1.in", "r", stdin);
    freopen("1.out", "w", stdout);
    #endif

    scanf("%d", &N);
    int mn, mx;
    mn = 1 << 30;
    mx = 0;
    for(int i = 1; i <= N; i++)
    {
        scanf("%d", &v[i]);
        f[ v[i] ]++;
        mn = min(mn, v[i]);
        mx = max(mx, v[i]);
    }

    for(int i = mn + 1; i <= mx; i++)
        if(f[i] < 2)
        {
            printf("Impossible\n");
            return 0;
        }

    if(f[mn] > 2)
    {
        printf("Impossible\n");
        return 0;
    }

    if(f[mn] == 1 && mx != 2 * mn)
    {
        printf("Impossible\n");
        return 0;
    }

    if(f[mn] == 2 && mx != 2 * mn - 1)
    {
        printf("Impossible\n");
        return 0;
    }

    printf("Possible\n");
    return 0;
}


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

const int N = 100;

int main(){
  int n[N],x[N],ans,num=0;


  for(int i=0;i<N;++i){
    cin >> n[i] >> x[i];

    if(n[i] == 0 && x[i] == 0){
      num = i;
      break;
    }

    ++n[i];
  }

  ans = 0;
  for(int a = 0; a<num ; ++a){
    for(int i=1;i<n[a]-2;++i){
      for(int k=i+1;k<n[a]-1;++k){
	for(int l = k+1;l<n[a];++l){
	  if(i + k + l == x[a]){
	    ++ans;
	  }
	}
      }
    }
    cout << ans << endl;
    ans = 0;
  }


  return 0;
}



Measured memory_bytes: 3084
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <functional>
using namespace std;

int a, b, c, d;

int main() {
	cin >> a >> b >> c >> d;
	if (abs(a - c) <= d || (abs(a - b) <= d && abs(b - c) <= d)) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//Define many functions and words!!
//The functions I have defined start with a capital letter.

//C++ words.
#define MOD 1'000'000'007 //998'244'353
#define PI 3.14159265358979323846
typedef long long ll;
typedef vector<ll> vl;
typedef vector<double> vd;
typedef vector<vl> matrix;//A(n, vl(m));
typedef vector<string> vs;
typedef pair<ll,ll> pl;
typedef vector<pl> vp;
typedef pair<double,double> pd;
typedef vector<pd> vpd;
typedef vector<bool> vb;
typedef map<ll,ll> mapl;
#define nl "\n"s
#define rep(i,n) for(ll i=0LL; i<(n); i++)
#define INF ((1LL<<62)-(1LL<<31))
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define All(V) V.begin(),V.end()
#define Sortup(V) sort(All(V))
#define Sortdown(V) sort(V.rbegin(), V.rend())
#define Atleast(key, V) lower_bound(All(V), key)
#define Largerthan(key, V) upper_bound(All(V), key)

#define endYes do{cout << "Yes" << nl; return 0;}while(0)
#define endYES do{cout << "YES" << nl; return 0;}while(0)
#define endNo  do{cout << "No" << nl; return 0;}while(0)
#define endNO  do{cout << "NO" << nl; return 0;}while(0)


//Mathmatical functions.
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;}
ll Lpow(ll e,ll x){ll res=1LL;while(x){if(x&1)res*=e;e*=e;x/=2;}return res;}
ll LpowMOD(ll e,ll x){ll res=1LL;while(x){if(x&1)res*=e;e*=e;x/=2;res%=MOD;e%=MOD;}return res;}
void CumuSum(vl &A){rep(i,A.size())if(i)A[i]+=A[i-1];}
bool Bit(ll subset, ll Rsift){ return ((subset)>>(Rsift))&1; }
ll Gcd(ll a,ll b){ return b?Gcd(b,a%b):abs(a); }
ll Lcm(ll A,ll B){ return A/Gcd(A,B)*B; }
template<class T>double Dist(T x,T y,T X,T Y){return sqrt(pow(x-X,2.0)+pow(y-Y,2.0));}

//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// solution comes here


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

    ll N, M;
    cin >> N >> M;
    vl x(M), y(M);
    rep(i, M) cin >> x[i] >> y[i];
    rep(i, M) x[i]--, y[i]--;

    vl cnt(N, 1);
    vb red(N, false);
    red[0] = true;

    rep(i, M) {
        cnt[x[i]]--;
        cnt[y[i]]++;

        if(red[x[i]]) red[y[i]] = true;
        if(cnt[x[i]] == 0) red[x[i]] = false;
    }

    ll ans=0;
    rep(i, N) ans += red[i];
    cout << ans << nl;
}

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

int main(int argc, const char * argv[]) {
    
    int a,b,c,d;
    
    cin >> a >> b >> c >> d;
    
    if((a+b)>(c+d)) cout << "Left" << endl;
    else if((a+b)==(c+d)) cout << "Balanced" << endl;
    else if((a+b)<(c+d)) cout << "Right" << endl;
    
    return 0;
}


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

#define pi 3.14159265358979323846

int main(){
    long double a, b, x;

    cin >> a >> b >> x;
    if(x > a * a * b / 2){
        x = a*a*b-x;
        printf("%Lf\n", atanl(2*x/(a*a*a))*180/pi);
    }else{
        printf("%Lf\n", atanl(a*b*b/(2*x))*180/pi);
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
    
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
    
#define int long long
#define double long double
    
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (int)x.size()
    
#define ff first
#define ss second
#define mp make_pair
         
#define pb push_back
#define endl "\n" 
         
#define f(i,l,r) for(int i=l;i<=r;i++)
#define rf(i,r,l) for(int i=r;i>=l;i--)    

#define bp __builtin_popcountll
#define inf 1e15
    
const int N=1e5+5;
const int M=1e9+7;
void solve()
{
	int x[N]={0};
	x[0]=1;
	int n;
	cin>>n;
	f(i,100,105)
	{
		f(j,0,N-1)
		{
			if(j-i>=0 && x[j-i]>=1)
			x[j]=1;
		}
	}
	if(x[n]==1) cout<<1;
	else cout<<0;
}
signed main()  
{
	FAST
    int t=1;
    // cin>>t;
    for(int tc=1;tc<=t;tc++)
    {
    	// cout<<"Case #"<<tc<<": ";
    	solve();
    }
}


Measured memory_bytes: 1024
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#define Rep(i, n) for(int i=0;i<n;++i)
#define rep(i, n) for(int i=1;i<=n;++i)
#define ll long long int
#define INF 1e9
#define LINF 1e18
#define MOD 1000000007
#define PI 3.14159265359
#define EPS 1e-10
#define All(a) (a).begin(), (a).end()

using namespace std;
using P = pair<ll, ll>;
 
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

/**
 * Usage:
 * 
 * G[from].push_back(Edge(to, weight));
 * using Graph = vector<vector<Edge>>;
 * 
 */ 
struct Edge {
  int to;     
  ll weight; 
  Edge(int t, ll w) : to(t), weight(w) { }
};

/**
 * Usage:
 * 
 * chmin(old, new);
 * chmax(old, new);
 * 
 */ 
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<typename T>
void printv(vector<T>& v) {
  if (v.size() == 0) {
    cout << "\n";
    return;
  }

  Rep(i, v.size()) {
    cout << v[i] << ((i + 1 < v.size()) ? ' ' : '\n');
  }
}



int H, N;
int a[1100], b[1100];
int dp[1010][20010];

int main () {
  cin >> H >> N;
  rep(i, N) {
    cin >> a[i] >> b[i];
  }

  Rep(i, 1010) {
    Rep(j, 20010) {
      dp[i][j] = INF;
    }
  }

  dp[0][0] = 0;

  rep(i, N) {
    Rep(j, 20000) {
      if (j < a[i]) {
        chmin(dp[i][j], dp[i-1][j]);
      } else {
        chmin(dp[i][j], min(dp[i-1][j], dp[i][j-a[i]] + b[i]));
      }

    }
  }

  int ans = INF;
  for (int j=H;j<=20000;++j) {
    chmin(ans, dp[N][j]);
  }
  cout << ans << "\n";
}


Measured memory_bytes: 79232
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define ll long long
#define ull unsigned long long
#define dd double
#define oo 1001007000
#define ff float
#define ooo 4223352036854775007
#define iii pair<ll,ll>
#define vii vector<ll>
#define viii vector<iii>
#define sss pair<str,str>
#define str string
#define sii set<ll>
#define siii set<iii>
#define r0 return 0
#define pb push_back
#define sz size
using namespace std;

const char E='\n';
const int N=21105;
const int NN=20005;
const ll md=998244353;


int main(){
    cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
    int n,m;
    cin >> n >> m;
    if (m>=n){
        cout << "unsafe" << E;
    }else {
        cout << "safe" << E;
    }
    r0;
}
/*


1
5
2 3 4 5 1


1
4
4 2 3 1








*/


Measured memory_bytes: 3580
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
  int a,b,c;
  cin >> a >> b >> c;
  if(a<b&&b<c) {
      cout << "Yes" << endl;
  }
  else {
      cout << "No" << endl;
  }
}


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

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  int N;
  cin >> N;
  VI xs(N);
  REP(i,N) cin >> xs[i];
  SORT(xs);
  if(xs.back() - xs[0] > 1){
	cout << "No" << endl;
	return 0;
  }
  int n1 = 0;
  REP(i,N) if(xs[i] == xs[0]) ++n1;
  int n2 = N - n1;
  if(n2 == 1){
	cout << "No" << endl;
	return 0;
  }
  if(n2 == 0){
	cout << (xs.back()==N-1||xs.back()<=n1/2? "Yes": "No") << endl;
	return 0;
  }
  
  int lb = n1 + (n2?1:0);
  int ub = n1 + n2/2;
  //cout<<n1<<","<<n2<<" " << lb<<","<<ub<<endl;
  cout << ((lb<=xs.back()&&xs.back()<=ub)? "Yes": "No") << endl;

  return 0;
}


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

signed main() {
    int N;
    cin >> N;
    vector<int> d(N);
    for (int& x : d) cin >> x;
    sort(d.begin(), d.end());

    cout << d[N / 2] - d[N / 2 - 1] << endl;
}


Measured memory_bytes: 1024
#include <stdio.h>
#include <inttypes.h>

int main(void)
{
    uint_fast32_t k, s, t = 0, i = 0, j = 0;
    scanf("%" SCNuFAST32 " %" SCNuFAST32, &k, &s);
    for (;;) {
        if (i > s || i > k) {
            break;
        } else if (j - i > k || j > s) {
            j = ++i;
        } else if (s - j > k) {
            ++j;
        } else {
            ++t, ++j;
        }
    }
    printf("%" PRIuFAST32 "\n", t);
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <array>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#define _USE_MATH_DEFINES
#include <cmath>
#include <climits>
#include <cstdio>
#include <iomanip>
#include <utility>
#include <unordered_map>

using namespace std;
typedef long long int ll;

#define SP(x) setprecision((int)x)
#define SW(x) setw(x)    // 桁数指定
#define SF(c) setfill(c) // 埋め文字指定('0')
#define ALL(v) v.begin(), v.end()

ll gcd(ll x, ll y)
{
    while (y > 0)
    {
        ll tmp = y;
        y = x % y;
        x = tmp;
    }
    return x;
}

ll lcm(ll x, ll y)
{
    return x / gcd(x, y) * y;
}

// 素因数分解O(sqrt(n))
map<ll, ll> prime_factor(ll n) {
    map<ll, ll> res;
    for (ll i = 2; i * i <= n; i++)
    {
        while (n % i == 0)
        {
            ++res[i];
            n /= i;
        }
    }
    if (n != 1) res[n] = 1;
    return res;
}

int main(int argc, char const *argv[])
{
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    ll ans = LLONG_MIN;

    ans = max(ans, a * c);
    ans = max(ans, a * d);
    ans = max(ans, b * c);
    ans = max(ans, b * d);

    cout << ans << endl;
}

Measured memory_bytes: 3624
// template version 1.15
using namespace std;
#include <bits/stdc++.h>

// varibable settings
#define int long long
const int INF=1e18;

// define basic macro {{{
#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) rrepi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)((b)-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(i,a) for (auto&& i : a)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define mt(a, b, c) make_tuple(a, b, c)
#define divceil(a,b) ((a)+(b)-1)/(b)
#define is_in(x, a, b) ((a)<=(x) && (x)<(b))
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define ub upper_bound
#define lb lower_bound
#define posl(A, x) (lower_bound(all(A), x)-A.begin())
#define posu(A, x) (upper_bound(all(A),x)-A.begin())
template<class T> inline void chmax(T &a, const T &b) { if((a) < (b)) (a) = (b); }
template<class T> inline void chmin(T &a, const T &b) { if((a) > (b)) (a) = (b); }

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;

template<typename T> using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

#if defined(PCM) || defined(LOCAL)
  #include "lib/dump.hpp"
#else
  #define dump(...) 42
  #define dump_1d(...) 42
  #define dump_2d(...) 42
  #define cerrendl 42
#endif
//}}}

signed main() {
  int h,n;cin>>h>>n;
  vector<int> a(n);
  int s = 0;
  rep(i, n) {
    cin>>a[i];
    s += a[i];
  }
  dump(a);
  cout << (s>=h ? "Yes" : "No") << endl;
  return 0;
}


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

int amida[30][11];

int tadoru(int n,int m,int s,int d){
	int i;
	
	for(i = 0;i < d;i++){
		if(amida[i][m-1]){
			m -= 1;
		}else if(amida[i][m]){
			m += 1;
		}
	}

	return m == s;
}

int main(void) {
	int n,m,s,d,i,j,tmp;
	
	while(1){
		scanf("%d",&n);
		if(!n) break;
		scanf("%d %d %d",&m,&s,&d);
		memset(amida,0,sizeof(amida));
		
		for(i = 0;i < d;i++){
			scanf("%d",&tmp);
			for(j = n-1;j >= 1;j--){
				amida[i][j] = tmp%10;
				tmp /= 10;
			}
		}

		if(tadoru(n,m,s,d)){
			printf("0\n");
			goto good;
		}
		for(i = 0;i < d;i++){
			for(j = 0;j < n;j++){
				if(!amida[i][j-1] && !amida[i][j] && !amida[i][j+1]){
					amida[i][j] = 1;
					if(tadoru(n,m,s,d)){
						printf("%d %d\n",i+1,j);
						goto good;
					}
					amida[i][j] = 0;
				}
			}
		}
		printf("1\n");
		good:;
	}
	
	return 0;
}

Measured memory_bytes: 612
def che(s):
    lens = len(s)
    if s[:lens//2] == s[lens//2:]:
        TF = True
    else:
        TF = False
    return TF

S = input()
TF = False
ind = 0

if len(S)%2 == 1:
    S2 = S[:-2]
else:
    S2 = S[:-2]
while True:
    TF = che(S2)
    if TF == False:
        S2 = S2[:-2]
    else:
        ans = len(S2)
        print(ans)
        exit()


Measured memory_bytes: 3060
n = int(input())
a = list(map(int, input().split()))

rate = [i*400-1 for i in range(1,9)]
over = 0
d = {}

for i in range(n):
    if a[i] > rate[-1]:
        over += 1
    else:
        for j in range(len(rate)):
            if a[i] <= rate[j]:
                if rate[j] not in d:
                    d[rate[j]] = 1
                else:
                    d[rate[j]] = d[rate[j]] + 1
                break


print(max(len(d), 1), len(d)+over)




Measured memory_bytes: 9024
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using P = pair<int, int>;
using PL = pair<lint, lint>;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
constexpr int MOD = 1000000007;
constexpr int INF = 2147483647;
void yes(bool expr) {
  cout << (expr ? "Yes" : "No") << "\n";
}
struct Camel {
    int K;
    lint L;
    lint R;
};
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int T;
    cin >> T;
    REP(t, T) {
        int N;
        cin >> N;
        vector<Camel> camels;
        REP(i, N) {
            camels.emplace_back();
            cin >> camels[i].K >> camels[i].L >> camels[i].R;
            camels[i].K--;
        }
        sort(ALL(camels), [](auto const &a, auto const &b) { return abs(a.L-a.R) > abs(b.L-b.R); });
        lint ans = 0;
        set<int> lidx;
        set<int> ridx;
        REP(i, N) {
            lidx.insert(i);
            ridx.insert(i);
        }
        REP(i, N) {
            if(camels[i].L >= camels[i].R) {
                auto itr = lidx.upper_bound(camels[i].K);
                if(itr != lidx.begin()) {
                    ans += camels[i].L;
                    lidx.erase(*prev(itr));
                } else {
                    ans += camels[i].R;
                    itr = ridx.lower_bound(camels[i].K+1);
                    ridx.erase(itr);
                }
            } else {
                auto itr = ridx.lower_bound(camels[i].K+1);
                if(itr != ridx.end()) {
                    ans += camels[i].R;
                    ridx.erase(itr);
                } else {
                    ans += camels[i].L;
                    itr = lidx.upper_bound(camels[i].K);
                    lidx.erase(*prev(itr));
                }
            }
        }
        cout << ans << "\n";
    }
}

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

e_list = [[] for i in range(N)]

for i in range(M):
    s,t = list(map(int,input().split()))
    s,t = s-1,t-1
    e_list[s].append(t)

DP = [0 for i in range(N)]
dp0_min = 10**27

for x in range(N-1):
    for i in range(N-1):
        if i==x:
            if len(e_list[N-i-2])==1:
                DP[N-i-2] = DP[e_list[N-i-2][0]]+1
            else:
                max_room = -1
                max_path = 0
                for j in e_list[N-i-2]:
                    if max_path<DP[j]:
                        max_room = j
                        max_path = DP[j]
                    DP[N-i-2] += DP[j]
                DP[N-i-2] -= DP[max_room]
                DP[N-i-2] /= len(e_list[N-i-2])-1
                DP[N-i-2] += 1
        else:
            for j in e_list[N-i-2]:
                DP[N-i-2] += DP[j]
            DP[N-i-2] /= len(e_list[N-i-2])
            DP[N-i-2] += 1
    dp0_min = min(dp0_min,DP[0])
    DP = [0 for i in range(N)]
print(dp0_min)



Measured memory_bytes: 67800
import sys
from io import StringIO
import unittest

def resolve():
    k = int(input())
    a, b = map(int, input().split())

    aa = 0
    while aa <= b:
        aa += k

        if a <= aa <= b:
            print("OK")
            return

    print("NG")
    return

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """7
500 600"""
        output = """OK"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """4
5 7"""
        output = """NG"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """1
11 11"""
        output = """OK"""
        self.assertIO(input, output)

if __name__ == "__main__":
    # unittest.main()
    resolve()

Measured memory_bytes: 70964
// Author : Parth Prajapati
// Institute : Pandit Deendayal Petroleum University
#include<bits/stdc++.h>

using namespace std;

#define l long // -2^31 to +2^31-1 (upper limit ~ 2*(10^9))
#define ul unsigned long // 0 to +2^32-1
#define ll long long // -2^63 to +2^63-1 (upper limit ~ 9*(10^18))
#define ull unsigned long long // 0 to +2^64-1
#define mod(x, m) ((((x)%(m))+(m))%(m))
#define vi vector<int>
#define pi pair<int,int>
#define vl vector<ll int>
#define pl pair<ll int,ll int>
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

const ll MOD = 1e9 + 7;
const double pie = 3.141592653589793;

#define setcount(x) __builtin_popcount(x) // counts set bits
#define parity(x) __builtin_parity(x) // checks parity of the number
#define lzcount(x) __builtin_clz(x) // count leading zeros in binary representation of number
#define tzcount(x) __builtin_ctz(x) // count trailing zeros in binary representation of number

template<typename T> T inf() { return (T)__builtin_inf();} // syntax for use inf<datatype>();
template<typename T> T gcd(T a,T b){ if(b>a) return gcd(b,a);return b==0?a:gcd(b,a%b); }
template<typename T> T lcm(T a, T b) { return (a*b)/gcd(a,b); }
template<typename T> T fast_power(T x,T y,ll m=MOD){T ans=1;while(y>0){if(y&1LL) ans=(ans*x)%m;y>>=1LL;x=(x*x)%m;}return ans%m;}

string IntToString(ll a){ ostringstream temp; temp << a; return temp.str();}
ll findMMI_fermat(ll n,ll M) {ll ans= fast_power(n,M-2,M);return ans;}//i.e In (a/b)%M..it calculates MMI of b wrt M,only if M is prime
ll add(ll a,ll b,ll M) { return ( mod(a,M ) + mod(b,M ))%M; }
ll sub(ll a, ll b,ll M) { return (mod(a,M ) + M - mod(b,M ))%M; }
ll mult(ll a,ll b,ll M) { return  ( mod(a,M)*mod(b,M) ) %M ; }
bool isprime(ll a){ if(a==2) {return 1;}if(!(a&1) ) {return 0;}for(ll i=3;i*i<=a;i+=2){if(a%i==0) {return 0;} } return 1;} 

/************************** main program **************************/

int main()
{
	FASTIO
	//code
	int i,j,k=0,a[85];
    for(i=1;i<=9;i++)
    {
    	for(j=1;j<=9;j++)
    	{
    		a[k++]=i*j;
    	}
    }
    int n,f=0;
    cin>>n;
    for(i=0;i<81;i++)
    {
    	if(n==a[i])
    	{
    		f=1;
    		break;
    	}
    }
    if(f)
    	cout<<"Yes";
    else
    	cout<<"No";
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int a, b;
    cin >> a >> b;
    
    int add, dif, mul;
    add = a + b;
    dif = a - b;
    mul = a * b;
    
    int max = add;
    if(dif > max){
        max = dif;
    }
    if(mul > max){
        max = mul;
    }
	cout << max << endl;
    return 0;
}


Measured memory_bytes: 256
l=[2,3,4,5,6,7,8,9,10,11,12,13,1]
a,b=map(int,input().split())
if l.index(a)>l.index(b):
	print('Alice')
elif l.index(a)<l.index(b):
	print('Bob')
else:
	print('Draw')

Measured memory_bytes: 3060
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cstdint>
#include <cassert>
#include <random>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T iabs(const T& x) { return max(x, -x); }
// #define abs gabs

int main() {
    int n;
    cin >> n;
    string s[3];
    for (int i = 0; i < 3; ++i) cin >> s[i];
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        set<char> st;
        for (int j = 0; j < 3; ++j) {
            st.insert(s[j][i]);
        }
        ans += st.size() - 1;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
//デバッグ用オプション：-fsanitize=undefined,address

//コンパイラ最適化
#pragma GCC optimize("Ofast")

//インクルードなど
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

//マクロ
//forループ
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
//FORAは範囲for文(使いにくかったら消す)
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
#define FORA(i,I) for(const auto& i:I)
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end() 
#define SIZE(x) ll(x.size()) 
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

ll fac[MAXR+1],finv[MAXR+1],inv[MAXR+1];

//テーブルの作成
void COMinit() {
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    FOR(i,2,MAXR){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}

// 二項係数の計算
ll COM(ll n,ll k){
    if(n<k)return 0;
    if(n<0 || k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}

signed main(){
    //入力の高速化用のコード
    //ios::sync_with_stdio(false);
    //cin.tie(nullptr);
    COMinit();
    ll s;cin>>s;
    ll ans=0;
    FOR(x,1,ll(s/3)){
        ll k=s-3*x;
        ans+=COM(k+x-1,k);
        ans%=MOD;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 6012
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;



public class Main{
	public static void main(String[] args){


		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		String s;
		int sum;
		try{
		while(true){
			sum=0;
			String[] s_array;//???????????§?????????1???????????????????????????????????????????????????????????????
			s=reader.readLine();
			s_array=s.split("");
			int[] s_num=new int[s_array.length];
			Arrays.fill(s_num, 0);
			for(int i=0;i<s_array.length;i++){
				s_num[i]=Integer.parseInt(s_array[i]);
				sum+=s_num[i];
			}
			if(sum==0)break;
			System.out.println(sum);
		}




		}catch(IOException e){
			System.out.println(e);
		}

	}
}

Measured memory_bytes: 25592
n = int(input())
d = [int(i) for i in input().split()]
d.sort()
s=0
N=int(n/2)
k=int(abs(d[N]-d[N-1]))
K=(d[N]+d[N-1])/2
for i in range(n):
    if d[i]>=K:
        s=s+1
    else:
        s=s
if s==N:
    print(k)
else:
    print(0)

Measured memory_bytes: 14428
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main() { 
    int N;
    cin >> N;
    vector<int> V;
    int tmp = N;
    while(tmp--) {
        int v;
        cin >> v;
        V.push_back(v);
    }
    
    sort(V.begin(), V.end());

    double val = (double)(V[0] + V[1]) / 2.0;
    for (int i=2; i<N; i++) {
        val = (val + V[i]) / 2.0;
    }

    cout << val << endl;
    
    return 0;
}

Measured memory_bytes: 888
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <tuple>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <numeric>
#include <string.h>
#define rep(i, x) for (int i = 0; i < (int)(x); i++)
#define repn(i, x) for (int i = 1; i <= (int)(x); i++)
#define repr(i, x) for (int i = ((int)(x) - 1); i >= 0; i--)
#define reprn(i, x) for (int i = ((int)(x)); i > 0; i--)
#define all(x) (x).begin, (x).end()
using namespace std;
typedef long long int64;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const long long  INFL = 1e18;
const int MOD = 1000000007;
const int MAX = 210000;
const int MAX_NUM = 999999999;
//逆元を求める関数
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++) {
      fac[i] = fac[i-1] * i % MOD;
      inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
      finv[i] = finv[i-1] * inv[i] % MOD;
    }
}
//組み合わせ
long long COM (int n, int k) {
    if(n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD;
}
void solve() {
    int64 n; cin >> n;
    vector<int64> a(n);
    vector<int64> abs_a(n);
    int minus_cnt = 0;
    rep (i, n) {
        cin >> a[i];
        abs_a[i] = abs(a[i]);
        if (a[i] < 0) minus_cnt++;
    }
    sort(abs_a.begin(), abs_a.end());
    if (minus_cnt % 2 == 1) abs_a[0] = -1 * abs_a[0];
    int64 ans = 0;
    rep (i, n) {
        ans += abs_a[i];
    }
    cout << ans << endl;
    return;
}
int main() {
    solve();
    return 0;
}

Measured memory_bytes: 1792
#include<algorithm>
#include<stdio.h>
using namespace std;
#define ran 555555
int n,m,d[ran];
long long int pos[ran];
long long int z[ran];
int main(){
	scanf("%d%d",&n,&m);
	pos[0] = m;
	for(int i=1; i<=n; i++){
		scanf("%d",&d[i]);
		pos[i] = min(pos[i-1], abs(pos[i-1]-d[i]));
	}
	z[n+1] = 0;
	for(int i=n; i>=1; i--){
		if(d[i] <= z[i+1]*2 + 1)
			z[i] = z[i+1] + d[i];
		else
			z[i] = z[i+1];
	}
	int q,x;
	for(scanf("%d",&q); q--;){
		scanf("%d",&x);
		puts(pos[x-1] > z[x+1] ? "YES" : "NO");
	}
	return 0;
}


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

int main() {
  int a, b, c, d; cin >> a >> b >> c >> d;
  
  int flag = abs(a-b)<=d && abs(b-c)<=d || abs(a-c)<=d;
  cout << (flag ? "Yes" : "No") << endl;
}


Measured memory_bytes: 256
n=int(input())
evi=[]
for i in range(n):
    a=int(input())
    l=[list(map(int,input().split())) for i in range(a)]
    evi+=[l]#証言をすべて集める
ans=0
for i in range(2**n):
    mujyun=[]
    h_list=[]
    count=0
    for j in range(n):
        if ((i>>j)&1):#各桁が１かどうか
            count+=1
            mujyun+=[[j+1,0]]#仮定が間違っているとする    
            h_list+=evi[j]#正直者の発言
        else:
            mujyun+=[[j+1,1]]
        
    for k in mujyun:
        if k in h_list:#矛盾が生じる
            count=0
            break
        
    ans=max(ans,count)
print(ans)

Measured memory_bytes: 3064
// Date: 2020-01-23

#include <bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> pii;
#define FIO ios::sync_with_stdio(false);cin.tie(0)
#define rep(i, a, b) for(int i = int(a); i <= int(b); ++i)
#define per(i, b, a) for(int i = int(b); i >= int(a); --i)
#define IN freopen("in.txt", "r", stdin)
#define OUT freopen("out.txt", "w", stdout)
#define mem(x, y) memset(x, y, sizeof(x))
#define all(x) (x).begin(),(x).end()
#define SZ(x) x.size()
#define mk make_pair
#define pb push_back
#define fi first
#define se second
const LL INF = 1e18;
const LL mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const int N = 1e5 + 10;
LL qpow(LL x, LL y, LL MOD) {LL a=1; while(y){ if(y&1) a=a*x%MOD; x=x*x%MOD; y>>=1; } return a;}

string s[51];
int t[51];
int main() {
	FIO;
	int n;
	cin >> n;
	rep(i, 1, n) {
		cin >> s[i] >> t[i];
	}
	string x; cin >> x;
	int ans = 0;
	rep(i, 1, n) {
		if(s[i] == x) {
			rep(j, i+1, n) ans += t[j];
			break;
		}
	}
	cout << ans;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>

using namespace std;

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

    if(n<k){
        printf("1");
    }
    else if(n%k == 0){
        printf("0");
    }
    else {
        printf("1");
    }
    return 0;
}


Measured memory_bytes: 256
n,m = map(int, input().split())
a = [True]*(n+1)
for i in range(m):
    t = int(input())
    a[t] = False

x = [0]*(n+1)
x[0] = 1
if a[1]:
    x[1] = 1


for i in range(2, n+1):
    if a[i]:
        x[i] = x[i-1]+ x[i-2]
print(x[n]%1000000007)

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

int main() {
 int A,B,C,D;
  cin>>A>>B>>C>>D;
    int sum=A+B;
    int resum=C+D;
  if(sum==resum){
    cout<<"Balanced"<<endl;
  }
  if(sum>resum){
    cout<<"Left"<<endl;
  }
  if(sum<resum){
    cout<<"Right"<<endl;
  }
}


Measured memory_bytes: 256
N = input()
N = str(N)
n = len(N)
if N[n-1]=="3":
    print("bon")
elif N[n-1]=="0" or N[n-1]=="1" or N[n-1]=="6" or N[n-1]=="8":
    print("pon")
else:
    print("hon")

Measured memory_bytes: 61636
#include<bits/stdc++.h>
#define reg register
#define ll long long
#define maxn 200001
using namespace std;
inline ll  read() {
    reg ll s = 0, t = 0; reg char ch = getchar();
    while(ch > '9' || ch < '0') t |= ch == '-', ch = getchar();
    while(ch >= '0' && ch <= '9') s = (s << 1) + (s << 3) + (ch ^ 48), ch = getchar();
    return t ? -s : s;
}
ll n, x[maxn], m, k, d[maxn], cha[maxn], sum[maxn], belong[maxn];
ll nxt[maxn], w[maxn], a[maxn], vis[maxn], f[maxn], cnt;
vector<ll> Q[maxn];
int main()
{
    n = read();
    for(int i = 1; i <= n; i++) x[i] = read(),cha[i] = x[i] - x[i - 1];
    m = read(); k = read(); 
    for(int i = 1; i <= m; i++) a[i] = read();
    for(int j = 1; j <= n; j++) d[j] = j;
    for(int i = 1; i <= m; i++)
        swap(d[a[i]], d[a[i] + 1]);
    for(int i = 1; i <= n; i++) nxt[d[i]] = i;
    for(int i = 1; i <= n; i++){
        if(vis[i] == 0){
           int p = i;  cnt++;
            while(!vis[p]) {
                Q[cnt].push_back(p); vis[p] = 1;
                sum[cnt]++; belong[p] = cnt; f[p] = sum[cnt] - 1;
                p = nxt[p];
            }
        }
    }
    for(int i = 1; i <= n; i++){
        int p = k % sum[belong[i]];
        nxt[i] = Q[belong[i]][(f[i] + p) % sum[belong[i]]]; 
        w[nxt[i]] = i;
    }
    for(int i = 1; i <= n; i++) a[i] = cha[w[i]];
    for(int i = 1; i <= n; i++)
        a[i] += a[i - 1], printf("%lld\n", a[i]);
}


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

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int[][] num = new int[n][2];
		int[][] dp = new int[n][n];
		for (int i = 0; i < n; i++) {
			Arrays.fill(dp[i], Integer.MAX_VALUE);
			dp[i][i] = 0;
			num[i][0] = scanner.nextInt();
			num[i][1] = scanner.nextInt();
		}
		for (int w = 1; w < n; w++) {
			for (int i = w; i < n; i++) {
				for (int j = i - w; j < i; j++) {
					int c = num[i - w][0] * num[j][1] * num[j + 1][0]
							* num[i][1];
					dp[i - w][i] = Math.min(dp[i - w][i], dp[i - w][j]
							+ dp[j + 1][i] + c);
				}
			}
		}
		System.out.println(dp[0][n-1]);
	}
}

Measured memory_bytes: 21504
N = int(input())
A = [int(x) for x in input().split()]
#リスト内包表記[式 for 任意の変数名 in イテラブルオブジェクト]
myset=set() 
#ここでは空の集合を作っている
for a in A:
  if a in myset:
    print('NO')
    exit()
  else:
    myset.add(a)
print('YES')

Measured memory_bytes: 26064
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
int main(){
  int n;cin>>n;
  vector<int> a(n+1);
  ll sum=0;
  a[0]=0;
  rep(i,n+1){
    if(i==0)continue;
    cin>>a[i];
    sum+=abs(a[i-1]-a[i]);
  }
  sum+=abs(a[0]-a[n]);
  // cout<<sum<<endl;
  rep(i,n){
    if(i==0)continue;
    int mi=abs(a[i-1]-a[i])+abs(a[i+1]-a[i]);
    int pl=abs(a[i-1]-a[i+1]);
    cout<<sum-mi+pl<<endl;
  }
  cout<<sum-abs(a[n-1]-a[n])-abs(a[0]-a[n])+abs(a[0]-a[n-1])<<endl;
}

Measured memory_bytes: 1664