akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#include<iomanip>
#include<cstring>
#define initdp(a,b) for(int i=0;i<=a;i++)for(int j=0;j<=b;j++)dp[i][j]=-1;
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define ll long long
#define pll pair<ll,ll>
#define rep(i,n) for(int i=0;i<n;i++)
#define repd(i,n) for(int i=n-1;i>=0;i--)
#define inf 1e9+1
#define inf1 1e18+1
#define mod 1000000007
#define pie 3.14159265358979323846
#define N 1000005
#define mid(l,r) l+(r-l)/2
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
void mad(ll &a,ll b){a=(a+b)%mod;if(a<0)a+=mod;}
ll gcd(ll a,ll b){ if(a>b)swap(a,b);if(!a)return b;return gcd(b%a,a);}
int a[100005];
void solve(){
	int n,k,q;
	cin>>n>>k>>q;
	for(int i=0;i<q;i++){
		int x;
		cin>>x;
		a[x]++;
	}
	for(int i=1;i<=n;i++){
		if(a[i]-q>-k)cout<<"Yes\n";
		else cout<<"No\n";
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t;
	//cin>>t;
	t=1;
	while(t--){
		solve();
	}
}

Measured memory_bytes: 1024
<?php
fscanf(STDIN, "%d %d %d %d", $H, $W, $A, $B);
$line1 = str_repeat("0", $A) . str_repeat("1", $W - $A);
$line2 = str_repeat("1", $A) . str_repeat("0", $W - $A);
for ($i = 0; $i < $H; $i++) {
    if ($i < $B) {
        echo $line1 . PHP_EOL;
    } else {
        echo $line2 . PHP_EOL;
    }
}


Measured memory_bytes: 5624
#https://atcoder.jp/contests/abc139/tasks/abc139_c

n = int(input())
h = [int(i) for i in input().split()]

cnt = []
if n!=1:
    a = []
    for i in range(n-1):
        a.append(h[i+1]-h[i])

    tmp=0
    for i in range(len(a)):
        if a[i] <= 0:
            tmp+=1
            if i == len(a)-1:
                cnt.append(tmp)
        else:
            cnt.append(tmp)
            tmp=0
else:
    cnt.append(0)

cnt.sort(reverse=True)

#print(a,cnt)
print(cnt[0])

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

int main(){
  char s[258] = {}, tmp[258] = {};
  int m, h, i, l;
  while(scanf("%s", s) && s[0] != '-'){
    scanf("%d", &m);
    while(m--){
      scanf("%d", &h);
      strcpy(tmp, s + h);
      s[h] = '\0';
      strcat(tmp, s);
      strcpy(s, tmp);
    }
    puts(s);
  }
  return 0;
}


Measured memory_bytes: 2096
#include<bits/stdc++.h>
#include<vector>
#include<string>
#include<map>
#include<stack>
#define int long long
using namespace std;
main()
{
	//freopen("input.txt","rt",stdin);
	string s,t;
	cin>>s>>t;
	s = t+s;
	cout<<s<<endl;
}

Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

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

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

fn abc(a: i32, b: i32) -> String {
    if a*b % 2 ==0 {
        return "No".to_string()
    }
    else {
        return "Yes".to_string()
    }
}

fn main() {
    /*
    assert_eq!(abc(), "Yes");
    assert_eq!(abc(101), "No");
    assert_eq!(abc(999999999), "Yes");
    */
    input!{
        a: i32,
        b: i32,
        
    }
    let result = abc(a, b);

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



Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll MOD=1e9+7;
bool isTriangle(ll x,ll y,ll z)
{
	return x+y>z&&x+z>y&&y+z>x;
}
void solve()
{
	ll n;
	cin>>n;
	vector<ll> a(n);
	for(ll i=0;i<n;i++)
	{
		cin>>a[i];
	}
	sort(a.begin(),a.end());
	ll cnt=0;
	for(ll i=0;i<n;i++)
	{
		for(ll j=i+1;j<n;j++)
		{
			for(ll k=j+1;k<n;k++)
			{
				if(a[i]==a[j]||a[j]==a[k]||a[i]==a[k]) continue;
				if(isTriangle(a[i],a[j],a[k]))
				{
					cnt++;
				}
			}
		}
	}
	cout<<cnt<<"\n";
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	solve();
	return 0;
}

Measured memory_bytes: 3660
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int x,y;
    for(int i = 0;;i++){
        cin>>x>>y;
        if(x > y){swap(x,y);}
        if(x == 0&&y == 0){break;}
        cout<<x<<" "<<y<<endl;
    }
}



Measured memory_bytes: 3040
using System;
using System.Linq;
using System.Collections.Generic;
class Program
{
    static void Main(string[] args)
    {
        int[] n = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        int N = n[0];
        int K = n[1];
        int[] l = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        Array.Sort(l);
        int sum = 0;
        for(int i = 0; i < K; i++)
        {
            sum += l[l.Length - 1 - i];
        }
        Console.WriteLine(sum);
    }
}


Measured memory_bytes: 13396
#include <bits/stdc++.h>
using namespace std;
long long getNc2(long long n){
    if(n<=1)return 0;
    return (n*(n-1)/2);
}
int main(){
    long long n;
    cin >> n;
    vector <long long> a(n);
    for(long long i = 0; i<n; i++){
        cin >> a[i];
        a[i]--;
    }
    vector <long long> cnt(n,0);
    for(long long i = 0; i<n; i++){
        cnt[a[i]]++;
    }
    #if 0
    for(long long i = 0; i<n; i++){
        cout << long long[i] << endl;
    }
    #endif
    vector <long long> nDeclimentC2(n,0);
    vector <long long> nC2(n,0);
    vector <long long> sumNDeclimentC2(n,0);
    vector <long long> sumNC2(n,0);
    for(long long i = 0; i<n; i++){
        nDeclimentC2[i]=getNc2(cnt[i]-1);
        nC2[i]=getNc2(cnt[i]);
        if(i==0){
            sumNDeclimentC2[i]=nDeclimentC2[i];
            sumNC2[i]=nC2[i];
        }else{
            sumNDeclimentC2[i]=sumNDeclimentC2[i-1]+nDeclimentC2[i];
            sumNC2[i]=sumNC2[i-1]+nC2[i];
        }
    }
    #if 0
    for(long long i = 0; i<n; i++){
        cout << nC2[i] << endl;
    }
    for(long long i = 0; i<n; i++){
        cout << nDeclimentC2[i] << endl;
    }
    #endif
    long long ans = 0;
    vector <long long> ansVector(n,-1);
    for(long long i = 0; i<n; i++){
        if(ansVector[a[i]]==-1){
            // for(long long j=0; j<n;j++){
            //     if(a[i]==j){
            //         ans+=nDeclimentC2[j];
            //     }else{
            //         ans+=nC2[j];
            //     }
            // }
            if(a[i]==0){
                ans = sumNDeclimentC2[0]+sumNC2[n-1]-sumNC2[0];
            }else if(a[i]==n-1){
                ans = sumNDeclimentC2[n-1]+sumNC2[n-2]-sumNDeclimentC2[n-2];
            }else{
                ans = sumNDeclimentC2[a[i]]
                        -sumNDeclimentC2[a[i]-1]
                        +sumNC2[a[i]-1]
                        +sumNC2[n-1]
                        -sumNC2[a[i]];
            }
            ansVector[a[i]]=ans;
        }else{
            ans = ansVector[a[i]];
        }
        cout << ans << endl;
        ans = 0;
    }
    return 0;
}

Measured memory_bytes: 13568
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <queue>

using namespace std;

void ABC118C()
{
	int N;
	cin >> N;
	vector<long long int> vals(N);
	for (auto& x : vals)
		cin >> x;
	sort(vals.begin(), vals.end());

	long long int LCD = vals[0];
	for (int i = 1; i < N; ++i)
	{
		auto x0 = max(LCD, vals[i]);
		auto x1 = min(LCD, vals[i]);
		while (x0 % x1 != 0)
		{
			long long int y = x0 - (x0 / x1) * x1;
			x0 = max(y, x1);
			x1 = min(y, x1);
		}
		LCD = x1;
	}
	cout << LCD << endl;
}

int main()
{
	ABC118C();
	return 0;
}

Measured memory_bytes: 1276
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cstring>
using namespace std;
char s[400005];
int zero = 0, n, ans[400005];
long long int mi(long long int n, long long int mo) {
	if (n == 0) return 1;
	if (n == 1) return 2%mo;
	long long int m = mi(n/2, mo);
	m = m * m % mo;
	if (n%2) m = m * 2 % mo;
	return m;
}
int ask(int k) {
	int ret = 0;
	while(k) {
		if (k%2) ret++;
		k /= 2;
	}
	return ret;
}
int main() {
	scanf("%d%s", &n, s);
	for (int i = 0; i < n; i++)
		if (s[i] == '1') zero++;
	if (zero == 0) {
		for (int i = 1; i <= n; i++)
			ans[i] = 1;
	} else if (zero == 1) {
		if (s[n-1] == '1') {
			for (int i = 1; i < n; i++) ans[i] = 2;
			ans[n] = 0;
		} else {
			for (int i = 1; i < n; i++) 
				if (s[i-1]=='0') ans[i] = 1;
				else ans[i] = 0;
			ans[n] = 2;
		}
	} else {
		long long int mod, mod1 = 0, mod2 = 0;
		for (int i = 0; i < n; i++) {
			mod1 = (mod1 * 2 + s[i] - '0') % (zero + 1);
			mod2 = (mod2 * 2 + s[i] - '0') % (zero - 1);
		}
		for (int i = 0; i < n; i++) {
			if (s[i] == '0') mod = (mod1 + mi(n-i-1, zero+1)) % (zero+1);
			else mod = ((mod2 - mi(n-i-1, zero-1)) % (zero-1) + zero-1) % (zero-1);
			int now = 1;
			while(mod) {
				mod %= ask(mod);
				now++;
			}
			ans[i+1] = now;
		}
	}
	for (int i = 1; i <= n; i++) printf("%d\n", ans[i]);
	return 0;
}

Measured memory_bytes: 4788
def main():
    N,D = map(int,input().split())
    ANS = 0
    for i in range(N):
        X,Y = map(int,input().split())
        if X*X + Y*Y <= D*D:
            ANS += 1
    
    print(ANS)
if __name__ == '__main__':
    main()

Measured memory_bytes: 9184
#include <iostream>

using namespace std;

int n, ans;
inline int gcd(int a, int b)
{
	int c = a % b;
	while (c)
	{
		a = b;
		b = c;
		c = a % b;
	}
	return b;
}
int main()
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n;
	int t;
	cin >> t;
	ans = t;
	for (int i = 2; i <= n; i++)
	{
		cin >> t;
		ans = gcd(ans, t);
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
t = [int(x) for x in input().split()]
w, h, x, y = t[0], t[1], t[2], t[3]

is_double = 0
if (w / 2 == x) and (h / 2 == y):
    is_double = 1
print("{0:.6f}".format(w * h / 2.0), is_double)

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

typedef long long ll;
#define vec vector<int>
#define vecll vector<ll>
#define vpair vector<pair<int, int>>
#define vpairll vector<pair<ll, ll>>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define rep(i,n)   for(int i=(int)0; i<(int)n; i++)
#define llrep(i,n)   for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n) for(int i=(int)m; i<(int)n; i++)
#define all(var)     (var).begin(), (var).end()
#define prt(var)     cout << var << endl
#define prt_dbl(i,var) cout<<fixed<<setprecision(i)<<var<<endl;

int main(){
  int N,M,ans;
  cin>>N>>M;
  ans = N*(N-1)+(M-1)*M;
  ans/=2;

  cout<<ans<<endl;
}


Measured memory_bytes: 256
def solve():
    N, M = map(int, input().split())
    A = []
    B = []
    dp = [float('inf')] * (N + 20000)
    dp[0] = 0
    for _ in range(M):
        a, b = list(map(int, input().split()))
        for i in range(N + 10000):
            if dp[i] == 'inf':
                continue
            dp[i+a] = min(dp[i+a], dp[i] + b)
        
    return min(dp[N:])

print(solve())

Measured memory_bytes: 55644
#include <stdio.h>
#include <stdlib.h>

#define rep(i, n) for (int i = 0; i < n; i = i + 1)
#define array(N, t) (t*)calloc(N, sizeof(t))
#define ll long long
#define INF ((1LL << 62) - (1LL << 31))
#define max(p, q)((p) > (q) ? (p) : (q))
#define min(p, q)((p) < (q) ? (p) : (q))
#define swap(type, a, b) { type temp = a; a = b; b = temp; }


int N;
int ans = 0;

int baisu_cnt(int x) {
  int cnt = 0;
  for (int i = 1; i <= x; i += 1) {
    if (x % i == 0) {
      cnt += 1;
    }
  }
  return cnt;
}

void solve1() {
  int cnt_C = N - 1;

  for (int i = cnt_C; i > 0; i -= 1) {
    int mult_A_B = N - i;
    int cnt_baisu = baisu_cnt(mult_A_B);
    ans += cnt_baisu;
  }
}

int baisu[1000005] = {0};

void solve2() {
  for (int i = 1; i < N; i += 1) {
    for (int j = 1; j <= i; j += 1) {
      if (i % j == 0) {
        baisu[j] += 1;
      }
    }
  }
  for (int i = 1; i < N; i += 1) {
    ans += baisu[i];
  }
}

void solve3() {
  for (int A = 1; A <= N; A += 1) {
    ans += (N - 1) / A;
  }
}

int main() {
  scanf("%d", &N);
  // solve1();
  // solve2();
  solve3();
  printf("%d\n", ans);
  return 0;
}


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

using ll = int64_t;
#define int ll

#define FOR(i, a, b) for (int i = int(a); i < int(b); i++)
#define REP(i, b) FOR(i, 0, b)
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(x) x.begin(), x.end()

using pi = pair<int, int>;
using vi = vector<int>;
using ld = long double;

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

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  REP(i, (int)v.size()) {
    if (i)
      os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}

ll read() {
  ll i;
  scanf("%" SCNd64, &i);
  return i;
}

void printSpace() { printf(" "); }

void printEoln() { printf("\n"); }

void print(ll x, int suc = 1) {
  printf("%" PRId64, x);
  if (suc == 1)
    printEoln();
  if (suc == 2)
    printSpace();
}

string readString() {
  static char buf[3341000];
  scanf("%s", buf);
  return string(buf);
}

char *readCharArray() {
  static char buf[3341000];
  static int bufUsed = 0;
  char *ret = buf + bufUsed;
  scanf("%s", ret);
  bufUsed += strlen(ret) + 1;
  return ret;
}

template <class T, class U> void chmax(T &a, U b) {
  if (a < b)
    a = b;
}

template <class T, class U> void chmin(T &a, U b) {
  if (b < a)
    a = b;
}

template <class T> T Sq(const T &t) { return t * t; }

const int mod = 1e9 + 7;

signed main() {
  string s = readString();
  std::cout << s[0] << s.size() - 2 << s[s.size() - 1] << std::endl;
}


Measured memory_bytes: 2304
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>

int main(){
	int i,x[100],y[100],n;
	double p_1=0.0,p_2=0.0,p_3=0.0,p_inf=0.0;
	char input[512],*p;
	
	fgets(input,sizeof input,stdin);
	sscanf(input,"%d",&n);
	
	fgets(input,sizeof input,stdin);
	p=strtok(input," ");
	x[0]=atoi(p);
	for(i=1;i<n;i++){
		p=strtok(NULL," ");
		x[i]=atoi(p);
	}
	
	fgets(input,sizeof input,stdin);
	p=strtok(input," ");
	y[0]=atoi(p);
	for(i=1;i<n;i++){
		p=strtok(NULL," ");
		y[i]=atoi(p);
	}
	
	for(i=0;i<n;i++){
		p_1+=fabs((double)x[i]-(double)y[i]);
		p_2+=pow(fabs((double)x[i]-(double)y[i]),2);
		p_3+=pow(fabs((double)x[i]-(double)y[i]),3);
		if(p_inf<=fabs((double)x[i]-(double)y[i])){
			p_inf=fabs((double)x[i]-(double)y[i]);
		}
		
	}
	p_2=sqrt(p_2);
	p_3=cbrt(p_3);
	
	printf("%f\n%f\n%f\n%f\n",p_1,p_2,p_3,p_inf);
	
	return 0;
}

Measured memory_bytes: 712
#include <bits/stdc++.h>
#define N 110000
using namespace std;
int a[N],i,j,n,m,k,l,ans,sum;
bool t[N];
int main()
{
	scanf("%d%d",&n,&m);
	for (i=1;i<=m;i++)
	{
		int x;char c,s;
		scanf("%d %c%c\n",&x,&c,&s);
		if (c=='A') t[x]=1;else
		{
			if (!t[x]) a[x]++;
		}
	}
	for (i=1;i<=n;i++)
	if (t[i]) ans++,sum+=a[i];
	printf("%d %d",ans,sum);
}

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

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

typedef long long ll;
using namespace std;
int mod = 1000000007;

int main(void){
    int N; ll K; cin >> N >> K;
    ll A[N]; rep(i, N) cin >> A[i];
    vector<ll> dp[N];
    rep(i, N) dp[i].resize(K+1);
    rep(i, K+1){
        if(i <= A[0]) dp[0][i] = 1;
        else dp[0][i] = 0;
    }
    rep(i, N) dp[i][0] = 1;

    for(int i = 1; i < N; i++){
        for(int j = 1; j <= K; j++){
            dp[i][j] = dp[i][j-1] + dp[i-1][j];
            if(j-A[i]-1 >= 0) dp[i][j] -= dp[i-1][j-A[i]-1];
            dp[i][j] %= mod;
            if(dp[i][j] < 0) dp[i][j] += mod;
        }
    }
    cout << dp[N-1][K] << endl;
    return 0;
}

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

#define FOR(i, a, b) for(int i = a; i<b; ++i)
#define FR(a, b) for(int i = a; i>=b;--i)
#define _upgrade cin.tie(0); ios_base::sync_with_stdio(0)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define INF 1e9

using namespace std;

typedef long long ll;
typedef double db;
typedef unsigned long long ull;
typedef pair<int, int> iPair;

const int MAX = 2e3+2;
const int M = 1e9+7;

int x, y, a, b, c;
vector<ll> r, g, nc;
int main()
{
    _upgrade;
    cin>>x>>y>>a>>b>>c;
    FOR(i, 0, a)
    {
        ll xx;
        cin>>xx;
        r.pb(xx);
    }
    FOR(i, 0, b)
    {
        ll xx;
        cin>>xx;
        g.pb(xx);
    }
    FOR(i, 0, c)
    {
        ll xx;
        cin>>xx;
        nc.pb(xx);
    }
    sort(all(r), greater<ll>());
    sort(all(g), greater<ll>());
    sort(all(nc), greater<ll>());
    ll res = 0;
    FOR(i, 0, x)
        res += r[i];
    FOR(i, 0, y)
        res += g[i];

    int idr = x-1, idg = y-1, id = 0;
    while(id < c && ((idr >= 0 && nc[id] > r[idr]) || (idg >= 0  && nc[id] > g[idg])))
    {
        if(idg < 0 || r[idr] < g[idg])
        {
            res += (nc[id] - r[idr]);
            id++;
            idr--;
        }
        else
        {
            res += (nc[id] - g[idg]);
            id++;
            idg--;
        }
    }
    cout<<res;
    return 0;
}


Measured memory_bytes: 3316
/******************************************
* NICK : nikhilsinghh59 *
******************************************/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define watch(x) cout << (#x) << " is " << (x) << endl
#define endl "\n"

#define PB push_back
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
const int M = 1e9+7;

int main()
{   
   

    ll n;
    cin >> n;

    ll ans=0;

    for(ll a=1 ; a<=n ; a++) {
        for(ll b=1 ; b<=n ; b++) {
            for(ll c = 1 ; c<=n ; c++) {
                ans+=(__gcd((__gcd(a,b)), c));
            }
        }
    }

    cout << ans;
    
    return 0;
}

Measured memory_bytes: 3632
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<map>

using namespace std;

int main() {
	vector<int>x, y;
	int n, m, xx, yy, i, j;

	cin >> n >> m >> xx >> yy;

	for (i = 0; i < n; i++) {
		cin >> j;
		x.push_back(j);
	}
	for (i = 0; i < m; i++) {
		cin >> j;
		y.push_back(j);
	}
	sort(x.begin(), x.end());
	sort(y.begin(), y.end());

	i = x[n - 1];
	j = y[0];

	if (xx >= yy) {
		cout << "War";
		return 0;
	}

	if (i < j && i<yy && j>xx)
		cout << "No War";
	else
		cout << "War";

	return 0;
}

Measured memory_bytes: 256
# 入力
import sys
stdin = sys.stdin

def li(): return [int(x) for x in stdin.readline().split()]
def li_(): return [int(x)-1 for x in stdin.readline().split()]
def lf(): return [float(x) for x in stdin.readline().split()]
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(ns())
def nf(): return float(ns())


def bf(graph: list):
    neg = -10**16
    n = len(graph)
    dist = [neg]*n
    dist[0] = 0
    
    hasUpdate = True
    cnt = 0
    cur = neg
    while hasUpdate:
        hasUpdate = False
        cnt += 1
        
        for frm, node in enumerate(graph):
            for cost, to in node:
                bef = dist[to]
                dist[to] = max(dist[to], dist[frm] + cost)
                
                # 更新されたならupdateをTrueに
                if dist[to] != bef:
                    hasUpdate = True
        
        if cnt == n:
            cur = dist[-1]
            
        if cnt == n+1:
            if dist[-1] == cur:
                return dist[-1]
            else:
                return "inf"
        
    return dist[-1]
                

n,m = li()

graph = [[] for _ in range(n)]
for i in range(m):
    a,b,c = li()
    a -= 1
    b -= 1
    graph[a].append((c,b))
    
ans = bf(graph)
print(ans)

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

using lli = long long int;

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

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

int main(void){
    lli n, m;
    cin >> n >> m;
    vector<lli> a(n);
    for(auto& i : a) cin >> i;
    priority_queue<lli> q;
    for(auto i : a) q.push(i);
    while(m > 0){
        lli d = q.top();
        q.pop();
        d /= 2;
        q.push(d);
        m--;
    }
    lli sum = 0;
    while(!q.empty()){
        sum+=q.top();
        q.pop();
    }
    cout << sum << endl;
    return 0;
}


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

using namespace std;

int main()
{
   ios::sync_with_stdio(false);
   cin.tie(0);
   
   double a,b,c;
   cin>>a>>b>>c;
    
   
   double pi = acos(-1);
  
  double s = 0.5*a*b*sin(pi/180*c);
  double l = sqrt(a*a + b*b - 2*a*b*cos(pi/180*c)) + a + b;
  double h = b*sin(pi/180*c);
  
  printf("%.5lf %.5lf %.5lf\n",s,l,h);
   
   
   return 0;
}


Measured memory_bytes: 3452
#include<bits/stdc++.h>
using namespace std;
#define N 105

int n,m,arr[N],sum=0;
float c;

int main()
{
	cin>>n>>m;
	for(int i=0;i<n;i++)
	{
		cin>>arr[i];
		sum+=arr[i];
	}
	sort(arr,arr+n);
	c=(float)sum/(4*m);
	if(arr[n-m]>=c)
		cout<<"Yes";
	else
		cout<<"No";
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using vi = vector<int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pii = pair<int,int>;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define eb(val) emplace_back(val)
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1e9+7;
void cioacc(){//accelerate cin/cout
  cin.tie(0);
  ios::sync_with_stdio(false);
}
signed main(){
  int n,a,b;
  cin >> n >> a >> b;
  int ans1 = min(a,b);
  int ans2 = max(a+b-n,0);
  cout << ans1 << " " << ans2 <<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF 5000000000000000000
#define ll long long
#define pll pair<ll, ll>
using namespace std;

int main() {
  ll N;
  cin >> N;
  vector<ll> A(N);
  ll either = 0;
  ll sum = 0;
  for (ll i = 0; i < N; ++i) {
    cin >> A.at(i);
    if (i > 1) {
      either ^= A.at(i);
    }
    else {
      sum += A.at(i);
    }
  }
  ll both = sum - either;
  if (both % 2 == 1) {
    cout << -1 << "\n";
    return 0;
  }
  both /= 2;
  if (both > A.at(0)) {
    cout << -1 << "\n";
    return 0;
  }
  bitset<40> bs1(either);
  bitset<40> bs2(both);
  // for (ll i = 0; i < 40; ++i) {
  //   cout << bs1[i];
  // }
  // cout << "\n";
  for (ll i = 0; i < 40; ++i) {
    if (bs1[i] == 1 && bs2[i] == 1) {
      cout << -1 << "\n";
      return 0;
    }
  }
  ll ans_small = 0;
  for (ll i = 40; i >= 0; --i) {
    if (bs1[i] == 1) {
      if (ans_small + pow(2, i) + both <= A.at(0)) {
        ans_small += pow(2, i);
      }
    }
  }
  if (both + ans_small == 0) {
    cout << -1 << "\n";
    return 0;
  }
  ll ans = A.at(0) - (both + ans_small);
  cout << ans << "\n";
}


Measured memory_bytes: 3968
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <list>
#include <ctime>
#include <sstream>
#include <queue>
#include <stack>
#include <random>
#include <bitset>
#include <numeric>
#include <cassert>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;
#define rep(x, b, e) for(int x=(b); x<(e); ++x)
#define ford(x, b, e) for(int x=((int)(b))-1; x>=(e); --x)
#define all(c) c.begin(),c.end()
#define sz(x) ((int)((x).size()))
#define pb push_back
#define st first
#define nd second
#define mp(x,y) make_pair(x,y)
typedef short int sint;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it) {
	*this << ((it != d.b) ? ", " : "") << *it;
  }
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

const int nax = 1e5+5;
vi za[nax];
int n, m;
int dist[nax], pre[nax];


int main() {
	ios_base::sync_with_stdio(false);
	scanf("%d %d", &n, &m);
	rep(i,0,m) {
		int x, y;
		scanf("%d %d",&x,&y);
		za[x].pb(y);
		za[y].pb(x);
	}
	rep(i,1,n+1) dist[i] = -1;
	dist[1] =0;
	queue<int> q;
	q.push(1);
	while (!q.empty()) {
		int cur = q.front(); q.pop();
		for (auto v : za[cur]) {
			if (dist[v] != -1) {
				continue;
			}
			dist[v] = dist[cur] + 1;
			pre[v] = cur;
			q.push(v);
		}
	}
	printf("Yes\n");
	rep(i,2,n+1) {
		printf("%d\n", pre[i]);
	}
}

Measured memory_bytes: 11048
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (ll i = a; i < b; i++)
#define REP(i,b) FOR(i,0,b)
#define RFOR(i,a,b) for (ll i = a-1; i >= b; i--)
#define RREP(i,a) RFOR(i,a,0)
#define REPALL(i,x) for (ll i = 0; i < x.size(); i++)
#define RREPALL(i,x) for (ll i = x.size()-1; i >= 0; i--)
#define REPITR(itr,x) for (auto itr = (x).begin(); itr != (x).end(); itr++)
#define ALL(x) (x).begin(), (x).end()
#define SORT(x) sort(ALL(x))
#define MIN_ELEMENT(x) min_element(ALL(x))
#define MAX_ELEMENT(x) max_element(ALL(x))
#define COUNT(x,num) count(ALL(x), num)
#define MEMSET(x,val) memset(x, val, sizeof(x))
#define MAX(a,b) a = max(a,b)
#define MIN(a,b) a = min(a,b)
#define debug(x) cerr<<__LINE__<<": "<<(#x)<<" = "<<(x)<<endl;
void YES(bool flag) {cout<<(flag ? "YES" : "NO")<<endl;}
void Yes(bool flag) {cout<<(flag ? "Yes" : "No")<<endl;}
void yes(bool flag) {cout<<(flag ? "yes" : "no")<<endl;}
#define e1 first
#define e2 second
#define nextline putchar('\n')
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef vector<ll> VLL;
typedef vector<vector<ll>> VVLL;
const int INF = 1e7;
const ll MOD = 1e9 + 7;

string n;
int k;
VVI dp0(100, VI(100, 0)), dp1(100, VI(100, 0));

int main()
{
    cin>>n>>k;
    dp0.resize(n.size() + 1);
    dp1.resize(n.size() + 1);

    if (n.size() < k) {
        cout<<0<<endl;
        exit(0);
    }

    dp0[0][0] = 1;
    dp0[0][1] = n[0] - '1';
    dp1[0][1] = 1;
    REP(i,n.size() - 1) {
        int tmp = n[i+1] - '0';
        REP(j,k+1) {
            if (tmp == 0) {
                dp0[i+1][j+1] += dp0[i][j] * 9;
                dp0[i+1][j] += dp0[i][j];
                dp1[i+1][j] += dp1[i][j];
            } else {
                dp0[i+1][j+1] += dp0[i][j] * 9 + dp1[i][j] * (tmp - 1);
                dp0[i+1][j] += dp0[i][j] + dp1[i][j];
                dp1[i+1][j+1] += dp1[i][j];
            }
        }
    }
    /* REP(i,n.size()) {
        REP(j, k+1) {
            cout<<dp0[i][j]<<"_"<<dp1[i][j]<<"    ";
        }
        nextline;
    }
    cout<<dp0[n.size()-1][k]<<endl;
    cout<<dp1[n.size()-1][k]<<endl; */
    cout<<dp0[n.size()-1][k] + dp1[n.size()-1][k]<<endl;

    return 0;
}


Measured memory_bytes: 384
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <cassert>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
using namespace std;
#define REP(i, n) for (int64_t i = 0; i < (int64_t)n; i++)
#define REP_FOR(i, a, b) for (int64_t i = (int64_t)a; i < (int64_t)b; i++)
#define REP_REV(i, a, b) for (int64_t i = (int64_t)a; i > (int64_t)b; i--)
#define FORALL(v) (v).begin(), (v).end()
#define mp(a, b) make_pair(a, b)
#define eb(x) emplace_back(x)
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<int64_t, int64_t> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int64_t> vii;
typedef vector<vii> vvii;
const ll mod = 1e9 + 7;
const int64_t infi = 1147483600;
const ll infl = 4e18 + 5;
const char EOL = '\n';
//cout << fixed << setprecision(17) << res << endl;
const ll MOD = 998244353;

int main() {
    ll N, K;
    cin >> N >> K;
    ll count = 1;
    while (N >= K) {
        N /= K;
        ++ count;
    }
    cout << count << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
 
using namespace std;
 
int main()
{
  int n;
  cin >> n;
  vector<int> vs(n * 2);
  for(int i = 0; i < n * 2; i++) {
    cin >> vs[i];
  }
  sort(vs.begin(), vs.end());
  int ans = 0;
  for(int i = n - 1; i >= 0; i--)
  {
    ans += vs[2 * i];
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>

static const int INF = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;

int main() {
    string s;
    cin >> s;
    for (int i = 0; i < (s.length()+1)/2; ++i) {
        cout << s[i*2];
    }
    cout << "\n";
    return 0;
}


Measured memory_bytes: 512
#include<stdio.h>

int main(void){
	int n,m,a,b,w[64]={0},i;
	scanf("%d%d",&n,&m);
	for(i = 1;i <= m;i++){
		scanf("%d%d",&a,&b);
		w[a]++;w[b]++;
	}
	for(i = 1;i <= n;i++){printf("%d\n",w[i]);}
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define pi M_PI
#define PQ(T) priority_queue<T>
#define SPQ(T) priority_queue<T,vector<T>,greater<T>>
using ll=long long;
using P=pair<ll,ll>;
using PP=tuple<ll,ll,ll>;
using S=multiset<ll>;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=1000000007;
const double eps=1e-10;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
void decimal(int x){cout<<fixed<<setprecision(x);}
//ll GCD(ll a,ll b){if(b==0) return a; return GCD(b,a%b);}
//ll LCM(ll a,ll b){return(a/GCD(a,b))*(b/GCD(a,b))*GCD(a,b);}
ll POW(ll a,ll b){a%=mod;if(b==0)return 1;if(b&1)return a*POW(a,b-1)%mod;ll k=POW(a,b/2);return k*k%mod;}
vi calc(ll x){vi res;while(x>0){res.eb(x%10);x/=10;}reverse(all(res));return res;}

void solve(){
  char c;
  cin>>c;
  if(c>='a') out('a');
  else out('A');
}

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


Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int A,B; cin>>A>>B;
  string S; cin>>S;
  unordered_set<char> table{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
  bool flag = true;

  for(int i = 0; i < S.size(); i++){
    char c = S[i];
    if(i == A){
      if(c != '-'){
        flag = false;
        break;
      }
    } else {
      if(table.find(c) == table.end()){
        flag = false;
        break;
      }
    }
  }

  cout << (flag ? "Yes" : "No") << "\n";

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
 
int main() {
  int k = 0, u = 0, p = 0, c = 0;
  string s;
 
  cin >> s;
  for(int i = 0; i < s.size(); i++) {
    if(s[i] == 'K')k++;
    else if(s[i] == 'U')u++;
    else if(s[i] == 'P')p++;
    else if(s[i] == 'C')c++;
  }
 
  int cnt = 0;
  while(k > 0 && u > 0 && p > 0 && c > 0) {
    cnt++;
    k--, u--, p--, c--;
  }
  cout << cnt << endl;
}

Measured memory_bytes: 1192
#include<iostream>
using namespace std;
const int maxp=10005;
int n,q,Tree[maxp];

int GetP(int s) {
	if(Tree[s]==s) return s;
	else return Tree[s]=GetP(Tree[s]);
}

void Merge(int x,int y) {
	int px=GetP(x),py=GetP(y);
	if(px!=py) Tree[py]=px;
}

bool Check(int x,int y) {
	int px=GetP(x),py=GetP(y);
	if(px==py) return true;
	else return false;
}
int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cin.tie(NULL);
	cin>>n>>q;
	for(int i=0; i<n; i++)
		Tree[i]=i;
	int judge,x,y;
	while(q--) {
		cin>>judge>>x>>y;
		if(judge) {
			if(Check(x,y)) cout<<"1"<<endl;
			else cout<<"0"<<endl;
		} else Merge(x,y);
	}
	return 0;
}


Measured memory_bytes: 3264
#pragma target("avx")
#pragma optimize("O3")
#include<bits/stdc++.h>
using ll = int_fast64_t;
using P = std::pair<ll,ll>;
using PP = std::pair<ll,P>;
using V = std::vector<ll>;
template<typename T> using pq = std::priority_queue<T>;
template<typename T> using rpq = std::priority_queue<T, std::vector<T>, std::greater<T>>;

#define REP(i,b,e) for(ll i=b; i<e; i++)
#define ALL(vec) vec.begin(),vec.end()
#define PRINT(vec) printf("[ ");for(auto &i:vec)printf("%ld ",i);puts("]");
#define SCAN(vec) for(auto &i:vec)scanf("%ld",&i)
#define fi first
#define se second

const int MOD = 1e9+7;
const ll INF = 1e18;
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

int main(){
	int n;
	scanf("%d", &n);
	char s[n+1];
	scanf("%s", s);
	
	ll alp[26] = {};
	REP(i, 0, n) alp[s[i]-'a']++;

	ll ans = 1;
	REP(i, 0, 26){
		ans *= alp[i] + 1;
		ans %= MOD;
	}
	printf("%ld\n", ans-1);
	return 0;
}



Measured memory_bytes: 384
function main(input){

    inputArray=input.split('\n');
    NM=inputArray[0].split(' ');
    N = parseInt(NM[0]);
    M = parseInt(NM[1]);
    out=0;
    goodArray=new Array(N);//all sunuke
    for(i=0;i<N;i++){
        goodArray[i]='0';
    }

    highArray=inputArray[1].split(' ');
    
    for(i=2;i<M+2;i++){
        AB=inputArray[i].split(' ');
        A=parseInt(AB[0]);
        B=parseInt(AB[1]);
        if(parseInt(highArray[A-1])<parseInt(highArray[B-1])){
            goodArray[A-1]='-1';
           if(goodArray[B-1]!='-1'){
            goodArray[B-1]='1';
           }
        }
        else if(parseInt(highArray[B-1])<parseInt(highArray[A-1])){
           if(goodArray[A-1]!='-1'){
              goodArray[A-1]='1';
           }
            goodArray[B-1]='-1';
        }
        else if(parseInt(highArray[A-1])==parseInt(highArray[B-1])){
            goodArray[A-1]='-1';
            goodArray[B-1]='-1';
        }
    }

  
    for(i=0;i<N;i++){
        if(goodArray[i]=='1' || goodArray[i]=='0'){
            out++;
        }
    }
    console.log(out);
}
 
main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

using namespace std;

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

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define DEBUG_ARR(v,n) cout<<#v<<":";REP(i,n)cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    ll a,b,c,k;
    cin>>a>>b>>c>>k;
    ll ans = 0;
    ans += min(a,k);
    k = max(0LL,k-a);
    k = max(0LL,k-b);
    ans -= min(c,k);
    k = max(0LL,k-c);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3652
use std::io::BufRead;

pub struct StdinReader<R: BufRead> {
    pub buf_reader: R,
    pub buf: String,
}

impl<R: BufRead> StdinReader<R> {
    pub fn new(r: R) -> Self {
        StdinReader {
            buf_reader: r,
            buf: String::with_capacity(10000),
        }
    }
}

#[macro_export]
macro_rules! input {
    ($reader : expr, $t : ty) => { // one variable
        match &mut $reader {
            reader => {
                use std::io::BufRead;
                reader.buf_reader.read_line(&mut reader.buf).unwrap();
                let tmp_var: $t = reader.buf.trim().parse().unwrap();
                reader.buf.clear();
                tmp_var
            },
        }
    };
    ($reader : expr, $t0 : ty, $t1 : ty) => { // 2 tuple
        match &mut $reader {
            reader => {
                use std::io::BufRead;
                reader.buf_reader.read_line(&mut reader.buf).unwrap();
                let tmp_var: Vec<$t0> = reader.buf.trim().split_whitespace().map(|a| a.parse().unwrap()).collect();
                reader.buf.clear();
                (tmp_var[0].clone(), tmp_var[1].clone())
            }
        }
    };
    ($reader : expr, $t0 : ty, $t1 : ty, $t2 : ty) => { // 3 tuple
        match &mut $reader {
            reader => {
                use std::io::BufRead;
                reader.buf_reader.read_line(&mut reader.buf).unwrap();
                let tmp_var: Vec<$t0> = reader.buf.trim().split_whitespace().map(|a| a.parse().unwrap()).collect();
                reader.buf.clear();
                (tmp_var[0].clone(), tmp_var[1].clone(), tmp_var[2].clone())
            }
        }
    };
    ($reader : expr, $t : ty; $size : expr) => { // Vector
        match &mut $reader {
            reader => {
                use std::io::BufRead;
                reader.buf_reader.read_line(&mut reader.buf).unwrap();
                let tmp_var: $t = reader.buf.trim().split_whitespace().map(|a| a.parse().unwrap()).collect();
                reader.buf.clear();
                tmp_var
            }
        }
    };
}

fn main() {
    solve_b();
}

fn solve_b() {
    let handle = std::io::stdin();
    let mut r = StdinReader::new(handle.lock());
    let (n, m, c) = input!(r, i64, i64, i64);
    let bs: Vec<i64> = input!(r, Vec<i64>; m);
    let mut total = 0;
    for _ in 0..n {
        let charas: Vec<i64> = input!(r, Vec<i64>; m);
        let left_side = charas.into_iter().zip(bs.iter());
        if left_side.map(|(a, &b)| a * b).sum::<i64>() + c > 0 {
            total += 1;
        }
    }
    println!("{}", total);
}


Measured memory_bytes: 4352
s=input()
t=input()
a=len(s)
b=len(t)
dp=[[0]*(b+1) for i in range(a+1)]
for i in range(a):
  for j in range(b):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j])
res=''
while a!=0 and b!=0:
  if dp[a][b]==dp[a-1][b]:
    a-=1
  elif dp[a][b]==dp[a][b-1]:
    b-=1
  else:
    a-=1
    b-=1
    res=s[a]+res
print(res)

Measured memory_bytes: 113372
import java.io.*;
import java.util.*;
import java.lang.Math;

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

    public static void solve(){
        FastScanner sc = new FastScanner();
        Double l = sc.nextDouble();
        l /= 3.0;
        double ans = l * l * l;
        System.out.println(String.format("%.10f", ans));
    }
}

class FastScanner {
    private InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private 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;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public 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();
    }
    public 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();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}

Measured memory_bytes: 19284
# -*- coding: utf-8 -*-
import sys

index = int(input())
array = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(int(array[index-1]))



Measured memory_bytes: 2940
def greater(a,b):
    if a is None:
        return b
    if len(a)>len(b):
        return a
    if len(b)>len(a):
        return b
    for i in range(len(a)):
        if a[i]>b[i]:
            return a
        if b[i]>a[i]:
            return b
    return a

c={"1":2,"2":5,"3":5,"4":4,"5":5,"6":6,"7":3,"8":7,"9":6}
n,m=map(int,input().split())
l=input().split()
l.sort()
max=[None for i in range(10010)]
for a in l:
    max[c[a]]=a
for i in range(2,n):
    if max[i] is not None:
        for a in l:
            k=max[i]+a if max[i][0]>a else a+max[i]
            max[i+c[a]]=greater(max[i+c[a]],k)
print(max[n])

Measured memory_bytes: 136156
#include <iostream>
using namespace std;
int main()
{
    int a, b, c, d;
    cin >> a >> b >> c >> d;

    int ans = 0;
    for (int i = 0; i <= 100; ++i)
    {
        if (a <= i && i < b && c <= i && i < d)
            ++ans;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String ans = "APPROVED";
		for (int i = 0; i < n; i++) {
			int t = sc.nextInt();
			if (t % 2 == 0) {
				if (t % 3 != 0 && t % 5 != 0) {
					ans = "DENIED";
					break;
				}
			}
		}
		
		System.out.println(ans);
	}
}




Measured memory_bytes: 23636
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1000000007;
#define INF 1LL<<30
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()

int main() {
    int n;
    cin>>n;
    int a[n];
    rep(i,n) cin>>a[i];
    vector<int> b(n,0);
    b[0]=3;
    ll ans=1;
    rep(i,n){
        ans=(ans*b[a[i]])%MOD;
        b[a[i]]--;
        b[a[i]+1]++;
    }
    cout<<ans<<endl;
    return 0;
}



Measured memory_bytes: 4052
#include <iostream>
#include <cstdlib>
using std::cout;
using std::cin;
using std::endl;

int main()
{
	int i, num, *list;
	cin >> num;
	list = (int *) calloc(num, sizeof(int));
	if (list == NULL) return 1;
	for (i = 0; i < num; i++) cin >> list[i];
	for (i = num - 1; i > 0; i--) cout << list[i] << " ";
	cout << list[0] << endl;
	return 0;	
}

Measured memory_bytes: 1200
#include <bits/stdc++.h>
using namespace std;
int main()
{
   long long int num;
   cin>>num;
   int pr[1000001]={1};
   for(int i=1;i<=1000000;i++) pr[i]=1;
   for(int i=2;i<=1000000;i++)
    {
    	if(pr[i]==1)
    	{
    	 for(int j=2*i;j<=1000000;j+=i)
           {pr[j]=0;}
    	}
    }
    
    int ans[64]={0};
    for(int n=1;n<=11;n++)
     {
     	if((n*(n+1))/2 <=63) ans[(n*(n+1))/2]=n;
     }
     for(int j=2;j<=63;j++)
      if(ans[j]==0) ans[j]=ans[j-1];
    int sum=0;
   for(long long int j=2;j<=1000000;j++)
    {
    	int k=0;
    	if(pr[j]==1 && num%j==0)
    	 {
    	 	while(num%j==0)
    	 	{
    	 		num/=j;
    	 		k++;
    	 	}
    	 	 sum+=ans[k];
    	 }
    }
  if(num!=1) sum++;
   cout<<sum<<endl;
   return 0;
}

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

int n, m, a, b, c, ans, dist[105][105];
vector<pair<int, pair<int, int>>> edgeList;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	
	cin >> n >> m;

	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			if (i == j) {
				dist[i][j] = 0;
			}
			else {
				dist[i][j] = 1e9;
			}
		}
	}

	for (int i = 0; i < m; i++) {
		cin >> a >> b >> c;
		dist[a][b] = c;
		dist[b][a] = c;
		edgeList.push_back({a, {b, c}});
	}

	for (int k = 1; k <= n; k++) {
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j <= n; j++) {
				dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
			}
		}
	}

	ans = m;
	for (int i = 0; i < m; i++) {
		int u = edgeList[i].first, v = edgeList[i].second.first, w = edgeList[i].second.second;
		if (w == dist[u][v]) {
			ans--;
		}
	}

	cout << ans << '\n';

	return 0;
}

Measured memory_bytes: 384
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <string.h>
#include <math.h>

int main (void)
{
    size_t N;
    uint_least64_t A;
    intmax_t num[64] = {};
    intmax_t ans = 0;

    scanf("%zu", &N);
    for (size_t i = 0; i < N; i++) {
        scanf("%"SCNuFAST64, &A);
        for (unsigned int j = 0; (1ULL << j) < (1ULL << 61); j++) {
            if (A & (1ULL << j))
                num[j]++;
        }
    }

    for (size_t i = 0; i < 64; i++) {
        intmax_t tmp = 1;
        tmp *= num[i] % ((int)1e9 + 7);
        tmp %= (int)1e9 + 7;
        tmp *= (N - num[i]) % ((int)1e9 + 7);
        tmp %= (int)1e9 + 7;
        tmp *= (1ULL << i) % ((int)1e9 + 7);
        tmp %= (int)1e9 + 7;
        ans += tmp;
        ans %= (int)1e9 + 7;
    }

    printf("%jd\n", ans);

    return 0;
}


Measured memory_bytes: 128