akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
import java.util.stream.Collectors;

public class Main {

    public static void main(String args[]) throws IOException {

        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            final List<String> inputLines =
                    br.lines().limit(4).collect(Collectors.toList());


            final int length = Integer.valueOf(inputLines.get(0));
            final String wordA = inputLines.get(1);
            final String wordB = inputLines.get(2);
            final String wordC = inputLines.get(3);

            int count = 0;
            for (int i = 0; i < length; i++) {

                char a = wordA.charAt(i);
                char b = wordB.charAt(i);
                char c = wordC.charAt(i);

                if (a == b && b == c){
                    continue;
                } else if (a == b || b == c || a == c) {
                    count++;
                } else {
                    count += 2;
                }
            }

            output(String.valueOf(count));
        }

    }

    private static void output(String message){
        System.out.println(message);
    }
}


Measured memory_bytes: 26580
def main():
    a,b,m=map(int,input().split())
    la=list(map(int,input().split()))
    lb=list(map(int,input().split()))
    ans=min(la)+min(lb)
    res=200000
    for i in range(m):
        x,y,c=map(int,input().split())
        res=min(res,la[x-1]+lb[y-1]-c)
    ans=min(ans,res)
    print(ans)
if __name__=="__main__":
    main()

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

using namespace std;

/**/
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define wt(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define wt(x...)
#endif
/**/

#define LL long long
const int MAXN = 112345;
const int INF  = 0x3f3f3f3f;

int a[MAXN], b[MAXN], c[MAXN], dp[MAXN][3];

// 0 add A

int main () {

	int n;
	scanf("%d", &n);

	for (int i = 1; i <= n; ++i) 
		scanf("%d %d %d", &a[i], &b[i], &c[i]);
	
	for (int i = 1; i <= n; ++i) {
		dp[i][0] = max (dp[i-1][1], dp[i-1][2]) + a[i];
		dp[i][1] = max (dp[i-1][0], dp[i-1][2]) + b[i];
		dp[i][2] = max (dp[i-1][0], dp[i-1][1]) + c[i];
	}

	dp[n][0] = max (dp[n][0], dp[n][1]);
	dp[n][0] = max (dp[n][0], dp[n][2]);

	printf("%d\n", dp[n][0]);



	return 0;
}



Measured memory_bytes: 2560
#include<iostream>
#include<iomanip>
#include<cstdio>

#include<vector>
#include<queue>
#include<set>
#include<map>
#include<string>

#include<algorithm>
#include<cmath>

using namespace std;
typedef long long ll;
template <class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template <class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
const int INF = 1e9;

//C問題は文字列走査のためpythonで解いたのでpy参照
int N;
int A[200000];

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

    int argmax = -1;
    int mf = -1, ms = -1; 
    for (int i = 0; i < N; i++) {
        if (A[i] > mf) {
            argmax = i;
            ms = mf;
            mf = A[i];
        } else if (A[i] > ms) {
            ms = A[i];
        }
    }
    for (int i = 0; i < N; i++) {
        if (i == argmax) {
            cout << ms << endl;
        } else {
            cout << mf << endl;
        }
    }
}


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

using namespace std;

#define forn(i, x, n) for (int i = int(x); i <= int(n); ++i)
#define for1(i, n, x) for (int i = int(n); i >= int(x); --i)
#define F first
#define S second
#define pb push_back

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

const int N = 2e6 + 1;
const ll INF = 1e18 + 9;
const int B = 1e9 + 7;


int main() {
    #ifdef black
    freopen("in", "r", stdin);
    #endif // black
    ios_base :: sync_with_stdio(0);
    cin.tie(0);

    ll d[2];
    d[1] = 0;
    d[0] = 1;
    int n, p;
    cin >> n >> p;
    forn(i, 1, n) {
        int x;
        cin >> x;
        x %= 2;
        if (x == 0)
            d[0] *= 2, d[1] *= 2;
        else {
            ll y = d[0], z = d[1];
            d[0] += z, d[1] += y;
        }
    }
    cout << d[p] << "\n";

    return 0;
}


Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author silviase
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BQualificationSimulator solver = new BQualificationSimulator();
        solver.solve(1, in, out);
        out.close();
    }

    static class BQualificationSimulator {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int A = in.nextInt();
            int B = in.nextInt();
            char[] c = in.next().toCharArray();
            int pass = 0;
            int fore = 0;

        /*
         a: 国内 かつ 学生 -> 通過者 A+B名まで
         b: 海外 かつ 学生 -> 通過者 A+B名 かつ海外 B 名まで
         c: 学生でない
         */
            for (char ch : c) {
                if (ch == 'a' && pass < (A + B)) {
                    pass++;
                    out.println("Yes");
                } else if (ch == 'b' && pass < (A + B) && fore < B) {
                    pass++;
                    fore++;
                    out.println("Yes");
                } else {
                    out.println("No");
                }
            }
        }

    }
}



Measured memory_bytes: 26864
#include<stdio.h>
#define NIL -1
int F[44];

int fibo(int n){
  int v;
  if(n == 0 || n == 1){
    F[n] = 1;
    return F[n];
  } 

  if(F[n] != NIL)return F[n];
  
  v = fibo(n - 1) + fibo(n - 2);
  F[n] = v;
  return v;
}

int main(void){
  int i, n;
  
  scanf("%d",&n);
  
  for(i = 0; i <= n; i++){
    
    F[i] = NIL;
    
  }
  
  i = fibo(n);
  
  printf("%d\n",i);
  
  return 0;
}

