akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);


void solve(){
    int n;
    cin>>n;
    vector<int> ar(n);
    for(int i=0;i<n;i++){
        cin>>ar[i];
    }
    int cnt = 0;
    sort(ar.begin(),ar.end());
    for(int i=0;i<n;i++)
        for(int j=i+1;j<n;j++)
            for(int k=j+1;k<n;k++){
                if(ar[i]!=ar[j]&&ar[i]!=ar[k]&&ar[j]!=ar[k]){
                    if(ar[i]+ar[j]>ar[k]){
//                        cout<<ar[i]<<" "<<ar[j]<<" "<<ar[k]<<endl;
                        cnt++;
                    }
                }
            }

    cout<<cnt<<endl;
}

int main()
{
    FASTIO
    int t = 1;
//    cin >> t;
    while(t--){
        solve();
    }
    return 0;
}





Measured memory_bytes: 3672
def main():
    o = input()
    e = input()

    pw = [0]*(len(o)+len(e))

    for i in range(len(o)):
        pw[i*2] = o[i]

    for i in range(len(e)):
        pw[i*2 + 1] = e[i]

    print("".join(pw))

    # if len(o) == len(e):
    #     pw = [o[i]+e[i] for i in range(len(o))]
    # else:
    #     pw = [o[i]+e[i] for i in range(len(e))]
    #     pw.append(o[-1])
    # 
    # print("".join(pw))
    # 


if __name__ == "__main__":

    main()


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main() {
    string s;
    cin >> s;
    int r=0,b=0;
    for  (int i=0;i<s.size();i++) {
        if (s[i]=='0') r++;
        else b++;
    }
    int ans = min(r,b) * 2;
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
int main() {
    string S, T; cin >> S >> T;
    int ans = 0;
    for (int i = 0; i < 3; i++) {
        if (S[i] == T[i]) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
n = int(input())
h = list(map(int,input().split()))

count = [0]*(n-1)
j = 0
count2 = [0]*(n-2)

for i in range(n-1):
    if h[i] > h[i+1]:
        count[i] = 1
    if h[i] < h[i+1]:
        count[i] = 0
    if h[i] == h[i+1]:
        count[i] = 1

# print(count)
z = 0
for i in range(n-2):
    if count[i] == count[i+1] and count[i]==1:
        count2[j] += 1
        z = 1
    else:
        j += 1
if z == 1:
    print(max(count2)+1)
else:
    print('0')
    
        

    



Measured memory_bytes: 14480
#include <iostream>
#include <vector>
using namespace std;
#define INF (1 << 30) - 1
#define LINF 1LL << 60
using ll = long long;

ll dp[100100];

int main(){
  int n;
  cin >> n;
  vector<ll> a(n);
  for(int i = 0; i < n; ++i){
    cin >> a[i];
  }
    
  fill((ll*)dp, (ll*)dp + sizeof(dp) / sizeof(ll), LINF);
  for(int i = 0; i < n; ++i){
    *lower_bound(dp, dp + n, a[i]) = a[i];
  }

  cout << lower_bound(dp, dp + n, INF) - dp << endl;

  return 0;
}



Measured memory_bytes: 4384
while 1:
    n,m=map(int,input().split())
    if n==m==0:break
    p_max=[0]*(n)
    p_min=[0]*(n)
    for i in range(m):
        quiz=list(map(int,input().split()))
        for j in quiz[2:]:
            p_max[j-1]+=quiz[0]
        if quiz[1]==1:
            p_min[j-1]+=quiz[0]
    pmax=max(p_max)
    while p_max.count(pmax)==1:
        k=p_max.index(pmax)
        del p_max[k]
        del p_min[k]
    print(pmax-min(p_min)+1)


Measured memory_bytes: 6188
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        for (int i = 1; i <= n; i++) {
            if (i == n) {
                if (i % 3 == 0) {
                    System.out.println(" " + i);
                } else if (Integer.toString(i).contains("3")) {
                    System.out.println(" " + i);
                } else {
                    System.out.println();
                }
            } else {
              if (i % 3 == 0) {
                    System.out.print(" " + i);
                } else if (Integer.toString(i).contains("3")) {
                    System.out.print(" " + i);
                }
            }
        }
    }
}



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

int main() {
  long X;
  cin >> X ;
  int sum=0;
  int ans=0;
  for(int i=1;i<1000001;i++){
    sum+=i;
    ans++;
    if(sum>=X) break;
  }
  cout<<ans<<endl;

  }


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void) {
	char a[5], b[5];
	cin >> a >> b;
	if ((a[0] == 'H' && b[0] == 'H') || (a[0] == 'D' && b[0] == 'D')) {
		cout << "H" << endl;
	}
	else
		cout << "D" << endl;
	return 0;
}

Measured memory_bytes: 256
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define mp make_pair
#define ALL(obj) (obj).begin(),(obj).end()
#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(i,0,n)
#define RREP(i,n) RFOR(i,0,n) 
#define SIZE(x) ((int)(x).size())
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef pair<int, int> pint;
typedef pair<lint, lint> plint;
typedef vector<lint> vec;
typedef vector<vector<lint>> matrix;
typedef priority_queue<lint> p_que;
typedef priority_queue<lint, vector<lint>, greater<lint>> p_que_rev;
const lint INF = INT_MAX;
const lint LINF = LLONG_MAX;
const lint MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};

lint gcd(lint a, lint b) {
    lint r;
    while (b != 0) {
        r = a % b;
        a = b; 
        b = r;
    }
    return a;
}

lint lcm(lint a, lint b) {
    return (a / gcd(a, b)) * b;
}

lint power(lint x, lint n, lint mod = MOD) {
    lint ret = 1;
    while(n > 0) {
        if(n & 1){
            (ret *= x) %= mod;
        }
        (x *= x) %= mod;
        n >>= 1;
    }
    return ret;
}

vector<lint> make_power(int n, lint base){
    lint num = 1;
    vector<lint> ret;
    for (int i=0; i<=n; ++i){
        ret.push_back(num);
        num *= base;
    }
    return ret;
}

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    double ans = 0;
    if(n % 2 == 0){
        ans = 0.5;
    }
    else {
        ans = (n / 2 + 1) / (double)n;
    }
    printf("%.15f\n", ans);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...) 0
