akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long ll;
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(v, n) sort(v, v+n)
#define VSORT(v) sort(v.begin(), v.end())
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define INF 999999999
const double EPS = 1e-10;
const double PI  = acos(-1.0);
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main(){
    int X,A;
    cin >> X >> A;
    if(X>=A){
        cout << 10 << endl;
    }else{
        cout << 0 << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const int MOD2 = 998244353;

int a[1000010];
int b[1000010];

map<int,int> prime_factor(int n) {
      map<int, int> ret;
      for(int i = 2; i * i <= n; i++) {
          while(n % i == 0) {
              ret[i]++;
              n /= i;
          }
      }
      if(n != 1) ret[n] = 1;
      return ret;
}

int main(){
    int n;
    cin >> n;
    rep(i, n) cin >> a[i];
    int g = a[0];
    rep(i, n-1) g = __gcd(g, a[i+1]);
    if(g > 1) {
        cout << "not coprime" << endl;
        return 0;
    }

    rep(i, n){
        map<int,int> mp = prime_factor(a[i]);
        for(auto e : mp) b[e.first]++;
    }

    rep(i, 1000010){
        if (b[i] > 1) {
            cout << "setwise coprime" << endl;
            return 0;
        }
    }
    cout << "pairwise coprime" << endl;
    return 0;
}


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

int main() {
  int N;
  cin >> N;
  char c[N];
  for (int i = 0; i < N; i++) cin >> c[i];
  
  
  string ans = "Yes";
  if (N % 2) {
    ans = "No";
  } else {
    int n = N / 2;
    
    for (int i = 0; i < n; i++) {
      if (c[i] != c[i + n]) {
        ans = "No";
        break;
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
def solve(cur_index):
    global ret
    if cur_index == N:
        tmp_sum = 0
        for i in range(Q):
            if A[b[i]] - A[a[i]] == c[i]:
                tmp_sum += d[i]
        ret = max(ret, tmp_sum)
        return
    for i in range(min(A[cur_index], M), M + 1):
        A[cur_index + 1] = i
        solve(cur_index + 1)


if __name__ == '__main__':
    N, M, Q = map(int, input().split())
    a = [0 for _ in range(Q)]
    b = [0 for _ in range(Q)]
    c = [0 for _ in range(Q)]
    d = [0 for _ in range(Q)]
    for i in range(Q):
         a[i], b[i], c[i], d[i] = map(int, input().split())
    ret = 0
    A = [1 for _ in range(N + 1)]
    solve(0)
    print(ret)

Measured memory_bytes: 71408
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
ull B = 100000007;
int mod = 1000000007;

class Solution {
    ll qmul(ll a, ll b) {
        ll res = 1, tp = a;
        while(b) {
            if(b & 1ll) {
                res *= tp;
                res %= mod;
            }
            tp *= tp;
            tp %= mod;
            b >>= 1ll;
        }
        return res;
    }

    ll inv(ll x) {
        return qmul(x, mod - 2);
    }

    vector<ll> p;
public:
    ll e(int N, int M) {
        p = vector<ll>(M + 1, 1);
        for(int i = 1; i <= M; ++i) {
            p[i] = p[i - 1] * i;
            p[i] %= mod;
        }
        ll P1 = 1;
        for(int i = 0; i < N; ++i) {
            P1 *= (M - i);
            P1 %= mod;
        }
        P1 *= P1;
        P1 %= mod;
        ll del = 0;
        for(int i = 1; i <= N; ++i) {
            ll nCi = p[N] * inv(p[N - i]) % mod * inv(p[i]) % mod;
            ll invt = inv(p[M - N]);
            ll tmp = nCi;
            tmp *= p[M]; tmp %= mod;
            tmp *= invt; tmp %= mod;
            tmp *= p[M - i]; tmp %= mod;
            tmp *= invt; tmp %= mod;
            if(i & 1) {
                del += tmp;
            }
            else {
                del -= tmp;
            }
            del = (del + mod) % mod;
        }

        return (P1 - del + mod) % mod;

    }

};

int main() {
    int n, m;
    cin >> n >> m;
    Solution zhy;
    cout << zhy.e(n, m) << endl;
    return 0;
}

Measured memory_bytes: 7216
import java.io.*;
import java.util.*;
import java.util.function.*;

final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Supplier<String> sc) {
		int N = Integer.parseInt(sc.get());
		int[] A = new int[N];
		Arrays.setAll(A, $ -> Integer.parseInt(sc.get()));
		long round = Math.round(Arrays.stream(A).average().orElseThrow(RuntimeException::new));
		System.out.println(Arrays.stream(A).mapToLong(x -> (x - round) * (x - round)).sum());
	}
}

class Main {
	public static void main(String... args) {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		Solver.INSTANCE.solve(new Supplier<String>() {
			private StringTokenizer tokenizer;

			public String get() {
				try {
					return (tokenizer = tokenizer != null && tokenizer.hasMoreTokens() ? tokenizer : new StringTokenizer(reader.readLine())).nextToken();
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
		});
	}
}

Measured memory_bytes: 27988
#include <bits/stdc++.h>
#include <string>
#include <algorithm>
#define FOR(i,n,x) for(int i=0;i<n;i+=x)
#define ll long long int 
#define llu unsigned long long int
#define pb(x) push_back(x)
#define mp make_pair
#define vi vector<int>
#define vvi vector<vi>
#define pll pair<ll,ll>
#define pii pair<int,int>
#define max(x,y) (x>y)?x:y
#define min(x,y) (x<y)?x:y 
#define mid(s,e) (s+(e-s)/2)
#define MOD 1000000007
#define MAXI 100000000000009
const int MX = 10010896;
const int lmt = 3164;
const int MAXL = 1000;
const int MAX_MID = 1e5;
using namespace std;

void solve(){
    int a,b;
    cin>>a>>b;
    int ans = a*b;
    cout<<ans;
}

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

Measured memory_bytes: 3596
#pragma target("avx")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
const int INF = 1e9, MOD = 1e9 + 7, ohara = 1e6 + 10;
const ll LINF = 1e18;

#define rep(i, n) for (ll(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrrep(i, a, b) for (ll i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout << (x) << endl
#define doublecout(a) cout << fixed << setprecision(15) << a << endl;
#define fi first
#define se second
#define m_p make_pair
#define p_b push_back

//------ Believe yourself as a genius!!!!!! ------

int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
// int dy[]={-1,0,1,-1,1,-1,0,1};int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"), s;
ll n, cnt, ans, a, b, c, d, tmp, m, h, w, x, y, sum, k, q;

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

  cin >> n >> a >> b;
  if (abs(a - b) % 2 == 0)
    Cout("Alice");
  else
    Cout("Borys");
  return 0;
}

Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool find(int a, int b, int c, string &s) {
    bool fa = 0, fb = 0, fc = 0;
    for (int i = 0; i < s.length(); ++i) {
        if (s[i] - '0' == a && !fa)
            fa = 1;
        else if (s[i] - '0' == b && fa && !fb)
            fb = 1;
        else if (s[i] - '0' == c && fb && !fc)
            fc = 1;
        if (fc)
            break;
    }
    return fc;
}
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n; string s;
    cin >> n >> s;
    int ans = 0;
    for (int i = 0; i < 10; ++i)
        for (int j = 0; j < 10; ++j)
            for (int k = 0; k < 10; ++k)
                if (find(i, j, k, s))
                    ++ans;
    cout << ans << '\n';
}

Measured memory_bytes: 512
N, K = map(int,input().split())
x = list(map(int,input().split()))

res = 1e9+7
for l, r in zip(x,x[K-1:]):
  tmp = r - l
  if(abs(l) < abs(r)):
    tmp += abs(l)
  else:
    tmp += abs(r)
  if(res > tmp):
    res = tmp
print(res)

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

int main(){
    int n;
    cin>>n;
    if(n==1) puts("0");
    else {
        int ans=n/2;
        if(n&1) printf("%d\n",ans);
        else printf ("%d\n",ans-1);
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long int
#define endl '\n'
#define pb push_back
#define mod 1000000007
#define db(i) cout<<i<<" ";
#define db1(i) cout<<"("<<i<<")";
#define db2(i) cout<<"["<<i<<"]";
#define db3(i) cout<<"{"<<i<<"}";
#define ff first 
#define ss second
#define vv vector
#define pp pair
#define pi acos(-1);
#define printarr(a,n) cout<<"[";for(int i=0;i<n;i++){db1(a[i]);}cout<<"]";

using namespace std;

bool isprime(int n)
{
    for(int i=2;i<=sqrt(n);i++)
        if(n%i==0)
        return false;
    return true;
}
int maxarr(int *a,int n)
{
    int val=a[0];
    for(int i=1;i<n;i++)
    {
        if(val<a[i])
        {
            val=a[i];
        }
    }
    return val;
}

int minarr(int *a,int n)
{
    int val=a[0];
    for(int i=1;i<n;i++)
    {
        if(val>a[i])
        {
            val=a[i];
        }
    }
    return val;
}


int gcd(int a, int b) 
{ 
    if (b == 0) 
        return a; 
    return gcd(b, a % b);  
} 
int power(int x, int y, unsigned int p=ULLONG_MAX)  
{  
    int res = 1;     
    x = x % p; 
    if (x == 0) 
      return 0; 
    while (y > 0)  
    {    
        if (y & 1)  
           res = (res*x) % p;  
        y = y>>1; 
        x = (x*x) % p;  
    }  
    return res;  
}
bool cmp(const pair<int,int> &a,const pair<int,int> &b)
{
    if(a.ss<b.ss)
        return true;
    else if(a.ss>b.ss)
        return false;
    else
    {
        if(a.ff<b.ff)
            return true;
        else
            return false;
    }
    
}
bool cmp1(const pair<int,int> &a,const pair<int,int> &b)
{
    return (a.ss<b.ss);
}


//if no test cases add coments for reading




signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1;
    //cin>>t;
    while(t--)
    {
        int x,y;
      cin>>x>>y;
      if(y%2==0)
      {
          if(x<=y/2&&y/2<=2*x)
          {
              cout<<"Yes"<<endl;
          }
          else
          {
              cout<<"No"<<endl;
          }
      }
      else
      {
          cout<<"No"<<endl;
      }
        
     
      
    }
   
}


Measured memory_bytes: 3668
def main():
	N, M = map(int, input().split())
	H = list(map(int, input().split()))
	Height = []
	Good = []
	for i in range(N):
	    Height.append(H[i])
	    Good.append(0)
	for i in range(M):
	    A, B = map(int, input().split())
	    if Height[A - 1] < Height[B - 1]:
	        Good[A - 1] = 1
	    elif Height[A - 1] > Height[B - 1]:
	        Good[B - 1] = 1
	    else:
	        Good[A - 1] = 1
	        Good[B - 1] = 1
	n = 0
	for i in range(N):
	    if Good[i] == 0:
	        n += 1
	print(n)

if __name__ == '__main__':
 	main()

Measured memory_bytes: 89376
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll INF = ll(1e18)+5;

int main() {
    ll N,M;
    cin >> N >> M;
    vector<ll> c(M);
    vector<ll> a(M);
    for(int i=0;i<M;i++){
        int b;
        cin >> a[i] >>b;
        ll val =0;
        for(int j=0;j<b;j++){
            int t;
            cin >>t;
            --t;
            val |= (1<<t);
        }
        c[i] = val;
    }
    ll dp[M+1][1<<N];
    for(int i=0;i<(1<<N);i++){
        for(int j=0;j<M+1;j++){
            dp[j][i] = INF;
        }
    }
    dp[0][0] = 0;
    for(int i=0;i<M;i++)for(int j=0;j<(1<<N);j++){
        // cerr <<"i="<<i <<"c[i]=" <<bitset<8>(c[i]) <<" j=" << bitset<8>(j) << endl;
        dp[i+1][j|c[i]] = min(dp[i+1][j|c[i]],dp[i][j]+a[i] );
        dp[i+1][j] = min(dp[i+1][j],dp[i][j]);
        // cerr <<"dp[i+1][j|c[i]]=" << dp[i+1][j|c[i]] << endl;
    }
    if(dp[M][(1<<N)-1] == INF){
        dp[M][(1<<N)-1] = -1;
    }
    cout << dp[M][(1<<N)-1] << endl;

    return 0;
}

Measured memory_bytes: 35664
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
int main(void){
    string s;
    cin>>s;
    ll co0[2]={0},na[2]={0};
    rep(0,i,s.length()){
        string s0=s.substr(i,1);
        if(i%2==0){
            ++na[0];
            if(s0=="0")++co0[0];
        }else if(i%2==1){
            ++na[1];
            if(s0=="0")++co0[1];
        }
    }
    cout<<min(co0[0]+na[1]-co0[1],na[0]-co0[0]+co0[1])<<endl;
}

Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

const int MaxN = 3000 + 5;

int N;
double P[MaxN];
double dp[MaxN][MaxN];

void init() {
  scanf("%d", &N);
  for (int i = 1; i <= N; ++i) scanf("%lf", &P[i]);
}

void solve() {
  dp[0][0] = 1;
  for (int i = 1; i <= N; ++i) for (int j = 0; j <= i; ++j) {
    if (j != i) dp[i][j] += dp[i - 1][j] * (1 - P[i]);
    if (j != 0) dp[i][j] += dp[i - 1][j - 1] * P[i];
  }

  double ans = 0;
  for (int i = N / 2 + 1; i <= N; ++i)
    ans += dp[N][i];
  printf("%.10lf\n", ans);
}

int main() {
  init();
  solve();
  return 0;
}

Measured memory_bytes: 68992
#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;

int h, w;
string s[505];
int d[4] = {0, 1, 0, -1};
bool memo[405][405] = {0};

long long solve();

int main() {
  cin >> h >> w;
  for(int i = 0; i < h; ++i) cin >> s[i];
  cout << solve() << endl;
  return 0;
}

long long solve() {
  long long ans = 0;
  for(int i = 0; i < h; ++i)
    for(int j = 0; j < w; ++j)
      if(s[i][j] == '#' && !memo[i][j]) {
        long long b = 1, wh = 0;
        queue<pair<int, int>> qu;
        qu.push(make_pair(i, j));
        memo[i][j] = 1;
        while(qu.size() > 0) {
          pair<int, int> now = qu.front();
          qu.pop();
          for(int k = 0; k < 4; ++k) {
            int nextx = now.fi + d[k],
                nexty = now.se + d[1 ^ k];
            if(nextx < 0 || nextx >= h || nexty < 0 ||
               nexty >= w)
              continue;
            if(!memo[nextx][nexty] &&
               s[now.fi][now.se] != s[nextx][nexty]) {
              if(s[nextx][nexty] == '#')
                ++b;
              else
                ++wh;
              memo[nextx][nexty] = 1;
              qu.push(make_pair(nextx, nexty));
            }
          }
        }
        ans += b * wh;
      }
  return ans;
}

Measured memory_bytes: 640
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<climits>//long long型の最大値(LLONG_MAX)など
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)

int main() {
    ll N;
    cin >> N;
    vector<pair<ll,ll>> A(N);

    REP(i,N){
        A[i].second = i+1;
        cin >> A[i].first;
    }

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

    REP(i,N){
        cout << A[i].second << " ";
    }
    cout << endl;
}


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

typedef long long ll;

int main(){
  
  ll mod = 1000000000 + 7;
  ll N, M;
  cin >> N >> M;
  vector<ll> ans(N+1,0);
  
  for(int i = 0; i < M; i++){
    ll tmp;
    cin >> tmp;
    ans[tmp] = -1;
  }
  
  ans[0] = 1;
  for(int i = 0; i < N; i++){
    if(ans[i] == -1) continue;
    if(ans[i+1] != -1 && i+1 <= N) ans[i+1] += ans[i]%mod;
    if(ans[i+2] != -1 && i+2 <= N) ans[i+2] += ans[i]%mod;
  }
  
  cout << ans[N]%mod << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
void amin(int &a, const int &b) {
	a = min(a, b);
}
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N, A, B;
	cin >> N >> A >> B;
	vector<int> P(N);
	vector<int> rev(N);
	int res = 0;
	for (int i = 0; i < N; i++) {
		cin >> P[i]; P[i]--;
		rev[P[i]] = i;
	}
	int INF = (int)1 << 60;
	vector<vector<int> > dp(N + 1, vector<int>(N + 1, INF));

	dp[0][0] = 0;

	for (int i = 0; i <= N; i++) {
		for (int j = 0; j <= N; j++) {
			if (dp[i][j] < INF) {
				if (i < N) {
					if (P[i] < j) {
						amin(dp[i + 1][j], dp[i][j]);
					}
					else {
						amin(dp[i + 1][j], dp[i][j] + A);
					}
				}
				if (j < N) {
					if (rev[j] <= i) {
						amin(dp[i][j + 1], dp[i][j]);
					}
					else {
						amin(dp[i][j + 1], dp[i][j] + B);
					}
				}
			}
		}
	}


	cout << dp[N][N] << endl;
}

Measured memory_bytes: 195968
#include<iostream>
#include<iomanip>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<cstring>
#include<sstream>
using namespace std;
 
#define P(p) cout<<(p)<<endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort(v.begin(), v.end());
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return
#define C(i) cin>>i
#define C2(i,j) cin>>i>>j
#define C3(i,j,k) cin>>i>>j>>k
#define C4(i,j,k,m) cin>>i>>j>>k>>m
////////////////////////////////////////////////////////////

int main(){
	const int MAX_N = 100 , MAX_S = 100;
	int n;
	cin >> n;
	
	vector<int> v(n);
	rep(i,0,n)
		cin >> v[i];	
	
	bool dp[MAX_N+1][MAX_N * MAX_S + 2] = {};
	dp[1][0] = 1;
	dp[1][v[0]] = 1;
	
	rep(i,1,n){
		rep(j,0,MAX_N * MAX_S + 1){
			if(!dp[i][j])
				continue;
			

			dp[i+1][j+v[i]] = 1;
			dp[i+1][j] = 1;
		}
	}
	
	int ans = 0;
	rep(j,0,MAX_N * MAX_S + 1){
		if(dp[n][j]){
			if(j % 10 == 0 )
				continue;
			
			ans = max( j , ans );
		}
	}
	P(ans);
	ret 0;
}

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

int main(){
  int N,D;
  cin >> N >> D;
  if (N % (2*D + 1) == 0){
  cout << N / (2*D + 1);
  }else{
  cout << 1 + N / (2*D + 1);
  }
  
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
#include <cstdlib> //絶対値 abs()
using namespace std;


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

	int ans = 0;

	if(n<k){
		ans = n*x;
	}

	else{
		ans = k*x+(n-k)*y;
	}

	cout << ans << endl;


}

Measured memory_bytes: 256
import numpy as np

n = int(input())
t, a = [int(x) for x in input().split()]
candidates = [int(x) for x in input().split()]

temperatures = [t - c*0.006 for c in candidates]
temp_diff = [abs(a - t) for t in temperatures]
print(np.argmin(temp_diff)+1)

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

int main(void) {
    int K, N;
    cin >> K >> N;
    vector< int > A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    sort(A.begin(), A.end());
    vector< int > B(N + 1);
    for (int i = 0; i < N - 1; i++) {
        B[i] = A[i + 1] - A[i];
    }
    B[N - 1] = K + A[0] - A[N - 1];
    sort(B.begin(), B.end());
    long long ans = 0;
    for (int i = 0; i < N; i++) {
        ans += (long long)B[i];
    }
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 1792
#include "bits/stdc++.h"

using namespace std;
typedef long long int ll;
typedef pair<ll, ll > pi;  
typedef pair<pair<ll, ll >, ll > pii;  
vector<ll > vec;
vector<vector<ll > > vec2;
ll MOD = 1000000007;
ll INF = 11451419194545;

//階乗
vector<ll>fact;
//逆元
vector<ll>inv;
//逆元階乗
vector<ll>finv;

//拡張ユークリッドの互除法
pii extgcd(ll a, ll b){
    //前提：aとbが互いに素であること．
    pii x(make_pair(1,0), a);
    pii y(make_pair(0,1), b);

    ll div = 0;

    //終了条件:(GCD(a,b), 0)または(0,GCD(a,b))
    while(true){
        if(y.second == 0) return x;
        
        div = x.second / y.second;
        x.second = x.second  - div * y.second;
        x.first.first = x.first.first - div * y.first.first;
        x.first.second = x.first.second - div * y.first.second;

        if(x.second == 0) return y;

        div = y.second / x.second;
        y.second = y.second - div * x.second;
        y.first.first = y.first.first - div * x.first.first;
        y.first.second = y.first.second - div * x.first.second;
    }
}

//逆元
ll modinv(ll a, ll m = MOD){
    //前提：aとmが互いに素であること．
    pii ans;
    ans = extgcd(a, m);

    ll invNum = 0;
    invNum = ans.first.first;
    invNum %= m;
    //C++特有の剰余がマイナスになってしまう対策
    if(invNum < 0) invNum += m;

    return invNum;
}

//割り算MOD
ll warizan_mod(ll warareru, ll waru, ll m = MOD){
    //割られる数に逆元をかけるだけ
    warareru %= m;
    return warareru * modinv(waru, m) % m;
}

void combination(ll num, ll m = MOD){
    fact.assign(num + 1919, 0);
    finv.assign(num + 1919, 0);
    inv.assign(num  + 1919, 0);

    //初期化
    fact[0] = 1;
    finv[0] = 1;
    inv[0] = 1;
    //テーブルに列挙
    for(ll i = 1; i < fact.size(); i++){
        fact[i] = fact[i - 1] * i % m;
        inv[i]  = modinv(fact[i]);
    }
}

//二項係数
ll nCk(ll n, ll k, ll m = MOD){
    if(n < 0 || k < 0 || n < k) return 0;
    return fact[n] * (inv[k] * inv[n - k] % m) % m;
}


int main(){
 
    ll X, Y;
    cin >> X >> Y;
    
    //x方向の動き(1,2)をa y方向の動き(2,1)をbとする
    //するとXとYはa+2b=Xと2a+b=Yで表すことができる
    //aとbの合計がXとYにたどり着くまでの移動回数

    //1回毎に移動距離は3なのでX＋Yが3の倍数ではなかったら求めることはできない
    if((X + Y) % 3 != 0){
        cout << 0 << endl;
        return 0;
    }

    //ここで割り切れるならX/3とY/3がx方向とy方向へのそれぞれの移動回数
    ll A = X - (X + Y) / 3;
    ll B = Y - (X + Y) / 3;

    if(A < 0 || B < 0){
        cout << 0 << endl;
        return 0;        
    }
    if(A < B) swap(A, B);
    combination(A + B);
    //cout << nCk(X, Y) << endl; 
    cout << nCk(A + B, A) << endl; 



}

Measured memory_bytes: 15872
N = int(input())
W = [list(map(int, input().split())) for n in range(N)]
W.sort(key=lambda l: l[1])

def f():
    now = 0
    for p, t in W:
        now += p
        if now > t:
            return False
    return True

print("Yes" if f() else "No")


Measured memory_bytes: 53660
#include "iostream"
#include "iomanip"
using namespace std;

long double X;
long double rad;
long double ans;

int main() {
	cin >> X >> rad;
	if ((long long int)X % 2 == 0) {
		for (int i = 0; i < 10000000; i++) {
			ans = (ans + X - rad / 100 * ans + (100.0 - rad) / 100 * ans) / 2;
		}
	}
	else {
		for (int i = 0; i < 10000000; i++) {
			ans = (ans+1 + X - rad / 100 * ans + (100.0 - rad) / 100 * ans) / 2;
		}
	}
	cout << setprecision(15) << ans<<"\n";
	return 0;
}

Measured memory_bytes: 384
a, b, c, x, y = map(int, input().split())

sum1 = a * x + b * y

if x > y:
    sum2 = c * 2 * y + a * (x-y)
if x == y:
    sum2 = c * 2 * x
if x < y:
    sum2 = c * 2 * x + b * (y-x)

sum3 = c * 2 * max(x, y)

print(min(sum1, sum2, sum3))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using u32 = uint32_t;
using vi = vector<int>;    using vvi = vector<vi>;
using vb = vector<bool>;   using vvb = vector<vb>;
using vl = vector<ll>;     using vvl = vector<vl>;
using vd = vector<double>; using vvd = vector<vd>;

#define REP(i,n) for(auto i = 0 * (n), i##_len = (n); i < i##_len; ++i)
#define ALL(c) (c).begin(), (c).end()
#define FOR(i,s,n) for(ll i=s, i##_len=(ll)(n); i<i##_len; ++i)
#define TEN(x) ((ll)1e##x)
const ll mod = TEN(9) + 7;

int main() {
#ifdef INPUT_FROM_FILE
	ifstream cin("sample.in");
	ofstream cout("sample.out");
#endif
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(50);
	string s; cin >> s;
	bool c = 0;
	REP(i, s.size()) {
		if (s[i] == 'C') c = true;
		if (c && s[i] == 'F') {
			cout << "Yes" << endl;
			return 0;
		}
	}

	cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 384
import java.util.*;

public class Main{
	
	int INF = 1 << 24;
	
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			String [] input = sc.nextLine().split(" ");
			int size = Integer.parseInt(input[0]);
			int [] r = new int[input.length - 1];
			for(int i = 1; i < input.length; i++){
				r[i-1] = Integer.parseInt(input[i]) ;
			}
			int len = r.length;
			double [][] dp = new double[1 << len][len];
			for(int i = 0; i < (1 << len); i++){
				Arrays.fill(dp[i], INF);
			}
			for(int i = 0; i < len; i++){
				dp[1 << i][i] = r[i];
			}
			
			for(int i = 0; i < (1 << len); i++){
				for(int j = 0; j < len; j++){
					if(dp[i][j] == INF) continue;
					for(int k = 0; k < len;k++){
						if((i & (1 << k)) !=0 ) continue;
						int next = (i | (1 << k));
						int c = r[j] + r[k];
						int b = Math.abs(r[j] - r[k]);
						double a = Math.sqrt(c * c - b * b);
						double value = dp[i][j] + a;
						dp[next][k] = Math.min(dp[next][k], value);
					}
				}
			}
			
			double min = INF;
			int len2 = (1 << len) - 1;
			for(int i = 0 ; i < len ; i++){
				min = Math.min(min, dp[len2][i] + r[i]);
			}
			if(min <= size){
				System.out.println("OK");
			}
			else{
				System.out.println("NA");
			}
		}
	}

	private void debug(Object... o) { System.out.println("debug = " + Arrays.deepToString(o)); }

	public static void main(String[] args) {
		new Main().doit();
	}
}

Measured memory_bytes: 14000
import java.util.Scanner;

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

        int count = 0;
        for(int i = 1; i<N; i++) {
            for(int j = 1;j<N; j++) {
                if((i * j) < N) {
                    count++;
                } else {
                    break;
                }
            }
        }
        
        System.out.println(count);

    }
}

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

#define ll long long
#define ld long long
#define M 1000000007
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

int main() {
    fast;
	ll n, q;
    cin >> n >> q;
    string s;
    cin >> s;
    vector<ll> ct(n, 0);
    for (ll i = 1; i < n; i++) {
        ct[i] = ct[i-1];
        if (s[i-1] == 'A' && s[i] == 'C')
            ct[i]++;
    }
    ll l, r;
    while (q--) {
        cin >> l >> r;
        l--;
        r--;
        ll sub = 0;
        if (l > 0 && s[l] != 'C')
            sub = ct[l-1];
        else 
            sub = ct[l];
        cout << ct[r] - sub << endl;
    }
	return 0;
}


Measured memory_bytes: 1872
#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(false)
#define pdl cout << "*" << endl
#define MOD 1000000007
#define INF 1000000000
#define INFLL 1000000000000000000ll
#define pb push_back
#define ff first
#define ss second
#define long int64_t
using namespace std;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
uniform_int_distribution<> dis(0, INF<<1);
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1> void __f(const char* name, Arg1&& arg1){ cerr << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args> void __f(const char* names, Arg1&& arg1, Args&&... args)
{ const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma+1, args...); }

int main()
{
	fio;
	long ans = 0, n;
	cin >> n;
	for(long i=1; i*i<=n; i++)
		if(n % i == 0 and n/i - 1 > i)
			ans += n/i - 1;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-

"""
・ダイクストラ(優先度付きキュー)
"""

from heapq import heappop, heappush

# 今回はダイクストラするので、データの持ち方は隣接リスト
N = int(input())
nodes = [[] for _ in range(N+1)]
for i in range(N-1):
    a, b, c = map(int, input().split())
    # nodes[出発ノード](到着ノード, コスト))
    nodes[a].append((b, c))
    # 無向グラフなのでこっちも入れる
    nodes[b].append((a, c))

def dijkstra(nodes, start):
    # 最短距離メモ
    memo = [float('inf')] * (len(nodes))
    # スタート位置
    que = [(0, start)]
    memo[start] = 0
    # キューが空になるまで
    while len(que) != 0:
        # startからの距離, 現在のノード
        dist, cur = heappop(que)
        # 出発ノードcurの到着ノードでループ
        for i in range(len(nodes[cur])):
            nxt, cost = nodes[cur][i]
            # 今回の経路のが短い時
            if memo[cur] + cost < memo[nxt]:
                memo[nxt] = memo[cur] + cost
                # 現在の移動距離をキューの優先度として、早い方から先に処理するようにする
                heappush(que, (memo[nxt], nxt))
    # ノードstartからの最短距離リストを返却
    return memo

Q, K = map(int, input().split())
# 引数：(ノードの隣接リスト, 出発ノード)
memo = dijkstra(nodes, K)

for i in range(Q):
    x, y = map(int, input().split())
    # 今回は全てKを経由するので、Kからの距離さえ分かれば全部出る
    print(memo[x] + memo[y])


Measured memory_bytes: 93792
import java.util.Scanner;

public class Main {

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

		int n = sc.nextInt();
		int [] a = new int [n];
		for (int i = 0;i < n;i++){
			a[i] = sc.nextInt();
		}
		int count = 0;
		int max = 0;
		sc.close();

		for(int i = 0;i < n-1;i++){
				if(a[i] >= a[i+1]){
					count++;
					if(max < count){
						max = count;
					}
				}else {
				count = 0;
			}
		}
System.out.println(max);
	}
}


Measured memory_bytes: 52612
#include<bits/stdc++.h>
#define debug(x) cerr << #x << " = " << x << "\n";
#define debug_v(x) cerr << #x << " ="; for(auto it : x) {cerr << " [" <<  it << "]";} cerr << "\n";
using namespace std;
using ll = long long;
using ld = long double;
const double PI = acos(-1);
const int mod = 1e9 + 7;
const int inf = 1e9 + 100;
const ll inf64 = 1e18 + 100;
void add_self(ll& a, ll b){
	a += b;
	if(a >= mod){
		a -= mod;
	}
}
void mult_self(ll& a, ll b){
	a *= b;
	a %= mod;
}
int n;
vector<vector<ll>>graph;
vector<vector<ll>> dp;
void dfs(ll a, ll parent){
	ll white = 1;
	ll black = 1;
	for(auto x : graph[a]){
		if(x != parent){
			dfs(x, a);
			mult_self(black, dp[x][0]);
			ll sum = dp[x][1] + dp[x][0];
			if(sum >= mod){
				sum -= mod;
			}
			mult_self(white, sum);
		}
	}
	add_self(dp[a][0], white);
	add_self(dp[a][1], black);

}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cout << fixed << setprecision(20);
	cin >> n;
	graph.resize(n);
	dp.resize(n, vector<ll>(2));
	for (int i = 0; i < n - 1; i++){
		int u, v;
		cin >> u >> v;
		u--;
		v--;
		graph[u].push_back(v);
		graph[v].push_back(u);
	}
	dfs(0, -1);
	//~ for (int i = 0; i < n; i++){
		//~ for(int j = 0;j < 2;j++){
			//~ cerr << "dp[" << i + 1 << "][" << j << "] = " << dp[i][j] << '\n';
		//~ }
	//~ }
	ll answer = dp[0][0] + dp[0][1];
	if(answer >= mod){
		answer -= mod;
	}
	cout << answer << '\n';
	return 0;
}


Measured memory_bytes: 19584
#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
using namespace std;
const long long inf=0x3f3f3f3f;
const long long Maxn=200000+10;
const long long mod=1000000000+7;
long long a[Maxn],s[Maxn],tot;
long long n,ans;
int main()
{
	scanf("%lld",&n);
	for(long long i=1;i<=n;++i)
	{
		scanf("%lld",a+i);
		s[i]=(s[i-1]+a[i])%mod;
	}
	for(long long i=1;i<=n;++i)
	ans=(ans+(a[i]*s[i-1])%mod)%mod;
	printf("%lld\n",ans);
	return 0;
}

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

typedef long long LL;
const int MAXN=2005;
const double eps=1e-7;

int n,m;
vector<pair<int,int>> f;
vector<int> edge[MAXN];
int dep[MAXN];

void dfs(int u,int fa){
    for(int i=0;i<edge[u].size();i++){
        int v=edge[u][i];
        if (v==fa) continue;
        dep[v]=dep[u]+1;
        dfs(v,u);
    }
}

int main(){
    scanf("%d%d",&n,&m);
    for(int i=1;i<n;i++){
        int a,b; scanf("%d%d",&a,&b);
        edge[a].push_back(b);
        edge[b].push_back(a);
        f.push_back(make_pair(a,b));
    }
    int ans=n;
    if (m%2==0){
        for(int i=1;i<=n;i++){
            dep[i]=0; dfs(i,0);
            int cnt=0;
            for(int j=1;j<=n;j++){
                if (dep[j]>m/2) cnt++;
            }
            ans=min(ans,cnt);
        }
    } else{
        for(int i=0;i<n-1;i++){
            int a=f[i].first,b=f[i].second;
            dep[a]=0; dfs(a,b);
            dep[b]=0; dfs(b,a);
            int cnt=0;
            for(int j=1;j<=n;j++){
                if (dep[j]>m/2) cnt++;
            }
            ans=min(ans,cnt);
        }
    }
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef long  l;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
const int INF=1000000001;
const double PI=3.141592653589;

int dp[100005];

int main(){
  int n; cin>>n;
  string s; cin>>s;

  int r=0;
  int l=0;
  for(int i=0;i<n;i++){
    if(s[i]=='E')
    r++;
  }
  int ans=INF;
  for(int i=0;i<n;i++){
    if(s[i]=='E'){
      ans=min(ans,l+(r-1));
      r--;
    }
    else{
      ans=min(ans,l+r);
      l++;
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 900
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
N = [i + 1for i in range(N)]

import itertools

P_num = 0
Q_num = 0

for num, i in enumerate(itertools.permutations(N)):
    if P == i:
        P_num = num
        
    if Q == i:
        Q_num = num
        
print(abs(P_num-Q_num))

Measured memory_bytes: 9112
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define p(s) cout<<(s)<<endl
#define REP(i,n,N) for(int i=n;i<N;i++)
#define RREP(i,n,N) for(int i=N-1;i>=n;i--)
#define CK(n,a,b) ((a)<=(n)&&(n)<(b))
#define F first
#define S second
typedef long long ll;
using namespace std;
const int inf = 1e9;

int H, W;
string s[60];
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int main(){
    cin>>H>>W;
    REP(i,0,H){
        cin>>s[i];
    }
    REP(i,0,H){
        REP(j,0,W){
            if(s[i][j]=='.') continue;
            bool flag=false;
            REP(k,0,4){

                if(CK(i+dy[k],0,H)&&CK(j+dx[k],0,W)){
                    if(s[i+dy[k]][j+dx[k]]=='#') {
                        flag=true;
                    }
                }

            }
            if(!flag){
                p("No");
                return 0;
            }
        }
    }
    p("Yes");

}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#define N 100
#define white 0
#define gray 1
#define black 2
int n; int INF = (int)INFINITY;
int A[N][N], d[N], color[N], p[N];

void dijkstra(int s) {
  int u, mincost, i;
  for ( int i = 0; i < n; ++i ) {
    color[i] = white;
    d[i] = INF;
    p[i] = -1;
  }
  d[s] = 0;

  while ( 1 ) {
    mincost = INF;
    for ( int i = 0; i < n; ++i ) {
      if ( color[i] != black && d[i] < mincost ) {
        mincost = d[i];
        u = i;
      }
    }
    if ( mincost == INF ) break;

    color[u] = black;

    for ( int v = 0; v < n; ++v ) {
      if ( color[v] != black && A[u][v] != INF ) {
        if ( d[u] + A[u][v] < d[v] ) {
          d[v] = d[u] + A[u][v];
          p[v] = u;
          color[v] = gray;
        }
      }
    }
  }
}

void print(void) {
  for ( int i = 0; i < n; ++i ) {
    printf("%d %d", i, d[i]);
    putchar('\n');
  }
}

int main() {
  int u, k, v, c;
  scanf("%d", &n);
  for ( int i = 0; i < n; ++i ) {
    for ( int j = 0; j < n; ++j ) {
      A[i][j] = INF;
    }
  }
  for ( int i = 0; i < n; ++i ) {
    scanf("%d%d", &u, &k);
    for ( int j = 0; j < k; ++j ) {
      scanf("%d%d", &v, &c);
      A[u][v] = c;
    }
  }
  dijkstra(0);
  print();
  return 0;
}



Measured memory_bytes: 1928
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>

using  ll = long long;
using ull = unsigned long long;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};
constexpr ll kINF = 1152921504606846976;//2^60
constexpr double kEPS = 1e-6;

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define rep(i,n) REP(i,n)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep(i,n) RREP(i,n)
#define mp make_pair
#define fi first
#define sc second

ll N,W;
ll w[110],v[110],dp[110][100010];

template<class T> bool chmax (T &a, const T b) {if (a < b) {a = b; return true;}return false;}
template<class T> bool chmin (T &a, const T b) {if (a > b) {a = b; return true;}return false;}

int main(void) {
  cin >> N >> W;
  rep(i,N) cin >> w[i] >> v[i];

  ll V = N * 1000;

  rep(i,N + 1) {
    rep(j,V+1) {
      dp[i][j] = kINF;
    }
  }

  dp[0][0] = 0;

  rep (i,N) {
    rep(j,V+1) {
      chmin(dp[i+1][j], dp[i][j]);
      if (j + v[i] <= V) chmin(dp[i+1][j+v[i]], dp[i][j]+w[i]);
    }
  }

  ll ans = 0;
  rep (i,N+1) {
    rep(j,V+1) {
      if (dp[i][j] <= W) chmax<ll>(ans, j);
    }
  }

  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 80256
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int h,m,ss,s;
		s=sc.nextInt();
		ss=(s%3600)%60;
		h=s/3600;
		m=(s%3600)/60;
		System.out.println(h+":"+m+":"+ss);
		sc.close();		
 }
}


Measured memory_bytes: 26292
#include<cstdio>
using namespace std;
const int maxn=2e5+10;
const int N=1e6+10;
typedef long long ll;
const ll mod=1e9+7;
#define per(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define inf 0x3f3f3f3f
#define qwq puts("QWQ");
#define qaq puts("QAQ");
#define mem(a,b) memset(a,b,sizeof(a))
#define mid ((l+r)>>1)
#define l(x) x<<1
#define r(x) x<<1|1
#define lson rt<<1,l,mid
#define rson rt<<1|1,mid+1,r
void read(int &x)
{
	int f=1;x=0;
	char s=getchar();
	while(s<'0'||s>'9')
    {
    	if(s=='-')f=-1;
    	s=getchar();
	}
	while(s>='0'&&s<='9')x=x*10+s-'0',s=getchar();
	x*=f;
}
int main()
{
	int a,b;
	read(a),read(b);
	if(a<b)puts("0");
	else puts("10"); 
}

Measured memory_bytes: 256
n = int(input())
ans = 0
tmp = 0

arr = [ list(map(int,input().split())) for i in range(2)]
for i in range(n):
    if i == 0:
        tmp += arr[0][0]
    else:
        tmp += sum(arr[0][:i+1])
    tmp += sum(arr[1][i:n])
    if ans < tmp:
        ans = tmp
    tmp = 0
print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <string>
using namespace std;
int main() {
    string n;
    cin >> n;
    if(n[0] == n[1] && n[0] == n[2]) {
        cout << "Yes" << endl;
    }
    else if(n[1] == n[2] && n[1] == n[3]) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#![allow(unused)]

use proconio::{input, fastout};
use proconio::marker::{Chars, Usize1};

macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input! {
        n: usize,
        mut xs: [usize; n],
    }

    xs.sort_unstable();
    let xmax = *xs.last().unwrap();
    let mut divisible = vec![false; xmax + 1];
    let mut ans = 0;
    for i in 0..n {
        let x = xs[i];
        if divisible[x] {
            continue;
        }
        if i + 1 >= n || xs[i + 1] != x {
            ans += 1;
        }

        for m in 1.. {
            if x * m > xmax {
                break;
            }
            divisible[x * m] = true;
        }
    }

    println!("{}", ans);
}



Measured memory_bytes: 5916
import scala.util.control.Breaks

object Main extends App {
  val b = new Breaks
  var flag = false
  val str1 = readLine
  val str2 = readLine
  if (str1.length > str2.length) {
    println("GREATER")
    flag = true
  }
  if (str1.length < str2.length) {
    println("LESS")
    flag = true
  }
  if (!flag) {
    b.breakable {
      for (i <- 0 to str1.length - 1) {
        if (str1(i) > str2(i)) {
          println("GREATER")
          b.break
        }
        else if (str1(i) < str2(i)) {
          println("LESS")
          b.break
        }
        if (str1(i) == str2(i) && i == str1.length - 1) {
          println("EQUAL")
        }
      }
    }
  }
}

Measured memory_bytes: 25528
N,M = map(int,input().split())
H = list(map(int,input().split()))
AB = [tuple(map(int,input().split())) for i in range(M)]
ans=0
es = [[] for _ in range(N)]
for a,b in AB:
    a,b = a-1,b-1
    es[a].append(b)
    es[b].append(a)
for i in range(N):
    for j in es[i]:
        if H[j]>=H[i]:
            break
    else:
        ans+=1


print(ans)

Measured memory_bytes: 42764
#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define rep(i,n) REP(i,n);
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep(i,n) RREP(i,n)
#define mp make_pair
#define fi first
#define sc second
string s;
vector<string> ans;

void solve(string s,char z,char y) {
	if(z == 'a') {
		ans.pb(s);
		return;
	}

	bool f1 = false,f2 = false;
	for(auto c : s) {
		if(c == z) {
			f1 = true;
		}
		if(c == y){
			f2 = true;
		}

		if(f1 && !f2)
			return;
	}

	if(!f1){
		solve(s,z-1,y-1);

		REP(i,s.size()) {
			if(s[i] == y) {
				s[i] = z;
				solve(s,z-1,y-1);
				s[i] = y;
			}
		}
	}else {
		int i = 0;
		while(s[i] != z) {
			if(s[i] == y) {
				s[i] = z;
				solve(s,z-1,y-1);
				s[i] = y;
			}
			i++;
		}
	}
}

int main(){
	while(true) {
		cin >> s;
		if(s == "#")
			break;
		ans.clear();
		solve(s,'z','y');
		sort(ans.begin(),ans.end());
		cout << ans.size() << endl;
		if(ans .size() <= 10)
			REP(i,ans.size())
				cout << ans[i] << endl;
		else {
			REP(i,5)
				cout << ans[i] << endl;
			REP(i,5) {
				cout << ans[ans.size() + i - 5] << endl;
			}
		}
	}
	return 0;
}



Measured memory_bytes: 4232
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0);
  int n;
  cin>>n;
  int a[n];
  for (int i=0; i<n; i++) {
    cin>>a[i];
  }
  sort(a,a+n);
  int N=a[n-1],R=a[0];
  double half=N/2.0,diff=fabs(a[0]-half);
  for (int i=1; i<n; i++) {
    if (N==a[i]) {
      continue;
    }
    if (diff>=fabs(a[i]-half)) {
      diff=fabs(a[i]-half); R=a[i];
    }
  }
  cout<<N<<" "<<R<<endl;
  return 0;
}

Measured memory_bytes: 640
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		List<int>[] E = new List<int>[N];
		for(int i=0;i<N;i++) E[i] = new List<int>();
		for(int i=0;i<M;i++){
			E[A[i]-1].Add(B[i]-1);
			E[B[i]-1].Add(A[i]-1);
		}
		
		bool[] used = new bool[N];
		int a = A[0] - 1;
		int b = B[0] - 1;
		
		var L = new LinkedList<int>();
		
		int l = a;
		used[b] = true;
		while(!used[l]){
			L.AddLast(l);
			used[l] = true;
			foreach(var nxt in E[l]){
				if(!used[nxt]){
					l = nxt;
					break;
				}
			}
		}
		
		int r = b;
		used[r] = false;
		while(!used[r]){
			L.AddFirst(r);
			used[r] = true;
			foreach(var nxt in E[r]){
				if(!used[nxt]){
					r = nxt;
					break;
				}
			}
		}
		
		var ans = L.ToList();
		Console.WriteLine(ans.Count);
		Console.WriteLine(String.Join(" ",ans.Select(n => n + 1)));
		
		
	}
	int N,M;
	int[] A,B;
	public Sol(){
		var d = ria();
		N = d[0];
		M = d[1];
		A = new int[M];
		B = new int[M];
		for(int i=0;i<M;i++){
			d = ria();
			A[i] = d[0]; B[i] = d[1];
		}
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 37188
from collections import deque

# グラフに辺を追加する
def addEdge(adjL, vFr, vTo, cap):
    adjL[vFr].append([vTo, cap, len(adjL[vTo])])
    adjL[vTo].append([vFr, 0, len(adjL[vFr]) - 1]) # 逆辺


# Edmonds-Karp法（最大フローを求める）
def Edmonds_Karp(adjL, vSt, vEn):

    # 残余グラフの始点から終点までの経路（増加パス）を、BFSで探索する
    def BFS(vSt, vEn):
        prev = [-1] * numV
        prev[vSt] = None
        iE = [-1] * numV
        df = 0
        Q = deque([(vSt, float('inf'))])
        while Q:
            vNow, fNow = Q.popleft()
            if vNow == vEn:
                # 終点に到達したら、ループを抜ける
                df = fNow
                break

            for i, (v2, cap, iRev) in enumerate(adjL[vNow]):
                if prev[v2] == -1 and cap > 0:
                    # 未探索の頂点への辺の容量に空きがある場合、探索する
                    prev[v2] = vNow
                    iE[v2] = (i, iRev)
                    Q.append((v2, min(fNow, cap)))

        if df > 0:
            # 始点から終点までの経路を遡って、辺のフローを変更する
            vNow = vEn
            while vNow != vSt:
                v0 = prev[vNow]
                e, iRev = iE[vNow]
                adjL[v0][e][1] -= df
                adjL[vNow][iRev][1] += df
                vNow = v0

        # フローの増加量を返す
        return df


    numV = len(adjL)
    MaximumFlow = 0
    while True:
        # 残余グラフの始点から終点までの経路（増加パス）を、BFSで探索する
        df = BFS(vSt, vEn)

        if df == 0:
            # 経路が見つからない場合、最大フローの値を返す
            return MaximumFlow

        # フローを加算する
        MaximumFlow += df


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

adjList = [[] for v in range(N + 2)]
for i, A in enumerate(As, 1):
    if A <= 0:
        addEdge(adjList, 0, i, -A)
    else:
        addEdge(adjList, i, N + 1, A)

for i in range(1, N + 1):
    for j in range(2 * i, N + 1, i):
        addEdge(adjList, i, j, float('inf'))

# Edmonds-Karp法（最大フローを求める）
mf = Edmonds_Karp(adjList, 0, N + 1)
print(sum([A for A in As if A > 0]) - mf)


Measured memory_bytes: 3444
H, W, N = map(int, input().split())
Draw = [tuple(map(int, input().split())) for _ in range(N)]
from collections import defaultdict as dd
Sq =  dd(lambda:0) #3*3正方形を左上のマスの座標で区別。値は正方形内の黒塗りの個数
In = lambda x,y:[(x-i,y-j) for i in range(3) for j in range(3) if 0<=x-i<H-2 and 0<=y-j<W-2] #塗りつぶしたマスを含む正方形の座標のリストを返す関数
for a,b in Draw:
    for x,y in In(a-1,b-1): 
        Sq[x,y] += 1 #Sqの更新
Ans = [(H-2)*(W-2)-len(Sq)] + [sum(v==i for v in Sq.values()) for i in range(1,10)]         
for ans in Ans:
    print(ans)

Measured memory_bytes: 177836