Measured memory_bytes: 596
s = raw_input()
n = int(s)

def main(n):
	d = 1
	n -= 1
	while n - 26**d >= 0:
		n -= 26**d
		d += 1
	ret = ''
	for i in range(d):
		ret += chr((n%26)+ord('a'))
		n //= 26
	return ret[::-1]

print main(n)


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

int main(){
  int p[5] = {3, 5, 7, 11, 13};
  int ans = 0, n;
  scanf("%d", &n);
  for(int i = 0; i < 3; i++){
    for(int j = i+1; j < 4; j++){
      for(int k = j+1; k < 5; k++){
        if(p[i]*p[j]*p[k] <= n) ans++;
      }
    }
  }
  ans += (3*3*3*5 <= n ? (3*3*3*7 <= n ? 2 : 1) : 0);
  printf("%d\n", ans);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
template <class T> void cumulative_sum( T array, size_t N );

const ll INF = 1LL << 60;
// const int k_mod = 1e9 + 7;
const int k_mod = 998244353;

template <typename T, typename K> struct P {
	T a; K b;
};
typedef struct {
	vector <int> to;
	bool is_visited = false;
} node;
typedef struct {
	int to;
	int cost;
	P <int, int> change;
} edge;
int main( void ){
	int N; cin >> N;
	vector <pair <int, int> > L( N );
	rep( i, 0, N ){
		int x, l; cin >> x >> l;
		L[ i ].first = x + l;
		L[ i ].second = x - l;
	}
	sort_asc( L );
	int cnt = 0, pos = -k_mod;
	for(auto l:L){
		if (pos <= l.second){
			cnt++;
			pos = l.first;
		}
	}
	cout << cnt << endl;
}

int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
template <class T> void cumulative_sum( T array, size_t N ) {
	rep( i, 1, N + 1 ){
		array[ i ] += array[ i - 1 ];
	}
}
template <class T> bool chmax( T& a, T b ) {
	if (a < b){
		a = b; return true;
	}
	return false;
}
template <class T> bool chmin( T& a, T b ) {
	if (a > b){
		a = b; return true;
	}
	return false;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}


Measured memory_bytes: 1024
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int numItems;
  int maxWeight;
  cin >> numItems;
  cin >> maxWeight;
  vector<pair<int, uint64_t>> items;
  for (int i = 0; i < numItems; ++i) {
    int weight;
    uint64_t value;
    cin >> weight;
    cin >> value;
    items.emplace_back(weight, value);
  }
  // value[w] = max(value[w], value[w - currentWeight] + currentValue))
  vector<vector<uint64_t>> maxValue;
  maxValue.resize(items.size() + 1);
  for (auto &m : maxValue) {
    m.resize(maxWeight + 1, 0);
  }
  for (int i = 1; i < maxValue.size(); ++i) {
    auto &currentItem = items[i - 1];
    for (int j = 0; j < maxValue[i].size(); ++j) {
      if (j < currentItem.first)
        maxValue[i][j] = maxValue[i - 1][j];
      else
        maxValue[i][j] =
            max(maxValue[i - 1][j],
                maxValue[i - 1][j - currentItem.first] + currentItem.second);
    }
  }
  cout << maxValue.back().back() << endl;
  return 0;
}


Measured memory_bytes: 79488
class InputLine
  def self.to_s
    gets.chomp
  end

  def self.to_i
    InputLine.to_s.to_i
  end
  
  def self.to_f
    InputLine.to_s.to_f
  end

  def self.to_sa
    InputLine.to_s.split(' ')
  end

  def self.to_ia
    InputLine.to_sa.map(&:to_i)
  end
  
  def self.to_fa
    InputLine.to_sa.map(&:to_f)
  end
end

S = 'abcdefghijklmnopqrstuvwxyz'

def main(argv)
  bases = [26]
  10.times do |i|
    bases[i + 1] = 26 * bases[i]
  end

  cs = [1]
  bases.size.times do |i|
    cs[i + 1] = bases[i] + cs[i]
  end

  n = InputLine.to_i

  k = -1
  cs.size.times do |i|
    if n < cs[i] then
      k = i - 1
      break
    end
  end

  z = n - cs[k]

  xs = [1] * (k + 1)
  j = 0
  while true do
    xs[j] += z % 26
    j += 1
    z /= 26
    break if z == 0
  end

  puts xs.map{|x| S[x - 1]}.reverse.join
end

if self.to_s == 'main' then
  main(ARGV)
end

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

const ll maxs = 1e6+5;
const ll lmaxs = 20;
ll mod = 1e9+7;
ll oo = 1e9;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define I insert

ll n;

void go(string s,char MAX){
    if(s.size()==n){
        cout << s << endl;
        return;
    }
    else{
        for(char c='a';c<=MAX;c++){
            go(s + c , c==MAX ? (char)(MAX+1) : MAX);
        }
    }
}

int main(){
    
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);cout.tie(nullptr);
    ll T = 1;
    //cin>>T;
    while(T--){
        cin>>n;
        go("",'a');
    }   
    return 0;
}

Measured memory_bytes: 1536
#include <iostream>
#include <bitset>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
//#include <boost/multiprecision/cpp_int.hpp>

const double EPS = (1e-10);


using namespace std;
using Int = long long;
//using namespace boost::multiprecision;