#endif

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string a, b, c;
    cin >> a >> b >> c;
    int ans = 10000;
    int as = a.size(), bs = b.size(), cs = c.size();
    vector<int> ab(20000), ac(20000), bc(20000);
    int pos = 10000;
    for (int ib = -4000; ib <= 4000; ib++) {
        bool ok = true;
        for (int i = max(0, ib); i < min(as, ib + bs); i++) {
            if (a[i] != '?' && b[i - ib] != '?' && a[i] != b[i - ib]) {
                ok = false;
                break;
            }
        }
        if (ok) {
            ab[pos + ib] = 1;
        }
    }
    for (int ic = -4000; ic <= 4000; ic++) {
        bool ok = true;
        for (int i = max(0, ic); i < min(as, ic + cs); i++) {
            if (a[i] != '?' && c[i - ic] != '?' && a[i] != c[i - ic]) {
                ok = false;
                break;
            }
        }
        if (ok) {
            ac[pos + ic] = 1;
        }
    }
    for (int ic = -4000; ic <= 4000; ic++) {
        bool ok = true;
        for (int i = max(0, ic); i < min(bs, ic + cs); i++) {
            if (b[i] != '?' && c[i - ic] != '?' && b[i] != c[i - ic]) {
                ok = false;
                break;
            }
        }
        if (ok) {
            bc[pos + ic] = 1;
        }
    }
    for (int ib = -4000; ib <= 4000; ib++) {
        if (!ab[pos + ib]) continue;
        for (int ic = -4000; ic <= 4000; ic++) {
            if (ac[pos + ic] && bc[pos + ic - ib]) {
                int res = max({as, ib + bs, ic + cs}) - min({0, ib, ic});
                ans = min(ans, res);
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
iN ,iX  = [int(x) for x in input().split()]
aX = [int(x) for x in input().split()]

aCum = [0]*(iN)
aCum[0] = aX[0]
for i in range(1,iN):
    aCum[i]=aCum[i-1]+aX[i]
def fCeil(iT,iR):
    return -1 * iT // iR * -1

def fCalcCost(iN,iX,aCum,iK):
    iCost = 5 * aCum[-1]
    for i in range(2,fCeil(iN,iK) ):
        iCost += 2 * aCum[-1 * i * iK -1]
#   i = 2
#   while  i*iK < iN  :
#       iCost += 2 * aCum[-1 * i * iK -1]
#       i += 1
    iCost += (iK +iN)*iX
    return iCost

iTotalCost = fCalcCost(iN,iX,aCum,1)
for iK in range(2,iN//2 + 2):
    iTotalCost = min(iTotalCost,fCalcCost(iN,iX,aCum,iK))
print(iTotalCost)




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

int main(void){
  int n, x;
  cin >> n;
  vector<int> d;
  for(int i = 0; i < n; i++){
    cin >> x;
    d.push_back(x);
  }
  sort(d.begin(), d.end());
  d.erase(unique(d.begin(), d.end()), d.end());
  cout << d.size() << endl;
  return 0;
}


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

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////

int N,L[111],lsum,i;
int main(){
    scanf("%d", &N);
    fornum(i,0,N){
        scanf("%d", &L[i]);
    }
    sort(L, L + N);
    fornum(i, 0, N - 1){
        lsum += L[i];
    }
    if(lsum<=L[N-1]){
        printf("No");
    }else{
        printf("Yes");
    }
    
    return 0;
}

Measured memory_bytes: 256
#bit全探索
ABCD = input()


#オペランドが入る隙間
N = len(ABCD) -1

for i in range( 2 ** N ):
    #予めすべてが "-" のリストをつくっておく
    op = ["-"] * N
    for j in range(N):
        if (i >> j) & 1:
            op[N - 1 - j] = "+"
    
    #計算用の式
    siki = ''
    for k in range(N):
        siki += ABCD[k]
        siki += op[k]
    
    siki += ABCD[3]
    if eval(siki) == 7:
        print(siki+"=7")
        break




Measured memory_bytes: 38256
N, Y = gets.split(' ').map(&:to_i)
(0..N).each{|i|
    (0..(N-i)).each{|j|
        if Y == 10000 * i + 5000 * j + 1000 * (N - i - j)
            puts "#{i} #{j} #{N - i - j}"
            exit
        end
    }
}
puts "-1 -1 -1"

Measured memory_bytes: 1788
#include<cstring>
#include<algorithm>
#include<cstdio>
#define N 20005

using namespace std;
int a[N],n;
bool cmp(int a,int b){
return a>b;
}

int sol(int x,int y,int l,int r){
if(l==r){
if(y+a[l]>x)return l;
else return -1;
}
int md=(l+r)/2;
if(y+a[md+1]<=x)return sol(x,y,l,md);
else return sol(x,y,md+1,r);
}
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
}
sort(a+1,a+n+1,cmp);
long long int ans=0;
for(int i=1;i<=n;i++){
for(int j=i+1;j<=n-1;j++){
int as=sol(a[i],a[j],j+1,n);
if(as>j)ans+=(long long int )(as-j);
}
}
printf("%lld",ans);
}

Measured memory_bytes: 1744
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

int main(){

    string s1 = "1", s2 = "2";
    map<string, int>cnt;
    for(string s;cin >> s;){
        cnt[s]++;
        if(cnt[s] > cnt[s1])s1 = s;
        if(s.size() > s2.size())s2 = s;
    }    
    cout << s1 << " " << s2 << endl;

    return 0;
}


Measured memory_bytes: 3220
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
using namespace std;
const int INF = 2000000000;
const int num = 100;
int n, u, k, v, w;
int m[num][num];
int d[num];
int c[num];
int main() {
	cin >> n;
	fill(m[0], m[num], INF);
	for (int i = 0; i < n; i++) {
		cin >> u >> k;
		for (int j = 0; j < k; j++) {
			cin >> v >> w;
			m[u][v] = w;
		}
	}
	fill(d, d + num, INF);
	fill(c, c + num, 0);
	d[0] = 0;
	while (true) {
		int ne = -1;
		int minv = INF;
		for (int i = 0; i < n; i++)
			if (!c[i] && d[i] < minv) {
				ne = i;
				minv = d[i];
			}
		if (ne == -1) break;
		c[ne] = 1;
		for (int i = 0; i < n; i++) {
			if (d[i] > d[ne] + m[ne][i]) d[i] = d[ne] + m[ne][i];
		}
	}
	for (int i = 0; i < n; i++)
		cout << i << " "<< d[i] << endl;
	return 0;
}

Measured memory_bytes: 3084
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=5e18;

ll n;
vec a(3);
vector<string> s(1e5+10);
vector<char> ans;
string tmp="ABC";


ll ch(ll i) {
  string t=s[i];
  ll n1,n2;
  if(t=="AB") {
    n1=0,n2=1;
  }
  else if(t=="BC") {
    n1=1,n2=2;
  }
  else {
    n1=2,n2=0;
  }
  if(a[n1]==0&&a[n2]==0) return 1;
  
  if(a[n1]==1&&a[n2]==1&&a[3-n1-n2]==0&&i+1<n) {
    ll n3,n4;
    t=s[i+1];
    if(t=="AB") {
      n3=0,n4=1;
    }
    else if(t=="BC") {
      n3=1,n4=2;
    }
    else {
      n3=2,n4=0;
    }
    if(n2==n3||n2==n4) {
      a[n1]--;
      a[n2]++;
      ans.push_back(tmp[n2]);
    }
    else {
      a[n1]++;
      a[n2]--;
      ans.push_back(tmp[n1]);
    }
  }
  else if(a[n1]>=a[n2]) {
    a[n1]--;
    a[n2]++;
    ans.push_back(tmp[n2]);
  }
  else {
    a[n1]++;
    a[n2]--;
    ans.push_back(tmp[n1]);
  }
  return 0;
}

int main() {
  cin >> n >> a[0] >> a[1] >> a[2];
  for(ll i=0;i<n;i++) cin >> s[i];
  for(ll i=0;i<n;i++) {
    if(ch(i)) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  for(ll i=0;i<n;i++) {
    cout << ans[i] << endl;
  }
}

Measured memory_bytes: 6728
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

namespace Main
{
    class Program
    {
        static void Main(string[] args)
        {
            //ここから
            //string[] str = Console.ReadLine().Split(' ');
            //int n = int.Parse(Console.ReadLine());
            long n = long.Parse(Console.ReadLine());

            long count = 0;
            long money = 100;
            while (true)
            {
                money =(long) Math.Floor( money * 1.01);
                count++;
                if (money >= n) break;

            }

            Console.WriteLine(count);

            //ここまで
        }




    }

}


Measured memory_bytes: 27548
//! Framework <https://github.com/vain0x/procon>

#![allow(non_snake_case)]
#![allow(unused_imports)]

use std::collections::*;

pub struct Scan(Box<dyn Iterator<Item = &'static str>>); // '

impl Scan {
    fn new() -> Self {
        let mut buf = String::new();
        let read_line = move || {
            std::io::stdin().read_line(&mut buf).unwrap();
            Box::leak(buf.split_off(0).into_boxed_str()).split_whitespace()
        };
        Scan(Box::new(std::iter::repeat_with(read_line).flatten()))
    }

    pub fn word<T: std::str::FromStr>(&mut self) -> T {
        self.0.next().unwrap().parse().ok().unwrap()
    }

    pub fn list<T: std::str::FromStr>(&mut self, len: usize) -> Vec<T> {
        std::iter::repeat_with(|| self.word()).take(len).collect()
    }
}

fn main() {
    let mut scan = Scan::new();

    let N = scan.word::<usize>();
    let A = scan.list::<u64>(N);

    let mut ok = true;
    let mut prod = 1_u64;
    if (0..N).any(|i| A[i] == 0) {
        prod = 0;
    } else {
        for i in 0..N {
            prod = match prod.overflowing_mul(A[i]) {
                (_, true) => {
                    ok = false;
                    break;
                }
                (prod, false) => {
                    if prod > 1_000_000_000_000_000_000 {
                        ok = false;
                        break;
                    }

                    prod
                }
            };
        }
    }

    if ok {
        println!("{}", prod);
    } else {
        println!("-1");
    }
}


Measured memory_bytes: 6588
def get_ints():
    return list(map(int, input().split()))

n = int(input())
a = get_ints()
b = get_ints()

total = 0

for i in range(n):
    l = min(b[i], a[i]);
    total += l;
    if b[i] > l:
        r = min(b[i] - l, a[i + 1])
        total += r
        a[i + 1] -= r

print(total)


Measured memory_bytes: 19116
r,D,x0=map(int,input().split())
def n(t):
  return r*t-D
x1=n(x0)
x2=n(x1)
x3=n(x2)
x4=n(x3)
x5=n(x4)
x6=n(x5)
x7=n(x6)
x8=n(x7)
x9=n(x8)
x10=n(x9)
print(x1)
print(x2)
print(x3)
print(x4)
print(x5)
print(x6)
print(x7)
print(x8)
print(x9)
print(x10)


    

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

const ll MOD = 1000000007;

class ModuloCombination {
private:
  vector<ll> fact, inv_fact;

  static ll modulo_power(ll a, ll n) {
    if(n == 0) return 1;
    if(n % 2 == 0) return modulo_power((a * a) % MOD, n / 2);
    return (a * modulo_power(a, n - 1)) % MOD;
  }

public:
  ModuloCombination(ll N): fact(N + 1), inv_fact(N + 1) {
    fact[0] = 1;
    REP(i, 1, N + 1) fact[i] = (i * fact[i - 1]) % MOD;
    REP(i, 0, N + 1) inv_fact[i] = modulo_power(fact[i], MOD - 2);
  }

  ll operator()(ll n, ll r) {
    return fact[n] * inv_fact[r] % MOD * inv_fact[n - r] % MOD;
  }
};

int main(void) {
  ll H, W, N;
  cin >> H >> W >> N;
  vector<ll> R(N), C(N);
  REP(i, 0, N) cin >> R[i] >> C[i], R[i]--, C[i]--;

  ModuloCombination comb(H + W);

  vector<vector<ll>> E(N);
  vector<ll> cnt(N);
  REP(i, 0, N) REP(j, 0, N) if (i != j) {
    if (R[i] <= R[j] && C[i] <= C[j]) {
      E[i].push_back(j);
      cnt[j]++;
    }
  }

  vector<vector<ll>> dp(N, vector<ll>(2, 0));
  REP(i, 0, N) dp[i][1] = comb(R[i] + C[i], R[i]);

  stack<ll> stk;
  REP(i, 0, N) if (cnt[i] == 0) stk.push(i);

  while (!stk.empty()) {
    ll v = stk.top();
    stk.pop();

    for (ll u : E[v]) {
      ll r = R[u] - R[v];
      ll c = C[u] - C[v];
      dp[u][0] += dp[v][1] * comb(r + c, r) % MOD;
      dp[u][0] %= MOD;
      dp[u][1] += dp[v][0] * comb(r + c, r) % MOD;
      dp[u][1] %= MOD;

      if (--cnt[u] == 0) {
        stk.push(u);
      }
    }
  }

  ll ans = comb((H - 1) + (W - 1), H - 1);
  REP(i, 0, N) {
    ll r = (H - 1) - R[i];
    ll c = (W - 1) - C[i];
    ans += dp[i][0] * comb(r + c, r) % MOD;
    ans %= MOD;
    ans += MOD - dp[i][1] * comb(r + c, r) % MOD;
    ans %= MOD;
  }
  cout << ans << endl;
}

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

double EPS = 1e-12;

int main(void)
{
	double x1, x2, x3, x4, y1, y2, y3, y4;
	while (cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4){
		if (fabs(((x2-x1)*(x4-x3))+((y2-y1)*(y4-y3))) <= EPS) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	
	return 0;
}

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

int main() {
    int N;
    cin >> N ;
    N++;
    
    vector<int64_t> A(N);
    
    A.at(0)=2;
    A.at(1)=1;
    
    
    for(int i=2;i<N;i++){
        
        A.at(i) = A.at(i-1) + A.at(i-2);
    }
    
    cout << A.at(N-1) << endl;
    
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long a,b,c,d=0;
    cin>>a;
    vector<long long>vc;
    b=a;
    while(b--)
    {
      cin>>c;
      d=d+c;
      vc.push_back(c);
    }
    sort(vc.begin(),vc.end());
    if(vc[vc.size()-1]>=d-vc[vc.size()-1])
        cout<<"No";
        else
        cout<<"Yes";



}


Measured memory_bytes: 256
/* ＵＴＦ－８ */
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <array>
#include <queue>
#include <stack>
#include <algorithm>
#include <tuple>
#include <numeric>
#include <type_traits>
#include <limits>

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>

#define USE_COLORED 1

#ifdef USE_COLORED
static const char stdout_pre[]  = "\033[1m"; // bold black
static const char stderr_pre[]  = "\033[31;1m"; // bold red
static const char stdxxx_post[] = "\033[m";

// 当然ながら GCC(g++)/libstdc++ 依存
#include <ext/stdio_filebuf.h>
using stdio_filebuf = __gnu_cxx::stdio_filebuf<char>;
class colored_stdio_filebuf : public stdio_filebuf {
private:
	const char* const pre_;
	const char* const post_;

public:
	colored_stdio_filebuf(FILE* fp, const char* pre, const char* post) : stdio_filebuf(fp, std::ios_base::out), pre_(pre), post_(post)
	{
	}

protected:
	std::streamsize xsputn(const char* s, std::streamsize count) override
	{
		stdio_filebuf::xsputn(pre_, strlen(pre_));
		auto ret = stdio_filebuf::xsputn(s, count);
		stdio_filebuf::xsputn(post_, strlen(post_));
		return ret;
	}
};
#endif

int main()
{
#ifdef USE_COLORED
	if (getenv("DEBUG")) {
		std::cout.rdbuf(new colored_stdio_filebuf(stdout, stdout_pre, stdxxx_post));
		std::cerr.rdbuf(new colored_stdio_filebuf(stderr, stderr_pre, stdxxx_post));
	} else
#endif
	{
		int fd = open("/dev/null", O_WRONLY);
		dup2(fd, 2);
		close(fd);
	}
	
	std::string c;
	std::cin >> c;
	std::string vowels = "aeiou";
	if (vowels.find(c[0]) != vowels.npos)
		std::cout << "vowel\n";
	else
		std::cout << "consonant\n";
}


Measured memory_bytes: 508
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define i_7 (ll)(1E9+7)
#define i_5 (ll)(1E9+5)
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    else return c+i_7;
}
typedef pair<int,int> i_i;
typedef pair<ll,ll> l_l;
ll inf=(ll)1E12;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll * pos,ll val){*pos=max(*pos,val);}//Max(&dp[i][j],dp[i-1][j]);
void Min(ll * pos,ll val){*pos=min(*pos,val);}
void Add(ll * pos,ll val){*pos=mod(*pos+val);}
const long double EPS=1E-8;
////////////////////////////////////////
#define MAX_V 30000//調節！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！
//辺を表す構造体{行き先、容量、逆辺}
struct edge{ll to,cap,rev;};
vector<edge> G[MAX_V];
bool used[MAX_V];//dfsですでに調べたかのフラグ
//fromからtoへの流量capの辺をグラフに追加
void add_edge(ll from,ll to,ll cap){
    //cout<<from<<" "<<to<<" "<<cap<<endl;
    G[from].push_back((edge){to,cap,static_cast<ll>(G[to].size())});
    G[to].push_back((edge){from,0,static_cast<ll>(G[from].size()-1)});
}
//増加パスをdfsで探す
ll dfs(ll v,ll t,ll f){
    if(v==t)return f;
    used[v]=true;
    for(ll i=0;i<G[v].size();i++){
        edge &e=G[v][i];
        if(!used[e.to]&&e.cap>0){
            ll d=dfs(e.to,t,min(f,e.cap));
            if(d>0){
                e.cap-=d;
                G[e.to][e.rev].cap+=d;
                return d;
            }
        }
    }
    return 0;
}
ll max_flow(ll s,ll t){
    ll flow=0;
    while(1){
        memset(used,0,sizeof(used));
        ll f=dfs(s,t,inf);
        if(f==0)return flow;
        flow+=f;
    }
}
///////////////////////////////////////

ll h,w;
void add(ll s,ll t){
    add_edge(s+h*w,t,inf);
    add_edge(t+h*w,s,inf);
}

int main(){
    cin>>h>>w;
    string q[h];rep(i,0,h-1)cin>>q[i];
    rep(i,0,h-1){
        rep(j,0,w-2){
            ll s=i*w+j;
            ll t=i*w+j+1;
            add(s,t);
        }
    }
    rep(j,0,w-1){
        rep(i,0,h-2){
            ll s=i*w+j;
            ll t=(i+1)*w+j;
            add(s,t);
        }
    }
    ll sta=2*h*w,end=2*h*w+1;
    rep(i,0,h-1){
        rep(j,0,w-1){
            ll s=i*w+j;
            if(q[i][j]=='X'){
                add_edge(sta,s,inf);
                add_edge(s,s+h*w,inf);
            }else{
                add_edge(s,s+h*w,1);
            }
        }
    }
    rep(i,0,h-1){
        ll s=i*w+0;
        ll t=i*w+w-1;
        add_edge(s+w*h,end,inf);
        add_edge(t+w*h,end,inf);
    }
    rep(j,1,w-2){
        ll s=0*w+j;
        ll t=(h-1)*w+j;
        add_edge(s+w*h,end,inf);
        add_edge(t+w*h,end,inf);
    }
    ll c=max_flow(sta,end);
    //cout<<sta<<" "<<end<<endl;
    if(c>=inf)cout<<-1<<endl;
    else cout<<c<<endl;
    return 0;
}


Measured memory_bytes: 6972
#include <bits/stdc++.h>
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
using Int = long long;
const char newl = '\n';

//INSERT ABOVE HERE
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);

  int n;
  cin>>n;

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

  int x=accumulate(as.begin(),as.end(),0,[](int a,int b){return a^b;});

  for(int i=0;i<n;i++){
    if(i) cout<<' ';
    cout<<(as[i]^x);
  }
  cout<<newl;
  return 0;
}


Measured memory_bytes: 3972
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <set>
#include <queue>
using namespace std;
#define ll long long
#define rep(i, n) for(int i = 0; i < n; i++)

int main() {
    int n;
    cin >> n;
    vector<string> s(n);
    rep(i, n) cin >> s[i];
    sort(s.begin(), s.end());
    s.erase(unique(s.begin(), s.end()), s.end());
    cout << s.size() << endl;
    return  0;
}

Measured memory_bytes: 9600
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
const ll INF = 1e16;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)

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

void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}
//--------------------------------------------------------------------------------//
//i番目の文字を中心とする最長の回文の長さ(直径)
//「aaabb」→ 「# a # a # a # b # b #」に変換して
//        　 「0,1,2,3,2,1,0,1,2,1,0」を返す
vector<ll> longest_palindrome(string S){
    char c = '#'; //間に挟む文字
    // ll c = -1; //数列ならこっち
    
    ll N = S.size();
    vector<char> s(2 * N + 1); //文字列用
    // vector<ll> s(2 * N + 1); //数列用
    rep(i,2*N+1){
        if(i&1) s[i] = S[i/2];
        else    s[i] = c;
    }

    ll i = 0, j = 0;
    vector<ll> len(2*N+1); //両隣に門番を挟むと2*N+1の長さ
    while(i<2*N+1){
        while (i - j >= 0 && i + j < 2 * N + 1 && s[i - j] == s[i + j]) ++j;
        len[i] = j;
        ll k = 1;
        while (i - k >= 0 && i + k < 2 * N + 1 && k + len[i - k] < j) len[i + k] = len[i - k], ++k;
        i += k;
        j -= k;
    }

    rep(i, 2 * N + 1) len[i]--; //門番分の調整
    return len;
}

// len_i ∈ [0, 2*N + 1) 番目の回文文字列を得る
string ret_palindrome(string S, vector<ll> len, ll len_i){  //文字列S, longest_palindromeの配列len, 何番目の回文を得るかのlen_i
    string rets;
    rets = S.substr(len_i / 2 - len[len_i], len[len_i]);
    return rets;
}