const Int MOD = 1000000007;

Int mod_pow(Int x, Int n) {
    Int res = 1;
    while(n > 0) {
        if(n & 1) res = (res * x) % MOD; //ビット演算(最下位ビットが1のとき)
        x = (x * x) % MOD;
        n >>= 1; //右シフト(n = n >> 1)
    }
    return res;
}

int main(){
    cin.tie(0);

    double N, M, D;
    double ans;
    cin >> N >> M >> D;
    if (D){
        ans = (N-D) * 2 * (M - 1) / pow(N, 2);
    }else{
        ans = (N) * (M-1) / pow(N, 2);
    }
    
    printf("%.12f\n", ans);
} 


Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

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

    vector<int> a(n);

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

    sort(a.begin(), a.end());

    int ans = 0;

    for (int i = 0; i < n; i++) {
        if (i != n - 1 ? a[i] <= x : a[i] == x) {
            ans++;
            x -= a[i];
        } else {
            break;
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
typedef vector<int>vi;
typedef vector<ll>VI;
typedef pair<int,int>pii;
typedef pair<pii,int>Pii;
#define rep(i,a,b) for (int i=a;i<=b;++i)
#define dep(i,a,b) for (int i=a;i>=b;i--)
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define lowbit(x) ((x)&((x)^((x)-1)))
#define sz(x) int(x.size())
#pragma GCC optimize(2)
const int N=1e6+10;
const ll mod=1e9+7;
const int maxn=1e5+10;
const int inf=0x3f3f3f3f;
const ll INF=0x3f3f3f3f3f3f3f3f;
ll qpow(ll a,ll b){ll s=1;while(b>0){if(b&1)s=s*a%mod;a=a*a%mod;b>>=1;}return s;}
ll C(ll n,ll m){ ll a=1,b=1; if (m>n-m) m=n-m; if (m<0) return 0;
 while(m){ a=a*n%mod; b=b*m%mod; m--; n--;} return a*qpow(b,mod-2)%mod;}
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
void init() {ios::sync_with_stdio(false); cin.tie(0);}
const double PI=3.1415926535897932;


int main(){
	init();
    int a,b,c,d,e; cin>>a>>b>>c>>d>>e;
	cout<<max(0,c*60+d-(a*60+b)-e); 
	return 0;
}












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

const int N = 4e5 + 10;
multiset<int> a, b;
P p[N];

ll getans() {
	return 1LL * (*a.rbegin() - *a.begin()) * (*b.rbegin() - *b.begin());
}

int main() {
	int n;
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		scanf("%d%d", &p[i].first, &p[i].second);
		if (p[i].first > p[i].second)
			swap(p[i].first, p[i].second);
		a.insert(p[i].first);
		b.insert(p[i].second);
	}
	sort(p + 1, p + n + 1);
	ll ans = getans();
	for (int i = 1; i <= n; i++) {
		int x = p[i].first, y = p[i].second;
		a.erase(a.find(x));
		b.erase(b.find(y));
		b.insert(x);
		a.insert(y);
		ans = min(ans, getans());
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 20736
#include <bits/stdc++.h>
using namespace std;
 
int main(){
	int N;
  	cin>>N;
  	vector<int> arr(N);
  for(int i = 0; i < N; i++) {
  	cin>>arr[i];
  }
  int p = 0;
  int q = abs(arr[1] - arr[0]);
  for(int i = 2; i < N; i++){
  	int temp = min(abs(arr[i] - arr[i - 2]) + p, abs(arr[i] - arr[i - 1]) + q);
    p = q;
    q = temp;
  }
  cout<<q<<endl;
}

Measured memory_bytes: 3728
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var A = Console.ReadLine().Split(' ').Select(s => long.Parse(s)).ToArray();
            long ans = A[0];
            long ratio = ans;
            long limit = (long)Math.Pow(10, 18);
            if (A.Contains(0))
            {
                Console.WriteLine(0);
                return;
            }
            
            for (int i = 1; i < N; i++)
            {
                ans *= A[i];
                if (ratio > ans)
                {
                    ans = -1;
                    break;
                }
                else
                {
                    ratio = ans;
                }
            }
            if (ans > limit)
            {
                ans = -1;
            }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 39932
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho10
#define ll long long
#define double long double
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#define sz size
#define f first
#define s second
#define pb push_back
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define endl '\n'
#define mod 1000000007
#define PI 3.14159265359
#define MAXN 100005
#define INF 1000000005
#define LINF 1000000000000000005
#define CODE_START  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n;
string s;
int32_t main(){
CODE_START;
cin>>s;
if(s[0]==s[1]&&s[1]==s[2]&&s[0]=='R'){
    cout<<3<<endl;
}else if(s[0]==s[1]&&s[0]=='R'){
cout<<2<<endl;
}else if(s[1]==s[2]&&s[1]=='R'){
cout<<2<<endl;
}else if(s[1]=='R'||s[2]=='R'||s[0]=='R'){
cout<<1<<endl;
}else cout<<0<<endl;
}



Measured memory_bytes: 3648
#include<iostream>

using namespace std;
int dp[100009][13];
#define mod 1000000007

int posmod(int a, int m){
    int r = a % m;
}

int main(){
    int ten[] = {1, 10, 100, 1000, 10000, 100000};
    string s;
    getline(cin, s);
    int n = s.size();
    // calcsdp[0]
    if (s[n-1] == '?')
        for (int i=0; i<10; i++)
            dp[0][i] = 1;
    else
        dp[0][s[n-1]-'0'] = 1;

    int j;
    for(int i=1; i<n; i++){
        if (s[n-1-i] == '?'){
            for (int m=0; m<13; m++){
                for (int d=0; d<10; d++){
                    j = (m + ten[i%6]*d) % 13;
                    dp[i][j] = (dp[i][j] + dp[i-1][m]) % mod;
                }
            }
        } else {
            for (int m=0; m<13; m++){
                j = (m + ten[i%6]*(s[n-1-i] - '0')) % 13;
                dp[i][j] = dp[i-1][m];
            }
        }
    }
    cout << dp[n-1][5];
}



Measured memory_bytes: 5504
using System;
using System.IO;
using System.Collections.Generic;

namespace _132
{
    class Program
    {
        static void Main(string[] args)
        {
            solve_132A();
        }

        public static void solve_132A()
        {
            string a = Console.ReadLine();

            char[] str = a.ToCharArray();

            Array.Sort(str);
            
            string ansewr = "Yes";
            if (str[0] != str[1] || str[2] != str[3] || str[0] == str[2])
            {
                ansewr = "No";
            }

            Console.WriteLine(ansewr);
        }
    }
}


Measured memory_bytes: 11348
#include <cmath>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
#include <unordered_map>
#include <iomanip>
#include <bitset>

using namespace std;

typedef long long ll;

mt19937 rnd(228);

struct kek
{
    int i, j, k;
};


int gr[2000];


int f(int n, int k)
{
    return (k - 1) * (ll) n / k;
}

int rz(int n, int k)
{
    return n - f(n, k);
}

int a(int n, int k)
{
    while (n % k)
    {
        int me = rz(n, k);
        int l = 0, r = n;
        while (l < r - 1)
        {
            int m = (l + r) / 2;
            if (rz(m, k) != rz(n, k))
            {
                l = m;
            }
            else
            {
                r = m;
            }
        }
        int it = (n - l) / me + bool((n - l) % me);
        n -= it * me;
    }
    return n / k;
}

int main()
{
#ifdef ONPC
    freopen("a.in", "r", stdin);
#endif
    int n;
    cin >> n;
    int ans = 0;
    while (n--)
    {
        int x, y;
        cin >> x >> y;
        ans ^= a(x, y);
    }
    if (ans == 0)
    {
        cout << "Aoki\n";
    }
    else
    {
        cout << "Takahashi\n";
    }
}


Measured memory_bytes: 256
X, Y, A, B, C = map(int, input().split())
Ap = list(map(int, input().split()))
Bq = list(map(int, input().split()))
Cr = list(map(int, input().split()))

Ap.sort()
Bq.sort()

print(sum(sorted(Ap[A-X:] + Bq[B-Y:] + Cr)[C:]))

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

int main(void) {
  ios::sync_with_stdio(false);
  int K;
  cin >> K;
  rep(i, K) cout << "ACL";
  cout << endl;
  return 0;
}


Measured memory_bytes: 3608
b,c[9<<20],n;main(a){for(;++a<8e6;)for(n=a;n<2e6;)c[n+=a]+=!c[a];for(;scanf("%d",&n)*n;b=!printf("%d\n",b))for(a=1;a++<n/2;)c[a]+c[n-a]||b++;}

Measured memory_bytes: 15000
#include <stdio.h>
#include <stdlib.h>
int main(){
    int n;

    scanf("%d",&n);
    int a[n];
    for(int i=0;i<n-1;i++){
        scanf("%d ",&a[i]);
    }
    scanf("%d",&a[n-1]);
int i=1;
int j=0;
int b[n];
while(1){
  if (j>=n){
      break;
  }
  if (a[j]==i){
      b[i-1]=i;
      i+=1;
  }
  j+=1;
}

if(b[0]=='\0'||i==1){
  printf("%d",-1);
  exit(0);
}

printf("%d\n",n-i+1);
}

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

//#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

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> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

double adjust_n(int n,int m){
    return (n + m/60.0);
}

signed main()
{   
  gearup;
  ll a,b,h,m;cin>>a>>b>>h>>m;
  double d_n = adjust_n(h,m);
  double angle = abs((m - d_n*5.0) * 6.0);
  angle = min(angle,360-angle);
  double ans = a*a+b*b-2*a*b*cos(angle*1.0f*(PI/180));
  ans = sqrt(ans);
  cout << fixed << setprecision(10);
  out(ans);
}

Measured memory_bytes: 4248
#include <iostream>
#include <vector>

using namespace std;

int main() {
    int N;
    cin >> N;
    vector<double> A(N);
    double ap=1;
    for(int n=0; n<N; n++) {
        cin >> A[n];
        ap *= A[n];
    }
    
    double ans=0;
    for(int n=0; n<N; n++) {
        ans += ap/A[n];
    }
    cout << ap/ans << endl;


    return 0;
    
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>

using namespace std;

const int mod = (int)1e9 + 7;
int mp[128];
int mul(int a, int b){
	int ans = 0;
	while(b){
		if(b & 1){
			ans += a;
			ans %= mod;
		}
		a <<= 1;
		a %= mod;
		b >>= 1;
	}
	return ans;
}
int main(){
	int n;
	string s;
	cin >> n >> s;
	for (int i = 0; i < n; i++){
		mp[s[i]]++;
	}	
	int ans = 1;	
	for (char ch = 'a'; ch <= 'z'; ch++){
		ans = mul(ans, mp[ch] + 1);
		ans %= mod;
	}	
	cout << ans - 1 << endl;
	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <map>

using namespace std;

int main(void)
{
	map<int, int>table;
	map<int, int>table2;

	int n;
	cin >> n;

	for (int i = 0; i < n; i++)
	{
		int a;
		cin >> a;

		table[a]++;

		table2[i] = a;
	}

	int ans = 0;

	int size = table.size();

	for (int i = 0; i < n; i++)
	{
		int a = table2[i];

		int b = table[a];

		if (b < a)
		{
			ans += b;
			table[a] = a;
		}
		else if (b > a)
		{
			ans += (b - a);
			table[a] = a;
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 9216
#100 C - /\/\/\/
import collections
n = int(input())
A = list(map(int,input().split()))

A1 = A[::2]
A2 = A[1::2]
cnt1 = collections.Counter(A1)
cnt2 = collections.Counter(A2)

items1 = list(cnt1.items())
items2 = list(cnt2.items())
items1 = sorted(items1,key = lambda x:x[1],reverse = True)
items2 = sorted(items2,key = lambda x:x[1],reverse = True)

if items1[0][0] != items2[0][0]:
    ans = (len(A1) - items1[0][1]) + (len(A2) - items2[0][1])
else:
    if len(items1) == len(items2) == 1:
        ans = min(len(A1),len(A2))

    else:
        ans1 = (len(A1) - items1[0][1]) + (len(A2) - items2[1][1])
        ans2 = (len(A1) - items1[1][1]) + (len(A2) - items2[0][1])
        ans = min(ans1,ans2)
print(ans)

Measured memory_bytes: 96416
import java.io.IOException;
import java.util.NoSuchElementException;

import java.io.InputStream;

import java.io.PrintWriter;

@SuppressWarnings("unchecked")
public class Main {
    public static void main(String[] args) throws IOException {
        PrintWriter out = new PrintWriter(System.out);

        final int N = nextInt();

        final int T = nextInt();

        int sum = 0;
        int prev = 0;
        int next = 0;

        for (int i = 0; i < N; i++) {
            final int t = nextInt();

            if (t < next) {
                sum += t - prev;
                prev = t;
                next = t + T;
            } else {
                sum += next - prev;
                prev = t;
                next = t + T;
            }
        }

        sum += T;

        out.println(sum);

        out.flush();
    }

    // FastScanner start
    static final InputStream in = System.in;
    static final byte[] buffer = new byte[1024];
    static int ptr = 0;
    static int buflen = 0;
    static boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    static int readByte() {
        if (hasNextByte()) return buffer[ptr++];
        else return -1;
    }
    static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }
    static boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
        return hasNextByte();
    }
    static String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    static long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if(b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    static int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }
    static double nextDouble() {
        return Double.parseDouble(next());
    }
    // FastScanner end
}


Measured memory_bytes: 23508
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int i,l=s.length(),c1=0,c2=0;
    for(i=0;i<l;i++)
    {
        if(s[i]=='0') c1++;
        else c2++;
    }
    if(c1>c2) c1=c2;
    cout<<c1*2<<endl;
    return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#include<boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::multiprecision;
#define BEGIN ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define END return EXIT_SUCCESS
#define rep(I,N) for(auto I=0;I<(N);++I)
#define up(I,A,B) for(auto I=(A);I<=(B);++I)
#define dw(I,A,B) for(auto I=(A);I>=(B);--I)
#define all(C) (C).begin(),(C).end()
#define rall(C) (C).rbegin(),(C).rend()
#define ft first
#define sd second
#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define pt pop_front
#define pk pop_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define rs resize
template<class T> T count_bit(T p){
  if(typeid(p)==typeid(int))return __builtin_popcount(p);
  else if(typeid(p)==typeid(long))return __builtin_popcountl(p);
  else return __builtin_popcountll(p);
}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
template<class T>inline void                                      in(T &p){cin>>p;}
template<class T1,class T2>inline void                            in(T1 &p1,T2 &p2){cin>>p1>>p2;}
template<class T1,class T2,class T3>inline void                   in(T1 &p1,T2 &p2,T3 &p3){cin>>p1>>p2>>p3;}
template<class T1,class T2,class T3,class T4>inline void          in(T1 &p1,T2 &p2,T3 &p3,T4 &p4){cin>>p1>>p2>>p3>>p4;}
template<class T1,class T2,class T3,class T4,class T5>inline void in(T1 &p1,T2 &p2,T3 &p3,T4 &p4,T5 &p5){cin>>p1>>p2>>p3>>p4>>p5;}
template<class T>inline void                                      ins(T &p){for_each(all(p),in<decltype(p[0])>);}
template<class T>inline void                             out(T p){cout<<p<<endl;}
template<class T1,class T2>inline void                   out(T1 p1,T2 p2){cout<<p1<<" "<<p2<<endl;}
template<class T1,class T2,class T3>inline void          out(T1 p1,T2 p2,T3 p3){cout<<p1<<" "<<p2<<" "<<p3<<endl;}
template<class T1,class T2,class T3,class T4>inline void out(T1 p1,T2 p2,T3 p3,T4 p4){cout<<p1<<" "<<p2<<" "<<p3<<" "<<p4<<endl;}
inline                                              void out(double p){printf("%.10f\n",p);}
template<class T>inline                             void outs(T p){for_each(all(p),out<decltype(p[0])>);}

inline void solve(void){
  double N;
  in(N);
  vector<double>A(N);
  ins(A);
  double ans=0;
  rep(i,N){
    ans+=1/A[i];
  }
  out(1/ans);
}
int main(int argc,char**argv){
  BEGIN;
  solve();
  END;
}


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

cb = -1
for i in range(N):
    cv = A[i]
    if cb == -1 and i + 1 < N:
        nv = A[i+1]
        if nv > cv:
            cb = cv
            continue
    
    if cb >= 0:
        if i == N-1:
            M += (cv - cb) * (M // cb)
            break
        nv = A[i+1]
        if nv < cv:
            M += (cv - cb) * (M // cb)
            cb = -1
print(M)

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

int f[10005]={0};

int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=100;i++){
		for(int j=1;j<=100;j++){
			for(int k=1;k<=100;k++){
				int tt=i*i+j*j+k*k+i*j+i*k+j*k;
				if(tt<=n){
					f[tt]++;
				}
			}
		}
	}
	for(int i=1;i<=n;i++){
		cout<<f[i]<<endl;
	}
	return 0;
}

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

int main(void){
      int N,K,ans=1;cin >> N >> K;
      int x = 0;
      if(N<K){
            cout << 1 << endl;
            return 0;
      }
            
      for(;;){
            if(ans == 1)x = K*K;
            else x*= K;
            if(x>N){
                  ans++;
                  break;
            }
            ans++;
      }
      cout << ans << endl;
      
}


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

import sys
import pprint
from math import ceil

sys.setrecursionlimit(10 ** 6)

class Logger:
	def __init__(self, debug):
		self.debug = debug
	def print(self, *args):
		if self.debug:
			pprint.pprint(args)


def main():
	log = Logger(1)
	n, x, t = map(int, sys.stdin.readline().split())
	print(t * ceil(n / x))
	


main()

Measured memory_bytes: 68488
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace AtCoder
{
	public class QuestionA
	{
		public static void Main(string[] args)
		{
			// 整数の入力
			int n = int.Parse(Console.ReadLine());

			List<int> buttonList = new List<int>();
			for (int i = 0; i < n; ++i) {
				buttonList.Add(int.Parse(Console.ReadLine()));
			}

			int index = buttonList[0];
			int count = 1;
			while (count <= n) {
				if (index == 2) {
					break;
				}
				++count;
				index = buttonList[index - 1];
			}

			if(count > n) {
				count = -1;
			}

			Console.WriteLine(count);

		}
	}
}


Measured memory_bytes: 31892
#include <stdio.h>

int main(void)
{
    static char prime[1000002];
    int i, j;
    int n, ans;
    
    for (i = 1; i <= 1000000; i += 2){
        prime[i] = 1;
    }
    
    prime[1] = 0;
    prime[2] = 1;
    
    for (i = 1; i <= 1000; i += 2){
        if (prime[i] == 1){
            for (j = 3; i * j <= 1000000; j += 2){
                prime[i * j] = 0;
            }
        }
    }
    
    while (1){
        scanf("%d", &n);
        
        if (n == 0){
            break;
        }
        
        ans = 0;
        for (i = 2; i <= n / 2; i++){
            if (prime[i] && prime[n - i]){
                ans++;
            }
        }
        
        printf("%d\n", ans);
    }
    return (0);
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define repl(i, l, r) for (ll i = l; i < r; i++)
#define rep(i, n) repl(i, 0, n)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

int main()
{
    string s, t;
    cin >> s;
    cin >> t;
    int n = s.size();
    int ans = 0;
    for(int i; i < n; i++) {
        if(s[i] != t[i]) ans++;
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;
typedef long long ll;

#define INF (long long)(1e9+7)
#define REP(i,n) for(ll i = 0; i < n; i++)
#define REP1(i,n) for(ll i = 1; i <= n; i++)

int main(void)
{
    string s, fr, bk; cin >> s;
    int rev = 0;
    int t, f;
    char c;
    ll q; cin >> q;
    REP(i, q) {
        cin >> t;
        if(t == 1) {
            rev = 1 - rev;
        } else {
            cin >> f >> c;
            if((f==1&&rev==0)||(f==2&&rev==1)) {
                fr = fr + c;
            } else {
                bk = bk + c;
            }
        }
    }
    if(rev==1) {
        reverse(s.begin(), s.end());
        reverse(bk.begin(),bk.end());
        s = bk + s + fr;
    } else {
        reverse(fr.begin(), fr.end());
        s = fr + s + bk;
    }
    cout << s << endl;

}






Measured memory_bytes: 1620
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define var auto
using namespace std;
using ll = long long;
using P = pair<int, int>;
// sort(A.begin(), A.end(), cmp)
bool cmp(P a, P b) { return a.second < b.second; }
#ifdef DEBUG
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; cout << a << endl; return 1; } cout << a << endl; return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; cout << a << endl; return 1; } cout << a << endl; return 0; }
#else
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; }
#endif
const ll INF = 1LL << 60;
const int MAX_ITEM = 10e4+10; // 10^5
ll dp[MAX_ITEM] = {0};

int main() {
  int n;
  cin >> n;
  vector<int> a;
  rep(i,n) {
    int aa;
    cin >> aa;
    a.push_back(aa);
  }

  bool res = all_of(a.begin(), a.end(), [](int aa) {
    return (aa % 2 == 1 || (aa % 3 == 0 || aa % 5 == 0));
  });

  if (res) {
    cout << "APPROVED" << endl;
  } else {
    cout << "DENIED" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <algorithm>
#include <cstdio>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <fstream>
#include <cmath>
#include <random>
#include <complex>
#include <functional>
#include <bitset>
#include <sstream>
#include <cassert>
#include <time.h>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)
using namespace std;
typedef vector<ll> vec;
typedef vector<vec> mat;

const ll inf = 1LL << 60;

template<class T> inline void chmin(T& a, T b) {
    if (a > b) {
        a = b;
    }
}
template<class T> inline void chmax(T& a, T b) {
    if (a < b) {
        a = b;
    }
}
void printvec (vec &v) {
    Rep (i, (ll)v.size()) {
        cout << v[i] << " \n"[i+1 == (ll)v.size()];
    }
}

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

    ll X;
    cin >> X;
    if (X >= 30) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }
}

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

using namespace std;

#define REP(i,m) for(long long i=0; i<m; i++)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define INF 1000000000
#define INFL (1LL << 60)
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define ll long long int
#define P pair<ll, ll>

int main(){
  ll n;
  cin >> n;
  ll a[n];
  REP(i, n) cin >> a[i];
  if(n == 1){
    cout << "YES" << endl;
    return 0;
  }
  ll sum = 0;
  REP(i, n) sum += a[i];
  if(sum % (n*(n+1)/2) != 0){
    cout << "NO" << endl;
    return 0;
  }
  ll num = sum / (n*(n+1)/2);
  ll b[n];
  REP(i, n){
    if(i == n-1) b[i] = a[0] - a[n-1];
    else b[i] = a[i+1] - a[i];
  }
  REP(i, n){
    if((num - b[i]) % n != 0){
      cout << "NO" << endl;
      return 0;
    }
    ll div = (num - b[i]) / n;
    if(div < 0 || div > num){
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
	return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1000000007;
constexpr ll INF = 1ll<<60;

int main(int argc, char **argv)
{
	ll N, M; cin >> N;
	vector<ll> A(N);
	for (ll i = 0; i < N; ++i) cin >> A[i];
	vector<bool> is(2000*20+10, 0);

	for (ll bits = 0; bits < (1 << N); ++bits)
	{
		ll s_tmp{0};
		for (ll i = 0; i < N; ++i)
		{
			if (bits & (1 << i))
				s_tmp += A[i];
		}
		is[s_tmp] = true;
	}
	cin >> M;
	ll m;
	while (M--)
	{
		cin >> m;
		std::cout << (is[m] ? "yes" : "no")<< std::endl;
	}
}



Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define nl "\n"
#define rep(i,n) for(ll i=0; i<(n); i++)
typedef vector<ll> vl;
typedef vector<string> vs;
typedef pair<ll,ll> pl;
typedef vector<pl> vp;
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define sortup(V) sort(V.begin(), V.end())
#define sortdown(V) sort(V.rbegin(), V.rend())
#define MOD 998244353 //1000000007

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

    // solution comes here
    ll N;
    char S[105];
    scanf("%lld %s", &N, S);
    if(N%2) {
        puts("No");
        return 0;
    }
    char a[55];
    rep(i, N) {
        if(i<N/2) {
            a[i] = S[i];
        }
        else {
            if(a[i-N/2] != S[i]){
                puts("No");
                return 0;
            }
        }
    }
    puts("Yes");
}


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

int main()
{
	int num , x , i;
	cin >> num;
	long long sum = 0, min = 100000000000, max = -100000000000;
	
	for ( i = 0; i < num; i++)
	{
		cin >> x;
		sum = sum + x;

		if (x < min)
			min = x;
		if (x > max)
			max = x;
	}
	cout << min << " " << max << " " << sum << endl;
}


Measured memory_bytes: 3092
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int lld;

const lld mod = 1e9+7;
const lld INF = 1e9;
//const lld MAXN = 1e9;

int main()
{
	string str;
	cin >> str;
	int n = str.size();

	for(int i = n-1; i >= 0; i--)
	{
		cout << str[i];
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 3120
#include <iostream>
#include <iomanip>
#include <cmath>
#include <functional>
#include <algorithm>
#include <numeric>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <boost/range/irange.hpp>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/container/static_vector.hpp>
#include <boost/utility/string_ref.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/math/common_factor_rt.hpp>

template <class... Args>
struct tuple_input_impl;
template <std::size_t i, std::size_t... tail>
struct tuple_input_impl<std::index_sequence<i, tail...>>
{
    template <class... Args>
    static void f(std::tuple<Args...>& x)
    {
        std::cin >> std::get<i>(x);
        tuple_input_impl<std::index_sequence<tail...>>::f(x);
    }
};
template <>
struct tuple_input_impl<std::index_sequence<>>
{
    static void f(...) {}
};

template <class... Args>
std::istream& operator>>(std::istream& in, std::tuple<Args...>& x)
{
    tuple_input_impl<std::index_sequence_for<Args...>>::f(x);
    return in;
}
template <class T1, class T2>
std::istream& operator>>(std::istream& in, std::pair<T1, T2>& x) { return in >> x.first >> x.second; }

template <class T>
T read()
{
    T res;
    std::cin >> res;
    return res;
}
template <class T>
std::vector<T> read(std::size_t n)
{
    std::vector<T> res(n);
    for (std::size_t i = 0; i < n; ++i) std::cin >> res[i];
    return res;
}

template <class T>
void out_impl(T&& v) { std::cout << std::forward<T>(v); }
template <class T, class... Args>
void out_impl(T&& v, Args&&... args)
{
    std::cout << std::forward<T>(v) << ' ';
    out_impl(std::forward<Args>(args)...);
}
template <class... Args>
void out(Args&&... args)
{
    out_impl(std::forward<Args>(args)...);
    std::cout << '\n';
}
template <class... Args>
void out_noreturn(Args&&... args) { out_impl(std::forward<Args>(args)...); }

template <class T>
void print(const T& container)
{
    bool first = true;
    for (auto&& x : container) {
        if (!first) std::cout << ' ';
        std::cout << x;
        first = false;
    }
    std::cout << '\n';
}

void prog()
{
    auto l = read<int>(read<int>());
    std::sort(std::begin(l), std::end(l));
    auto sum = std::accumulate(std::begin(l), std::end(l) - 1, 0);
    out((l.back() < sum) ? "Yes" : "No");
}

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


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var ab = ReadInts();

            if(ab[0]%2==0&&ab[1]%2==0 || ab[0] % 2 == 1 && ab[1] % 2 == 1)
            {
                WriteLine(ab[1]-(ab[1] - ab[0])/2);
            }
            else
            {
                WriteLine("IMPOSSIBLE");
            }

        }
    

    private static string Read() { return ReadLine(); }
    private static string[] Reads() { return (Read().Split()); }
    private static int ReadInt() { return int.Parse(Read()); }
    private static long ReadLong() { return long.Parse(Read()); }
    private static double ReadDouble() { return double.Parse(Read()); }
    private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
    private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
    private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }


    public static bool IsPrime(int num)
    {
        if (num < 2) return false;
        else if (num == 2) return true;
        else if (num % 2 == 0) return false;

        double sqrtNum = Sqrt(num);
        for (int i = 3; i <= sqrtNum; i += 2)
        {
            if (num % i == 0)
            {
                return false;
            }
        }
        return true;
    }

    //最大公約数
    public static int Gcd(int a, int b)
    {
        if (a < b)
        {
            return Gcd(b, a);
        }
        while (b != 0)
        {
            var reminder = a % b;
            a = b;
            b = reminder;
        }
        return a;
    }

    //最小公倍数
    public static int Lcm(int a, int b)
    {
        return a * b / Gcd(a, b);
    }

    //文字数を数える
    public static int CountChar(string s, char c)
    {
        return s.Length - s.Replace(c.ToString(), "").Length;
    }
    public static void debuglist(List<int> x)
    {
        foreach (var item in x)
        {
            WriteLine(item);
        }
    }
    public static void debuglist(List<string> x)
    {
        foreach (var item in x)
        {
            WriteLine(item);
        }
    }
    public static void debugarray(int[] x)
    {
        foreach (var item in x)
        {
            WriteLine(item);
        }
    }
    public static void debugarray(string[] x)
    {
        foreach (var item in x)
        {
            WriteLine(item);
        }
    }
}
}


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

int main()
{
  int n;
  cin>>n;
  set<int> st;
  for (int i = 0; i < n; ++i)
  {
    int a;
    cin>>a;
    if(st.find(a)==st.end()){
      st.insert(a);
    }
    else st.erase(a);
  }
  cout<<st.size();
}

Measured memory_bytes: 4864
N = int(input())

A_list = list()
B_list = list()

for i in range(N):
    A,B = map(int, input().split())
    A_list.append(A)
    B_list.append(B)

print(min(A_list)-1 + max(A_list)-min(A_list)+1 +min(B_list))

Measured memory_bytes: 11052
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<bitset>
using namespace std;
typedef long long LL;
int gi() {
	int w=0;bool q=1;char c=getchar();
	while ((c<'0'||c>'9') && c!='-') c=getchar();
	if (c=='-') q=0,c=getchar();
	while (c>='0'&&c <= '9') w=w*10+c-'0',c=getchar();
	return q?w:-w;
}
const int S=1<<19|1;
const int N=40;
int f[S],g[S],to[S][N];
int ban[N][N];
int main()
{
	int n=gi()-1,m=gi(),lim=gi(),i,t,s,a,b,c;
	const int mod=1e9+7;
	
	while (lim--)
		a=gi()-1,b=gi()-1,c=gi(),ban[a][b]|=1<<!c;

	for (s=0;s<1<<n;s++)
		for (i=0;i<n;i++)
			if (s>>i&1) to[s][i]=s;
			else {
				to[s][i]=s|1<<i;
				for (t=i+1;t<n;t++)
					if (s>>t&1) {
						to[s][i]^=1<<t;
						break;
					}
			}
	
	f[0]=1;
	for (t=0;t<m;t++) {
		for (i=0;i<n;i++) {
			for (s=0;s<1<<n;s++) g[s]=0;
			if (~ban[t][i]&1)
				for (s=0;s<1<<n;s++)
					if (!(s>>i&1))
						g[s]=f[s];
			
			if (~ban[t][i]&2)
				for (s=0;s<1<<n;s++)
					(g[to[s][i]]+=f[s])%=mod;
			
			for (s=0;s<1<<n;s++) f[s]=g[s];
		}
	}
	int ans=0;
	for (s=0;s<1<<n;s++) (ans+=f[s])%=mod;
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 86272