int main() {
    init();
    string S;
    cin>>S;
    ll N=S.size();

    vl len=longest_palindrome(S);
    bool isok = len[N / 2] == N / 2;
    
    cout<<(len[N]==N and isok and S.substr(0,N/2)==S.substr((N+1)/2)?"Yes":"No")<<endl;
}

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

using namespace std;

long long solve(vector<long long>&v)
{
  vector<long long> dp(v.size());
  dp[0]=0;
  for(int i=1;i<v.size();i++)
  {
    dp[i]=min(dp[i-1]+abs(v[i]-v[i-1]),(i>=2)?(dp[i-2]+abs(v[i]-v[i-2])):INT_MAX);
  }
  return dp[dp.size()-1];
}

int main()
{
  int n;
  cin>> n;
  vector<long long> v(n);
  for(int i=0;i<n;i++)
  {
    cin>>v[i];
  }
  cout<<solve(v);
  return 0;
}


Measured memory_bytes: 4768
def resolve():
    N = int(input())
    A = list(map(int, input().split()))

    flag = True
    for a in A:
        if a % 2 == 0:
            if a % 3 == 0 or a % 5 == 0:
                pass
            else:
                flag = False

    res = "APPROVED" if flag else "DENIED"
    print(res)

if __name__ == "__main__":
    resolve()

Measured memory_bytes: 3060
#include <algorithm>
#include <climits>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <vector>

#define int long long int
constexpr int INF = std::numeric_limits<int>::max();
constexpr int NINF = std::numeric_limits<int>::min();
using namespace std;

void solve() {
  int A, B, K;
  cin >> A >> B >> K;

  int da = min(A, K);
  A = A-da;
  K = K-da;
  B = max((long long)0, B-K);

  cout << A << " " << B << endl;
}

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


Measured memory_bytes: 3148
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x,n,y;
    cin>>x>>n;
    vector<int>v;
    for(int i=0;i<n;i++)
    {
        cin>>y;
        v.push_back(y);
    }
    for(int i=0;i<=x;i++)
    {
        if(find(v.begin(),v.end(),(x-i))==v.end())
        {
            cout<<(x-i)<<endl;
            break;
        }
        else
        {
            if(find(v.begin(),v.end(),(x+i))==v.end())
            {
                cout<<(x+i)<<endl;
                break;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 3580
N,M = map(int,input().split())
x=[]
y=[]
z=[]
for i in range(N):
    xi,yi,zi = map(int,input().split())
    x.append(xi)
    y.append(yi)
    z.append(zi)
ppp =[]
ppm =[]
pmp =[]
mpp =[]
mmp =[]
mpm =[]
pmm =[]
mmm =[]
for i in range(N):
    xp = x[i]
    xm = -x[i]
    yp = y[i]
    ym = -y[i]
    zp = z[i]
    zm = -z[i]
    ppp.append(xp+yp+zp)
    ppm.append(xp+yp+zm)
    pmp.append(xp+ym+zp)
    mpp.append(xm+yp+zp)
    mmp.append(xm+ym+zp)
    mpm.append(xm+yp+zm)
    pmm.append(xp+ym+zm)
    mmm.append(xm+ym+zm)
ppp.sort(reverse=True)
ppm.sort(reverse=True)
pmp.sort(reverse=True)
mpp.sort(reverse=True)
mmp.sort(reverse=True)
mpm.sort(reverse=True)
pmm.sort(reverse=True)
mmm.sort(reverse=True)
print(max(sum(ppp[0:M]),sum(ppm[0:M]),sum(pmp[0:M]),sum(mpp[0:M]),sum(mmp[0:M]),sum(mpm[0:M]),sum(pmm[0:M]),sum(mmm[0:M])))


Measured memory_bytes: 39024
in_len = input().split(" ")

in_n = int(in_len[0])
in_k = int(in_len[1])
in_h = input().split(" ")
out = 0

sort_h = sorted(in_h, reverse=True, key=int)
i = in_k

while i < in_n:
  out += int(sort_h[i])
  i += 1

print(out)

Measured memory_bytes: 28228
#include<stdio.h>
#include<math.h>
int main (void){
    long int x;
    long int y;
    int cnt = 0;
    long int n,d;
    scanf("%ld %ld",&n,&d);
    for(int i=0;i<n;i++){
        scanf("%ld %ld",&x,&y);
        if(x*x+y*y<=d*d)cnt ++;
    }
    printf("%d",cnt);
    return 0;
}

Measured memory_bytes: 1736
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
	// input1 = input[0].split('').map((n) => (parseInt(n)))
	// input[0].split(' ').map((n) => (parseInt(n)))
	// input[2].split(' ').map((n) => (parseInt(n)))
	// ans = input.filter((n) => (s <= n)).length
	// inputarr = input1
	// cont = true
	s = input[0]
	var ex = 0
	ans = 0
  s0 = s.match(/0/g) || []
  s1 = s.match(/1/g) || []
  ans =  s.length - (Math.abs(s0.length - s1.length))
	//出力
	console.log(ans)
}
// *この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
// Main(require('fs').readFileSync('./input.txt', 'utf-8'));

Measured memory_bytes: 9292
#include <iostream>
#include <string>
#include <utility>

using namespace std;

int num[1000];
string stri[1000];
int n;

void fanc(int loc, int deep)
{
	for (int i = 0; i<n; ++i)
	{
		if (num[i] == loc)
		{
			cout << string(deep, '.') << stri[i] << "\n";
			fanc(i+1, deep + 1);
		}
	}
}

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

	fanc(0, 0);

	return 0;
}

Measured memory_bytes: 1384
import java.util.*;
import java.util.Collections;
import java.util.ArrayList;
 
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
 
        String S = sc.next();
        int l = S.length();
        ArrayList<String> list = new ArrayList<String>();

        for(int i=0; i<l; i++){
            list.add(String.valueOf(S.charAt(i)));
        }

        Collections.sort(list);
        int x = 1;
        for(int i=1; i<l; i++){
            if(list.get(i).equals(list.get(i-1))){
                x += 1;
            }
            else{
                break;
            }
        }
        System.out.println(2 * Math.min(x, l - x));
    }
}

Measured memory_bytes: 30164
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong(), k=sc.nextLong();
		sc.close();
		final long MOD = 1000000007;
		long ans=0;
		for(int i=0;k+i<=n+1;i++) {
			long temp = (n-k-i+1)*(k+i)%MOD+1;
			ans+=temp;
			ans%=MOD;
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 35672
#include <stdio.h>
int main(void){
    int n,x,i,j,k,a;
    while(1){
        scanf("%d %d",&n,&x);
        if(n==0&x==0) break;
        a=0;
        for(i=1;i<=n;i++){
            for(j=i+1;j<=n;j++){
                for(k=j+1;k<=n;k++){
                     if(i+j+k==x) a++;
                }
            }
        }
        printf("%d\n",a);
    }
    return 0;
}


Measured memory_bytes: 2100
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pr pair<int,int>
#define mod 1000000007
#define endl "\n"

int power(int a,int b)
{
	if(b==1)	return a;
	int res=power(a,b/2);
	res=(res*res)%mod;
	if(b%2)	res=(res*a)%mod;
	return res;
}

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

void subtract(int &a,int b)
{
	a=(a-b+mod)%mod;
}

void solve()
{
	int n,i,j,k,x;
	cin>>n>>k;
	int a[k+1],ans=0;
	for(i=k;i>0;i--)
	{
		x=k/i;
		a[i]=power(x,n);
		for(j=2*i;j<=k;j+=i)
			subtract(a[i],a[j]);
		add(ans,(a[i]*i)%mod);
	}
	cout<<ans<<endl;
}
 
int32_t main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
    	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}

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

int main() {
  double a, b;
  cin >> a >> b;
  
  if ((int)a % 2 == (int)b % 2) {
     cout << (a + b) / 2;
  } else {
 	 cout << (a + b) / 2 + 0.5;
  }
}

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

int main() {
  long long a,b,c;
  cin >> a >> b >> c;
  if(a<b){
    if(c<a) cout << c <<" "<< a <<" "<< b <<endl; 
    else if(b<c) cout << a <<" "<< b <<" "<< c << endl;
    else if(a<c && c<b) cout << a <<" "<< c <<" "<< b << endl;
  }
  
  else if(b<c){
    if(c<a) cout << b <<" "<< c <<" "<< a << endl;
    else if(a<b) cout << a <<" "<< b <<" "<< c << endl;
    else if(b<a && a<c) cout << b <<" "<< a <<" "<< c << endl;
  }
  
  else if(c<a){
    if(c<b && b<a) cout << c <<" "<< b <<" "<< a << endl;
    else if(b<c) cout << b <<" "<< c <<" "<< a << endl;
    else if(a<b) cout << c <<" "<< a <<" "<< b << endl;
  }
  
  else if(a==b && b==c) cout << a <<" "<< b <<" "<< c << endl;
  
   if(a==b){
    if(c<a || c<a) cout << c <<" "<< a <<" "<< b << endl;
    else cout << a <<" "<< b <<" "<< c << endl;
  }
  
   else if(b==c){
    if(a<b || a<c) cout << a <<" "<< b <<" "<< c << endl;
    else cout << b <<" "<< c <<" "<< a << endl;
  }
  
   else if(c==a){
    if(b<c || b<a) cout << b <<" "<< c <<" "<< a << endl;
    else cout << c <<" "<< c <<" "<< b << endl;
  }
  
  return 0;
}



Measured memory_bytes: 3124
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MAX=1e12;
ll mod=1e9+7;
#define pb push_back
#define se second
#define fi first
#define maxe max_element
#define mine min_element
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<endl;
#define debug4(x,y,z,w) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\t"<<#w<<" :: "<<w<<endl;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define boost  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
vector<int> graph[205];
int color[205];
int nCk[100][100];
bool bipartite_jugding(int v, int c){
    color[v] = c;
    for(int i = 0; i < graph[v].size(); ++i){
        if(color[graph[v][i]] == c) return false;
        if(color[graph[v][i]] == 0 && !bipartite_jugding(graph[v][i], -c)){
            return false;
        }
    }
    return true;
}

 void combi() {
	for (int i = 0; i <= 99; ++i) nCk[i][0] = 1;
	for (int i = 1; i <= 99; ++i) for (int j = 1; j <= i; ++j) {
		nCk[i][j] = (nCk[i-1][j] + nCk[i-1][j-1]) % mod;
	}
}

long long expo(ll x,ll n,ll M)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return expo((x*x)%M,n/2,M);
    else                             //n is odd
        return (x*expo((x*x)%M,(n-1)/2,M))%M;

}

void solve(){
  int n;
  cin>>n;string s;
  vector<pair<string,int> > v(n);
  for(int i=0;i<n;i++)
      cin>>v[i].fi>>v[i].se;
    cin>>s;ll ans=0;
  for(int i=0;i<n;i++)
  {
      if(s==v[i].fi)
      {
          for(int j=i+1;j<n;j++)
            ans+=v[j].se;
        break;
      }
  }
  cout<<ans;
}

int main(){
    boost;
  solve();
}


Measured memory_bytes: 256
import java.util.*;
public class Main  {
   public static void main(String[] args)  {
      Scanner sc = new Scanner(System.in);
      
      int n = sc.nextInt();
      int m = sc.nextInt();
      
      int a[] = new int[n];
      
      int sum = 0;
      
      for (int i = 0; i < n; i++) {
         int aa = sc.nextInt();
         a[i] = aa;
         sum += aa;
      }
      
      double x = sum * 100 / (4*m);
      
      int t = 0;
      
      for (int j = 0; j < n; j++) {
         int aaa = a[j];
         if (aaa*100 == x || aaa*100 > x) {
            t++;
         }
      }
      
      if (t == m || t > m) {
         System.out.println("Yes");
      } else {
         System.out.println("No");  
      }
   }        
}

Measured memory_bytes: 23892
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <cmath>   
#include<cctype>
#include<string>
#include<set>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
#define all(x) (x).begin(),(x).end()
#define rep(i,m,n) for(int i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(int i = m;i >= n;--i)
#define INF INT_MAX/2
using namespace std;
using ll = long long;
using R = double;
const ll inf = 1LL << 50;
const ll MOD = 1e9 + 7;
struct edge { ll from; ll to; ll cost; };


int main(){
	int h, w, d;
	cin >> h >> w >> d;
	vector<pair<int,int>>data(h*w+1);

	rep(i, 0, h)rep(j, 0, w) {
		int a;
		cin >> a;
		data[a] = {i,j};
	}
	vector<int>sum(h*w + 1,0);

	for (int i = 1; i <= h * w; i++) {
		if (i <= d)continue;
		else {
			int x1 = data[i - d].first;
			int y1 = data[i - d].second;
			int x2 = data[i].first;
			int y2 = data[i].second;
			sum[i] = sum[i - d] + abs(x1-x2) + abs(y1-y2);
		}
	}

	int q;
	cin >> q;
	rep(i, 0, q) {
		int l, r;
		cin >> l >> r;
		cout << sum[r] - sum[l] << endl;
	}



	return 0;
}

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

using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef long double ld;
typedef tree<ll,null_type,less<ll>,rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define int ll
#define endl "\n"
#define all( x ) x.begin(), x.end()
#define fast ios::sync_with_stdio(0);cin.tie(0);

typedef unsigned long long ull;

const int inf = 1e9 + 5;
const long double PI = 3.141592653589793;

void solve(){
  string s;
  cin >> s;
  cout << ((s[2] == s[3] && s[4]==s[5]) ? "Yes":"No") << endl;
  return;
}  
signed main(){
  fast;
  int t;
  t = 1;
  //cin>>t;
  while(t--){
    solve();
  }
}

Measured memory_bytes: 3636
//なるべく浮動小数点数を使わない！
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
  ll a, b, c;
  cin >> a >> b >> c;
  
  if(c-a-b < 0)
  {
    cout << "No" << endl;
    return 0;
  }
  
  if(4*a*b < (c-a-b)*(c-a-b))
  {
    cout << "Yes" << endl;
  }
  else
  {
    cout << "No" << endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
import fractions
from functools import reduce
n,m=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n):
    a[i]=a[i]//2
def lcm_base(x,y):
    return (x*y)//fractions.gcd(x,y)
def lcm_list(numbers):
    return reduce(lcm_base,numbers,1)
f2=lcm_list(a)

ans=0
for i in range(n):
    if f2//a[i]%2!=1:
        print(ans)
        break
else:
    ans=m//f2
    print((ans+1)//2)


Measured memory_bytes: 89580
#include <bits/stdc++.h>
#pragma GCC optimize ("O2")
#pragma GCC optimize ("unroll-loops")
//#pragma GCC optimize("no-stack-protector,fast-math")

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef pair<ll, ll> pll;
#define debug(x) cerr<<#x<<'='<<(x)<<endl;
#define debugp(x) cerr<<#x<<"= {"<<(x.first)<<", "<<(x.second)<<"}"<<endl;
#define debug2(x, y) cerr<<"{"<<#x<<", "<<#y<<"} = {"<<(x)<<", "<<(y)<<"}"<<endl;
#define debugv(v) {cerr<<#v<<" : ";for (auto x:v) cerr<<x<<' ';cerr<<endl;}
#define all(x) x.begin(), x.end()
#define pb push_back
#define kill(x) return cout<<x<<'\n', 0;

const ld eps=1e-7;
const int inf=1000000010;
const ll INF=10000000000000010LL;
const int mod=1000000007;
const int MAXN=100010, LOG=20;

ll n, m, k, u, v, x, y, t, a, b, ans, root, sum;
ll sz[MAXN];
vector<pii> G[MAXN]; 

int dfs(int node, int par){
	sz[node]=1;
	for (pii p:G[node]) if (p.first!=par) sz[node]+=dfs(p.first, node);
	return sz[node];
}

int Centroid(int node, int par){
	for (pii p:G[node]) if (p.first!=par && 2*sz[p.first]>n) return Centroid(p.first, node);
	return node; 
}

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin>>n;
	for (int i=1; i<n; i++){
		cin>>u>>v>>x;
		G[u].pb({v, x});
		G[v].pb({u, x});
	}
	dfs(1, 0);
	root=Centroid(1, 0);
	dfs(root, 0);
	for (int u=1; u<=n; u++) if (u!=root)
		for (pii p:G[u]) if (sz[p.first]>sz[u]) sum+=2*sz[u]*p.second;
	
	//debug(sum)
	for (pii p:G[root]){
		if (2*sz[p.first]==n) kill(sum-p.second)
		ans=max(ans, sum-p.second);
	}
	cout<<ans<<'\n';
	
	return 0;
}
/*
3
1 2 0
2 3 10

*/

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

int main(){
  int n,k;
  char ary[50];
  cin>>n>>k;
  cin>>ary;
  if(ary[k-1]=='A')ary[k-1]='a';
  if(ary[k-1]=='B')ary[k-1]='b';
  if(ary[k-1]=='C')ary[k-1]='c';
  cout<<ary;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include<string.h>
#include<assert.h>

typedef long long ull;
typedef unsigned long long ll;

#define mod 1000000007LL

int main()
{
    int n;
    ll* a;
    ll sum = 0, b, m;
    scanf("%d", &n);
    a = calloc(n, sizeof(ll));
    for (size_t i = 0; i < n; i++)
    {
        scanf("%lld", a + i);
    }

    b = 1;
    for (size_t i = 0; i < 61; i++)
    {
        m = 0;
        for (size_t j = 0; j < n; j++)
        {
            m += !!(a[j] & b);
        }
        sum += ((((b % mod) * m) % mod) * (n - m)) % mod;
        sum %= mod;
        b <<= 1;
    }

    printf("%lld", sum);

    return 0;
}



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

using namespace std;

int main()
{
  string n;
  cin >> n;
  cout << ((n[0] == n[1] && n[1] == n[2] || n[1] == n[2] && n[2] == n[3]) ? "Yes" : "No") << endl;

  return 0;
}


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

s = input()
n = len(s)
s_list = []

for i in range(0, n):
    if s[i] == 'B':
        if len(s_list) == 0:
            continue
        else:
            s_list.pop(-1)
    else:
        s_list.append(s[i])

S = ''
for i in range(0, len(s_list)):
    S = S + s_list[i]

print(S)



Measured memory_bytes: 3060
#include <bits/stdc++.h> 
using namespace std;
const long INF=1000000000000000;
const long MOD=1000000007;

int main() {
    long X,A,B;
    cin>>X>>A>>B;
    
    if(B<=A) cout<<"delicious"<<endl;
    else if(B-A<=X) cout<<"safe"<<endl;
    else cout<<"dangerous"<<endl;
}


Measured memory_bytes: 256
N, M = map(int, input().split())
xyz = [list(map(int, input().split())) for _ in range(N)]
ans = 0
for i in range(8):
    tmp = 0
    if i == 0:
        tmp = [x+y+z for x, y, z in xyz]
    if i == 1:
        tmp = [-x+y+z for x, y, z in xyz]
    if i == 2:
        tmp = [x-y+z for x, y, z in xyz]
    if i == 3:
        tmp = [-x-y+z for x, y, z in xyz]
    if i == 4:
        tmp = [x+y-z for x, y, z in xyz]
    if i == 5:
        tmp = [-x+y-z for x, y, z in xyz]
    if i == 6:
        tmp = [x-y-z for x, y, z in xyz]
    if i == 7:
        tmp = [-x-y-z for x, y, z in xyz]
    
    a = 0
    tmp.sort(reverse=True)
    for t in tmp[:M]:
        a += t
    ans = max(ans, a)
print(ans)


Measured memory_bytes: 39792
n = int(input())
t = list(map(int,input().split()))
m = int(input())
l = [list(map(int,input().split())) for i in range(m)]
a,b = [list(i) for i in zip(*l)]
for i in range(m):
    s = list(t)
    j = a[i] - 1
    s[j] = b[i]
    print(sum(s))

Measured memory_bytes: 9192
#include<iostream>
#include<vector>
#define MAX 100000
using namespace std;
int main(){
    vector<bool> v(MAX);
    for(int i = 0;i<MAX;i++)
      v[i]=true;

      v[0]=v[1]=false;
    for(int i = 2;i<1000;i++){
      if(v[i]){
        for(int j=i*i;j<MAX;j+=i){
         v[j]=false;
       }
      }
    }
    while(true){
      int a;
      cin >> a;
      if(cin.eof())return 0;
      for(int i = a-1;true;i--){
        if(v[i]){
          cout << i <<' ';
          break;
      }
    }
    for(int i = a+1;true;i++){
      if(v[i]){
        cout <<i<<endl;
        break;
     }
   }
 }
}



Measured memory_bytes: 2988
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text.RegularExpressions;
using System.Diagnostics;

//var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
namespace AtCoderSolve
{
    
    class Solve
    {
        const int mod = 1000000007;
        static int N, A, B, C;
        static int[] l;

        const int INF = 1000000000;
        
        public static void Input()
        {
            var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
            N = input[0];
            A = input[1];
            B = input[2];
            C = input[3];
            l = new int[N];
            for(var i = 0; i < N; i++)
            {
                l[i] = int.Parse(Console.ReadLine());
            }
        }

        static void Main(string[] args)
        {
            Input();
            //var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            //Console.SetOut(sw);

            
            Console.WriteLine(Dfs(0, 0, 0, 0));

            //Console.Out.Flush();

            

        }

        public static long Dfs(int cur, int a, int b, int c)//使用本数、aの竹、bの竹、cの竹の長さ
        {
            if (cur == N)
            {
                return Math.Min(a, Math.Min(b, c)) > 0 ? Math.Abs(a - A) + Math.Abs(b - B) + Math.Abs(c - C) - 30 : INF;//1本目として選んだ時にも１０消費しているので引く
            }

            long r0 = Dfs(cur + 1, a, b, c);
            long r1 = Dfs(cur + 1, a + l[cur], b, c) + 10;
            long r2 = Dfs(cur + 1, a, b + l[cur], c) + 10;
            long r3 = Dfs(cur + 1, a, b, c + l[cur]) + 10;

            return Math.Min(Math.Min(r0, r1), Math.Min(r2, r3));

        }

    }

    
}



Measured memory_bytes: 13396