akhauriyash/Code-Regression huggingface dataset:
#include <cassert>
#include <iostream>
#include <string>
#include <list>

class TDllist
{
    std::list<int> FList;
public:
    void Insert(int X)
    {
        FList.push_front(X);
    }
    void Delete(int X)
    {
        for(std::list<int>::iterator It = FList.begin();
            It != FList.end();
            ++It)
        {
            if(*It == X){
                FList.erase(It);
                return;
            }
        }
    }
    void DeleteFirst()
    {
        FList.pop_front();
    }
    void DeleteLast()
    {
        FList.pop_back();
    }
    void Show()const
    {
        std::list<int>::const_iterator It = FList.begin();
        std::cout << *It;
        for(++It; It != FList.end(); ++It)
        {
            std::cout << " " << *It;
        }
        std::cout << std::endl;
    }
};

int main()
{
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    TDllist List;
    int n, X;
    std::cin >> n;
    std::string Command;
    for(int i = 0; i < n; ++i){
        // std::string Command;
        std::cin >> Command;
        if(Command == "insert"){
            // int X;
            std::cin >> X;
            List.Insert(X);
        }else
        if(Command == "delete"){
            // int X;
            std::cin >> X;
            List.Delete(X);
        }else
        if(Command == "deleteFirst")
        {
            List.DeleteFirst();
        }else
        if(Command == "deleteLast")
        {
            List.DeleteLast();
        }else{
            assert(false);
        }
    }
    List.Show();
    return 0;
}

Measured memory_bytes: 32476
#include<iostream>
#include<cstdio>
#include<cstring>

using namespace std;

const int INF = 0x7fffffff;
const int N = 105;

char qwq[N];

int main()
{
	scanf("%s",qwq+1);
	printf("%c%d%c",qwq[1],strlen(qwq+1)-2,qwq[strlen(qwq+1)]);
	
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <vector>

using namespace std;
using ll = long long int;

int main() {
  int N, K;
  cin >> N >> K;
  vector<ll> mp(N + 1, 0);

  ll type = 0;

  for (size_t _ = 0; _ < N; _++) {
    ll ai;
    cin >> ai;
    if (mp[ai] == 0) {
      type++;
    }
    mp[ai] = mp[ai] + 1;
  }

  sort(mp.begin(), mp.end());
  ll ans = 0;
  for (auto&& e : mp) {
    if (e == 0) {
      continue;
    }
    if (type <= K) {
      break;
    }
    ans += e;
    type--;
  }
  cout << ans << endl;
}

Measured memory_bytes: 1792
#include <stdio.h>

int main()
{
    char s[110];
    scanf("%s",s);
    int len=0;
    for(;;len++) if(s[len]=='\0') break;

    int ans=0;
    for(int i=0;i<len-i-1;i++)
    {
        if(s[i]!=s[len-i-1]) ans++;
    }
    printf("%d\n",ans);
}

Measured memory_bytes: 128
//Program.cpp
//Author : Aaryan Srivastava 
#include <bits/stdc++.h>
#include <random>
#include <chrono>
#define pb push_back
#define popb pop_back
#define ull unsigned long long  
#define beg begin
#define mp make_pair
#define pii pair<int, int>
#define piii pair<pii,int>
#define rep(i,n) for(int (i) = 0 ; i < (n) ; i++)
#define repA(i,x,y) for(int i = (x) ; i <= (y) ; i++)
#define repD(i,x,y) for(int i = (x) ; i >= (y) ; i--)
#define all(c) (c).begin(),(c).end()
#define ff first
#define ss second 
#define fill(a,val) memset(a,val,sizeof(a))
#define Randomize mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
using ll = long long;
#define int ll
const int N = 2*1e5 +5 ;
const int mod = 1e9 + 7 ;
const int inf = 1e18 ;
const int SZ = 101 ;
const double eps = 1e-9 ;
using namespace std;
#ifdef AaryanS
#define mycout cout
#define mycerr cerr 
#endif

#ifndef AaryanS
#define mycout if(false) cout
#define mycerr if(false) cerr
#define AaryanS 0 
#endif

int dp[22][(1<<21)+5];
void solve()
{
	int n;
	cin >> n;
	vector<vector<int>> a(n,vector<int>(n));
	a.resize(n);
	for(auto &v : a) for(auto &it : v) cin >> it ;
	dp[0][0] = 1; 
	//for(int i = 0 ; i < n ; ++i){
	for(int mask = 0 ; mask < (1 << n) - 1; ++mask){
		int i = __builtin_popcount(mask) ;
		for(int j = 0; j < n ; ++j){
			if(a[i][j] && !(mask&(1<<j))){
				dp[i+1][mask|(1<<j)] += dp[i][mask]; 
				dp[i+1][mask|(1<<j)] %= mod;
			}
		}
	}
	//for(int i = 0 ; i <= n ; ++i) for(int mask = 0 ;mask < (1<<n) ; ++mask) cout << dp[i][mask] << " \n"[mask==((1<<n)-1)] ;
	cout << dp[n][(1<<(n))-1] << endl ;
}

     
int32_t main(int32_t argc, char *argv[])
{
    double t1 = clock() ;
    ios::sync_with_stdio(0);    
    cin.tie(0); cout.tie(0);
    int TC = 1, t = 0;
    //cin >> TC ;
    while(t++ < TC)
    {
        //cout << "Case " << t << ":\n" ;
        solve();
    }
    mycerr << "Time : " << 1000 *(clock() - t1)/CLOCKS_PER_SEC << " ms\n" ;
    return 0;
}


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

int i;
int main(void)
{
    char s[100001];
    char t[4][8]={"maerd","remaerd","esare","resare"};// <-4種
    char tmp;
    scanf("%s",s);
    int len_s=(int)strlen(s);
    for(int k=0;k<len_s/2;k++){
        tmp=s[k];
        s[k]=s[len_s-1-k];
        s[len_s-1-k]=tmp;
    }
    while(s[0]){
        int a=0;//aの値をリセット
        for(i=0;i<4;i++){
            int c=0,same=0;//カウントをリセット
            for(int j=0;t[i][j]!='\0';j++){
                c++;
                if(s[j]==t[i][j]){
                    same++;
                }
            }
            if(c==same){//tの文字列の長さと同じだけ一致してたら
                a=same;//aにsameを保存
            }
        }
        if(a==0){
            printf("NO\n");
            return 0;
        }
        for(int j=0;s[j]!='\0';j++){//4種と比べ終わったら
            s[j]=s[j+a];
        }
    }
    printf("YES\n");
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define re register int
#define F(x,y,z) for(re x=y;x<=z;x++)
#define FOR(x,y,z) for(re x=y;x>=z;x--)
typedef long long ll;
#define I inline void
#define IN inline int
#define STS system("pause")
template<class D>I read(D &res){
	res=0;register D g=1;register char ch=getchar();
	while(!isdigit(ch)){
		if(ch=='-')g=-1;
		ch=getchar();
	}
	while(isdigit(ch)){
		res=(res<<3)+(res<<1)+(ch^48);
		ch=getchar();
	}
	res*=g;
}

int n,h,fa[440],A,B,C,D,in[440],out[440],f[440];
IN find(int x){return fa[x]==x?x:fa[x]=find(fa[x]);}
I merge(int x,int y){
	x=find(x);y=find(y);if(x==y)return;fa[x]=y;
}
int main(){
	read(n);read(h);
	F(i,1,h<<1)fa[i]=i;
	F(i,1,n){
		read(A);read(B);read(C);read(D);
		re x,y;
		x=C?C+h:A;y=D?D:B+h;
		out[x]++;in[y]++;
		merge(x,y);
	}
	F(i,1,h)if(in[i]>out[i])return !printf("NO");
	F(i,h+1,h<<1)if(in[i]<out[i])return !printf("NO");
	F(i,1,(h<<1))if(in[i]^out[i]||(!in[i]&&!out[i]))f[find(i)]=1;
	F(i,1,(h<<1))if(fa[i]==i&&!f[i])return !printf("NO");
	printf("YES");
	return 0;
}



Measured memory_bytes: 3708
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
signed main(){
  double l,r;
  int ans[2][4]={};
  while(cin>>l>>r){
    if(l>=1.09) ans[0][0]++;
    else if(l>=0.59) ans[0][1]++;
    else if(l>=0.19) ans[0][2]++;
    else  ans[0][3]++;

    
    if(r>=1.09) ans[1][0]++;
    else if(r>=0.59) ans[1][1]++;
    else if(r>=0.19) ans[1][2]++;
    else  ans[1][3]++;
  }
  for(int i=0;i<4;i++){
    cout<<ans[0][i]<<" "<<ans[1][i]<<endl;
  }
  return 0;
}

Measured memory_bytes: 3116
#include<stdio.h>
int main(void){
	int h,w;
	int c[10][10]={0};
	int a;
	int i,j,k;
	int ans=0;
	scanf("%d%d",&h,&w);
	for(j=0;j<10;j++){
		for(i=0;i<10;i++){
			scanf("%d",&c[j][i]);
		}
	}
	for(i=0;i<10;i++){
		for(j=0;j<10;j++){
			for(k=0;k<10;k++){
				if(c[j][k]>c[j][i]+c[i][k]) c[j][k]=c[j][i]+c[i][k];
			}
		}
	}
	for(j=0;j<h;j++){
		for(i=0;i<w;i++){
			scanf("%d",&a);
			if(a!=-1) ans+=c[a][1];
		}
	}
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, m, n) for(int i = (m); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1e9)
#define PI (acos(-1))
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl


int main() {
    int N;  cin >> N;
    print(360 * (N-2) / 2);
}



Measured memory_bytes: 256
S=input()
if S=="SUN":
  print(7)
elif S=="MON":
  print(6)
elif S=="TUE":
  print(5)
elif S=="WED":
  print(4)
elif S=="THU":
  print(3)
elif S=="FRI":
  print(2)
elif S=="SAT":
  print(1) 

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {

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

        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();

        int count = 0;
        if (a == b) {
            count++;
        }
        if (a == c) {
            count++;
        }
        if (b == c) {
            count++;
        }
        System.out.println(count == 1 ? "Yes" : "No");
    }
}

Measured memory_bytes: 23764
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', a);

var flag = false;

function a(line) {
  if ((flag = !flag)) return;

  const arr = line.split(' ').map(i => parseInt(i));

  var status = 0;
  var count = 1;

  arr.reduce((prev, current)=> {
    const sign = Math.sign(prev - current);

    if (sign) {
      if (!status) {
        status = sign;
      } else if (sign != status) {
        status = 0;
        count++;
      }
    }

    return current;
  });
  console.log(count);
}

Measured memory_bytes: 27968
import math
def get_while(n):
    ts = [0]
    ans = [[0, 0]]
    for _ in range(n):
        s = list(map(lambda x: int(x), input().split(" ")))
        ts.append(s[0])
        ans.append([s[1], s[2]])
    return ts, ans

def get_distance(p1, p2):
    return abs(p1[0] - p2[0]) + abs(p1[1] - p2[1])

def solve(ts, ps, n):
    for x in range(n):
        d = get_distance(ps[x], ps[x+1])
        if ((ts[x+1] - ts[x]) - d) < 0:
            return "No"
        if ((ts[x+1] - ts[x]) - d) % 2 != 0:
           return "No"
    return "Yes"
        

if __name__ == '__main__':
    n = int(input())
    ts, ps = get_while(n)
    print(solve(ts, ps, n))


Measured memory_bytes: 20748
import java.io.*;
import java.util.*;
import java.math.*;

public class Main {
    public static void main(String[] args) {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
        Scanner sc = new Scanner(System.in);
       HashMap<Integer,String> hm = new HashMap<>();
       int n  = sc.nextInt();
       int m = sc.nextInt();
      int pen[] = new int[n];
      int cor[] = new int[n];

       for(int i=0; i<m; i++){
           int  x = sc.nextInt();
           String s = sc.next();
           if(hm.containsKey(x)){
               String ver = hm.get(x);
               if(ver.equals("WA") && s.equals("WA"))
                     pen[x-1]++;
               else if(ver.equals("WA") && s.equals("AC")){
                   hm.put(x,"AC");cor[x-1]++;
               }
           }else{
               if(s.equals("AC"))
                   cor[x-1]++;
               if(s.equals("WA"))
                   pen[x-1]++;
               hm.put(x,s);
           }
       }
       for(int i=0; i<n; i++){
           if(cor[i]==0)
               pen[i]= 0;
           }
       int penalty=0,correct=0;
       for(int xx : pen)
           penalty += xx;
       for(int xx : cor)
           correct += xx;

       System.out.println(correct+" "+penalty);
    }
}

Measured memory_bytes: 75388
#include <stdio.h>

int main() {
  int temp, min = 123, max = 0, i;
  for(i = 0; i < 5; i++) {
    scanf("%d", &temp);
    min = (min > temp)? temp : min;
    max = (max < temp)? temp : max;
  }
  scanf("%d", &temp);
  (max - min <= temp)? printf("Yay!\n") : printf(":(\n");

  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rp(i,n) for(int i=0; i<n; i++)
using namespace std;
using ll=long long;
using P=pair<int,int>;
using G=vector<vector<int>>;

int main(){
    int n,m;
    cin >> n >> m;
    rp(i,m){
        int a;
        cin >> a;
        n-=a;
    }
    if(n>=0)
    cout << n << endl;
    else
    {
        cout << -1<< endl;
    }
    
    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define fastIO ios::sync_with_stdio(NULL); cin.tie(NULL);

using namespace std;

string s,t;
bool flag = false; 

int main()
{
    cin>>s>>t;
    
    for (int i = 0;i < (int)s.size();++i)
        if (s[i] != t[i]) { flag = true; break; }
    
    if (flag == true) cout<<"No"; else cout<<"Yes";
}

Measured memory_bytes: 3632
#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

const char *dat = "+-*";

string s(int a) { return string(1, (char)('0'+a)); }

int op(int t, int a, int b) {
    if (t == 0) return a+b;
    if (t == 1) return a-b;
    if (t == 2) return a*b;
    return 0;
}

string op(int t, const string& a, const string& b) {
    if (t == 0) return "(" + a + " + " + b + ")";
    if (t == 1) return "(" + a + " - " + b + ")";
    if (t == 2) return "(" + a + " * " + b + ")";
    return "";
}

int seq(int *a, int *b) {
    int t = a[0];
    rep (i, 3) t = op(b[i], t, a[i+1]);
    return t;
}

string mseq(int *a, int *b) {
    string t = s(a[0]);
    rep (i, 3) t = op(b[i], t, s(a[i+1]));
    return t;
}

int tre(int *a, int *b) {
    return op(b[1], op(b[0], a[0], a[1]), op(b[2], a[2], a[3]));
}

string mtre(int *a, int *b) {
    return op(b[1], op(b[0], s(a[0]), s(a[1])), op(b[2], s(a[2]), s(a[3])));
}

int main() {
    for (;;) {
        int a[4], b[3];
        rep (i, 4) scanf("%d", a+i);
        if (a[0]+a[1]+a[2]+a[3] == 0) return 0;
        sort(a, a+4);
        string ans = "0";
        do {
            rep (t, 3*3*3) {
                int p = t;
                rep (i, 3) {
                    b[i] = p % 3;
                    p /= 3;
                }
                if (seq(a, b) == 10) ans = mseq(a, b);
                if (tre(a, b) == 10) ans = mtre(a, b);
                if (ans.size() > 1) goto end;
            }
        } while (next_permutation(a, a+4));
end:
        cout << ans << endl;
    }
}

Measured memory_bytes: 0
#include <iostream>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long ll;
ll Power[20];
ll dfs(ll l , ll r , ll d) {
    if(l >= r) {
        if(d == 0) return l == r ? 10 : 1;
        return 0;
    }
    if(d % 10 == 0) {
        if(l != 1) return 10 * dfs(l + 1 , r - 1 , d / 10);
        return 9 * dfs(l + 1 , r - 1 , d / 10);
    }
    ll differ = d % 10 - 10;//选取的数一定要使l位进1否则取反之后的必定小与改数，那么显然不可能。所以differ是d % 10 - 10
    ll next = d - differ + differ * Power[r - l];//这里先让d进一位，然后由于对称性，r位+differ=l位+differ所以选择+ differ * Power[r - l]，这样才能满足对称条件
    if(l == 1) return (9 + differ) * dfs(l + 1 , r - 1 , abs(next) / 10);
    return (10 + differ) * dfs(l + 1 , r - 1 , abs(next) / 10);
}
int main() {
    ll d;
    cin >> d;
    Power[0] = 1;
    for(int i = 1 ; i <= 18 ; i++) {
        Power[i] = Power[i - 1] * 10;
    }
    ll ans = 0;
    for(int i = 2 ; i <= 18 ; i++) {
        ans += dfs(1 , i , d);
    }//这里选择18位由于原来的数也就最多9位，如果取得数位数是两倍的话显然是不可能的。
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main(){
    string s,t;
    cin >> s >> t;
    for(int i = 0; i < s.size(); i++){
        string tmp = s;
        for(int j = 0; j < s.size(); j++){
            tmp[j] = s[(j+i)%s.size()];
        }
        if(tmp == t){
            puts("Yes");
            return 0;
        }
    }
    puts("No");
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int A,B;
  cin>>A>>B;
  if(A<=5){
    cout << 0 << endl;
  }
  if(6<=A&&A<=12){
    cout << B/2 << endl;
  }
  if(A>=13){
    cout << B << endl;
  }
  return 0;
}

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

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int64_t i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int64_t i=(a),_b=(b);i>=_b;--i)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

const ll md = 1000000007;

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    ull n;
    cin >> n;
    ull ans = 0;
    FOR(i, 1, n) {
    	ull k = n / i;
    	ans += (k * (k + 1)) / 2 * i;
    }
    cout << ans << "\n";
}

Measured memory_bytes: 3632
<?php
    while( true ) {
        fscanf( STDIN, "%d%d", $H, $W );
        if( 0 == $H && 0 == $W ) { break; }
         
		if( 1 < $H && 1 < $W ) {
			print str_repeat( '#' , $W ).PHP_EOL;
	        for( $i=0; $i<$H-2; $i++ ) {
				print '#'.str_repeat( '.' , $W-2 ).'#'.PHP_EOL;
	        }
			print str_repeat( '#' , $W ).PHP_EOL;
		} else {
			print '#'.PHP_EOL;
		}
        print PHP_EOL;
    }
	return;
?>

Measured memory_bytes: 6564
#-*- coding: utf-8 -*-
S=list(str(input()))
count=0
count_max=0

for ii in range(0,len(S)):
    if S[ii] == "A" or  S[ii] =="C" or  S[ii] =="G" or  S[ii] =="T":
        count += 1
        if count > count_max:
            count_max=count
    else:
        count=0

print(count_max)



Measured memory_bytes: 2940
//----AUTHOR:kkdrummer----/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
//#include <boost/multiprecision/cpp_int.hpp> 
//using namespace boost::multiprecision; 
using namespace __gnu_pbds;
using namespace std;
typedef    long long   ll;
typedef    long double   ld;
typedef    unordered_set<ll>   usll;
typedef    unordered_multiset<ll>   umsll;
typedef    multiset<ll>   msll;
typedef    set<ll>   sll;
typedef    vector<ll>   vll;
typedef    pair<ll,ll>   pll;
typedef    vector<pll>   vpll;
typedef    priority_queue<ll>   pqll;
typedef    vector<int>   vi;
typedef    set<int>   si;
typedef    multiset<int>   msi;
typedef    unordered_multiset<int>   umsi;
typedef    unordered_set<int>   usi;
typedef     pair<int,int>   pi;
typedef    vector<pi>   vpi;
typedef    set<pi>   spi;
typedef    priority_queue<int>   pqi;
typedef    tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>   ind_set;
typedef    tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>   ind_setll;
#define    in   insert
#define    fi   first
#define    se   second
#define    pb   push_back
#define    mp   make_pair
#define    be   begin
#define    en   end
#define    itr   iterator
#define io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define    mo   1000000007
#define    inf  9222372026854775807
#define    ninf   -inf
#define    ima   2047483647
#define    imi   -ima
#define    oncnt    __builtin_popcount
#define    zerobegin   __builtin_clz
#define    zeroend   __builtin_ctz
#define    parity   __builtin_parity
#define    all(x)   x.be(),x.en()
#define    eps   1e-9
#define    coutd   cout<<setprecision(12)<<fixed
#define    mems(dp,x)   memset(dp,x,sizeof(dp))
#define    fbo    find_by_order
#define    ook    order_of_key
#define    upb    upper_bound
#define    lowb   lower_bound 
#define    lte(v,x)   upb(all(v),x)-v.be()
#define    gte(v,x)   v.end()-lowb(all(v),x)
#define    gt(v,x)     v.en()-upb(all(v),x)
#define    lt(v,x)     lowb(all(v),x)-v.be()
const    ld   PI=3.1415926535897932384626433832792884197169399375105820974944;
inline ll modpow(ll x,ll n){if(n==0)return 1;if(x==0)return 0;if(n==1)return(x%mo);ll u=(modpow(x,n/2));u=(u*u)%mo;if(n%2!=0)u=(u*x%mo)%mo;return u;}
inline ll modinv(ll x){return modpow(x,mo-2);}
inline ll mmul(ll a,ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll madd(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a+b>=mo)return(a+b)%mo;return(a+b);}
inline ll msub(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;return(((a-b)%mo+mo)%mo);}
inline ll mdiv(ll a,ll bb){if(a>=mo)a=a%mo;ll b=modinv(bb);if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll gcd(ll a,ll b){return __gcd(a,b);}
inline ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}



 
int main()
{       io 
int testcases=1;   //          cin>>testcases;
while(testcases--)
{
 

 int x,y;
 cin>>x>>y;
 
 int a,b;
 int k=y-2*x;
 if(k%2==0&&y>=x)
 {
 	b=k/2;
 	
 }
 else
 {
 	cout<<"No";
 	return 0;
 }
 a=x-b;
 
 if(a>=0&&b>=0)
 {
 	cout<<"Yes";
 }
 else
 cout<<"No";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
}return 0;}


Measured memory_bytes: 3648
grid = [[int(i) for i in input().split()] for i in range(3)] 
ans = "No"
for i in range(1,101):
    a1 = i
    b1 = grid[0][0] - a1
    b2 = grid[0][1] - a1
    b3 = grid[0][2] - a1
    a2 = grid[1][0] - b1
    a3 = grid[2][0] - b1
    res = 1
    if(a2 + b2 != grid[1][1]):
        res*=0
    if(a2 + b3 != grid[1][2]):
        res*=0
    if(a3 + b2 != grid[2][1]):
        res*=0
    if(a3 + b3 != grid[2][2]):
        res*=0
    if(res):
        ans = "Yes"
        break
print(ans)
        
        

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, x, n) for(ll i = x; i < n; i++) 
#define pb push_back
#define ll long long
#define hii cout << "hii" << endl
#define pii pair<int, int>
#define pll pair<ll, ll>
#define int ll
#define mpp make_pair
#define endl '\n'
#define ff first 
#define ss second
#define all(s) s.begin(), s.end()
#define fuck_you_scanf ios_base:: sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define si size()
 
const int N = 1e6 + 5;
long double arr[N];
long double DP[3005][3005][2];
 
 
long double f(int idx, int reqd, int n)
{
    if(idx == n)
    {
        if(reqd <= 0) {return 1.0;}
        else return 0;
    }
    int type = 0;
    if(reqd < 0) type = 1;
    if(DP[idx][abs(reqd)][type] >= 0) return DP[idx][abs(reqd)][type];
    long double ans1 = (arr[idx]) * f(idx + 1, reqd - 1, n) * 1.0;
    long double ans2 = (1.0 - arr[idx]) * f(idx + 1, reqd, n) * 1.0;
    return DP[idx][abs(reqd)][type] = ans1 + ans2;
}
 
int32_t main()
{
   int n;
   cin >> n;
   memset(DP, -1,sizeof(DP));
   for(int i = 0; i < n; i++)
   {
       cin >> arr[i];
   }
   int reqd = (n)/2; reqd++;
   cout << setprecision(10) << fixed;
   cout << f(0, reqd, n);
}

Measured memory_bytes: 283264
from typing import List
import math

def koch_curve(n: int, p1: List[float], p2: List[float]):
    if n == 0:
        return
    p1x, p1y = p1
    p2x, p2y = p2
    s = [(r - l) / 3 + l for (l, r) in zip(p1, p2)]
    t = [(r - l) * 2 / 3 + l for (l, r) in zip(p1, p2)]
    sx, sy = s
    tx, ty = t
    ux = (tx - sx) * math.cos(math.radians(60)) - (ty - sy) * math.sin(math.radians(60)) + sx
    uy = (tx - sx) * math.sin(math.radians(60)) + (ty - sy) * math.cos(math.radians(60)) + sy
    u = [ux, uy]
    n -= 1
    koch_curve(n, p1, s)
    print(*s)
    koch_curve(n, s, u)
    print(*u)
    koch_curve(n, u, t)
    print(*t)
    koch_curve(n, t, p2)

n = int(input())
p1 = [0, 0]
p2 = [100, 0]
print(*p1)
koch_curve(n, p1, p2)
print(*p2)


Measured memory_bytes: 7376
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <cstring>
#include <map>
using namespace std;

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

  int n;
  cin >> n;

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

  vector<int64_t> differences(n);
  for (int i = 0; i < n; i++) {
    differences[i] = a[i] - b[i];
  }
  sort(differences.begin(), differences.end());

  set<int> changed_indices;

  int target = n - 1;
  for (int i = 0; i < n; i++) {
    while (target > i and differences[i] < 0) {
      changed_indices.insert(i);
      int supply = max((int64_t)0, min(-differences[i], differences[target]));

      differences[i] += supply;
      differences[target] -= supply;

      if (supply > 0) {
        changed_indices.insert(target);
      }

      if (differences[target] <= 0) {
        target--;
      }
    }

    if (differences[i] < 0) {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << changed_indices.size() << endl;

  return 0;
}

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

int main() {
  int N, a, x, y, z;
  x = 0;
  y = 0;
  z = 0;
  cin >> N;
  
  vector<int> btn(N);
  for (int i = 0; i < N; i++) {
  cin >> a;
  btn.at(i) = a;
  }
  
  for (int j = 0; j < N;) {
    if (btn.at(j) == 2) {
      x++;
      cout << x << endl;
      break;
    }
    else {
      y = btn.at(j) - 1;
      if (btn.at(y) == j + 1) {
      cout << -1 << endl;
      break;
      }
      else if (btn.at(y) != j + 1) {
      x++;
      z++;
      j = btn.at(j) - 1;
        if (z >= 100000) {
        cout << -1 << endl;
        break;
        }
      }
    }
  }
}

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

int main(){

  int n , l ;
  cin >> n >> l;
  vector<string> str(n);
  
  rep(i,n)cin >> str[i];
  
  sort(str.begin(),str.end());
  
  string ans;
  rep(i,n)ans += str[i];
  
  cout << ans;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    
    if(a<b && b<c){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }
    
    return 0;
}


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

int main() 
{
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  vector<int> ans(n);
  
  vector<int>::iterator iter = max_element(a.begin(), a.end());
  size_t index = distance(a.begin(), iter);
  rep(i, n) {
    if ( i == index ) {
      vector<int> a_copy(n);
      copy(a.begin(), a.end(), a_copy.begin());
      a_copy.erase(a_copy.begin() + i);
      ans[i] = *max_element(a_copy.begin(), a_copy.end());
    } else { 
      ans[i] = a[index];
    }
  }
  
  rep(i, n) cout << ans[i] << endl;
}

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

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define TR(X) ({ if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	ll n; cin >> n;
	vl a(n);
	FOR(i,0,n) cin >> a[i];
	sort(all(a));
	double res = a[0];
	FOR(i,1,n) res = (res+a[i])/2;
	cout << fixed << setprecision(20) << res << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(long long i=0;i<x;i++)
#define repn(i,x) for(long long i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
vector<pair<string,P> >vec;

vector<long long> divisor(long long n) {
	vector<long long> res;
	for (long long i = 1; i * i <= n; i++) {
  	if (n % i == 0) {
			res.push_back(i);
			if (i != n / i) res.push_back(n / i);
		}
	}
	return res;
}

int main(){	
	long long N;
	cin >> N;
	vector<ll> a(N);
	rep(i, N) cin >> a[i];
	vector<ll> b(N, -1);
	rep(i, N) {
		b[POSL(b,a[i])-1] = a[i];
		// cout << POSL(b,a[i]) << " " << b[POSL(b,a[i])] << endl;
	}
	ll res = 0;
	for (ll i = N-1; i >= 0; i--) {
		if (b[i] != -1) res++;
	}
	cout << res << endl;
	return 0;
}



Measured memory_bytes: 1792
from sys import stdin
readline = stdin.readline


def cross(a, b):
    return a.real * b.imag - a.imag * b.real


def dot(a, b):
    return a.real * b.real + a.imag * b.imag


def eq(a, b):
    return abs(a - b) < 1e-10


def on_line(p, s, e):
    d = dot(p - s, e - s)
    c = cross(p - s, e - s)
    if c == 0 and 0 <= d <= abs(e - s) ** 2:
        return True
    return False


def on_polygon_line(xy, p):
    for i in range(len(p)):
        j = i - 1
        if on_line(xy, p[i], p[j]):
            return True
    return False


def in_polygon(xy, p):
    wn = 0
    for i in range(len(p)):
        j = i - 1
        if 0 == (p[i] - p[j]).imag:
            continue
        vt = (xy - p[j]).imag / (p[i] - p[j]).imag
        tmp = p[j] + vt * (p[i] - p[j])
        if xy.real < tmp.real:
            wn += 1 if p[j].imag <= xy.imag < p[i].imag else\
                 -1 if p[i].imag <= xy.imag < p[j].imag else 0
    return wn

n = int(readline())
p = [map(int, readline().split()) for _ in range(n)]
p = [x + y * 1j for x, y in p]

q = int(readline())
for _ in range(q):
    x, y = map(int, readline().split())
    xy = x + y * 1j
    print(1 if on_polygon_line(xy, p) else 2 if in_polygon(xy, p) else 0)

Measured memory_bytes: 6836
#include<bits/stdc++.h>
typedef long long ll;
#define INF 100000000
#define MOD 100000007
int dx[4]={1,0,-1,0},dy[4]={0,-1,0,1};
using namespace std;
int main(void){
    int n;
    cin>>n;
    int a[n],b[n],c[n];
    for(int i=0;i<n;i++){
        cin>>a[i]>>b[i]>>c[i];
    }
    int dp[n+1][3]={};
    dp[0][0]=a[0];
    dp[0][1]=b[0];
    dp[0][2]=c[0];
    for(int i=1;i<n;i++){
        dp[i][0]=a[i]+max(dp[i-1][1],dp[i-1][2]);
        dp[i][1]=b[i]+max(dp[i-1][0],dp[i-1][2]);
        dp[i][2]=c[i]+max(dp[i-1][0],dp[i-1][1]);
    }
    cout<<max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]))<<endl;
   return 0;
}

Measured memory_bytes: 2560
import sys

input = sys.stdin.readline

def main():
    ans = 0
    n = int(input())
    k = int(input())
    x = list(map(int, input().split()))
    for i in range(n):
        temp = min(x[i], abs(k-x[i]))
        ans += temp*2 
    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_ll.hpp>
//typedef boost::multiprecision::cpp_ll ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E16;
#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[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
string alp="abcdefghijklmnopqrstuvwxyz";
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);


int main(){
    string s;cin>>s;
    if(s[0]=='A'){
        if(s[1]=='A' && s[2]=='A'){
            cout<<"No"<<endl;
        }else{
            cout<<"Yes"<<endl;
        }
    }else{
        if(s[1]=='B' && s[2]=='B'){
            cout<<"No"<<endl;
        }else{
            cout<<"Yes"<<endl;
        }
    }
    
    
    
    return 0;
}




Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>
#include<queue>

using namespace std;

int main(){
	int n;
	cin >> n;
	vector<long long> a(n);
	for(int i = 0; i < n; i++)cin >> a[i];
	sort(a.begin() , a.end());
	
	if(a[0] == 0){
		cout << 0 << endl;
		return 0;
	}
	
	long long mx = pow(10,18);
	
	long long ans = 1;
	for(int i = 0; i < n; i++){
		if(ans > (mx / a[i]) || ans * a[i] > mx){
			cout << -1 << endl;
			return 0;
		}
		//cout << i << " : " << ans << " : " << (mx / a[i]) << endl;
		ans *= a[i];
	}
	cout << ans << endl;
	return 0;
}
 

Measured memory_bytes: 3964
#include <iostream>
#include <cmath>
#include <vector>
#include <string>

void print(){ std::cout << std::endl; }
template<typename H> void print(H&& head){ std::cout << head << std::endl; }

int main()
{
  std::cin.tie(nullptr);
  std::cout.tie(nullptr);
  std::ios::sync_with_stdio(false);

  std::string S;
  std::cin >> S;

  if (S == "ABC") print("ARC");
  else print("ABC");

  return 0;
}


Measured memory_bytes: 3588
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
const int INF = (int)1e9 + 7;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

vector<vector<int>> calc_next(const string &s) {
    int n = s.size();
    vector<vector<int>> nxt(n + 1, vector<int>(26, n));
    for (int i = n - 1; i >= 0; i--) {
        for (int j = 0; j < 26; j++) nxt[i][j] = nxt[i + 1][j];
        nxt[i][s[i] - 'a'] = i;
    }
    return nxt;
}

int main() {
    string s; cin >> s;
    int n = s.size();
    auto nxt = calc_next(s);
    // dp[i] := i 文字目以降について「部分文字列とならない」最短の文字列長
    vector<int> dp(n + 2, INF);
    vector<pair<char, int>> recon(n + 1, {'?', n});
    dp[n + 1] = 0;
    for (int i = n - 1; i >= 0; i--) for (int j = 0; j < 26; j++) {
        if (chmin(dp[i], dp[nxt[i][j] + 1] + 1)) {
            recon[i] = {'a' + j, nxt[i][j] + 1};
        }
    }
    // 復元
    string res = "";
    int idx = 0;
    while (idx < n) {
        auto p = recon[idx];
        res += p.first;
        idx = p.second;
    }
    cout << res << endl;
}

Measured memory_bytes: 29316
#include<iostream>
#include <algorithm>
#include <cstdlib>
#include <cmath>

using namespace std;


long long int median(long long int arr[], int size)
{
	if (size%2 == 0)
		return (arr[size/2 - 1] + arr[size/2])/ 2;
	else
		return arr[size/2];
}

int main()
{
	int N;
	long long int b, sadness;

	cin>>N;
	
	long long int arr[N]; 
	long long int B[N];
	
	for(int i = 0; i < N; i++)
	{
		cin >> arr[i];
		B[i] = arr[i]- i - 1;
	}

	sort(B, B + N);

	b = median(B, N);

	sadness = 0;
	for(int j = 0; j < N; j++)
	{
		sadness += abs(B[j] - b);
	}
	cout << sadness << "\n";

	return 0;

}

Measured memory_bytes: 3328
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
	
	//文字列から10進数に変換するときはparseIntを使います
    var a = input[0];
    
    var b = "abcdefghijklmnopqrstuvwxyz";
    
    var c = b.indexOf(a);

    var d = b.substr(c+1,1);
	//出力
    console.log('%s',d);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
using P=pair<int,int>;
int main() {
    ll n,m;cin>>n>>m;
    ll maximum;
    if(n==1){
        maximum=m;
    }
    else{
        for(ll i=1;i<=m/n;i++){
            if(m%i==0) maximum=i;
        }
    }

    cout<<maximum<<endl;
}

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

using namespace std;

int opentime[110][15];
long long profit [110][15];
int N, i, j; 
int mystoreopen[15];

long long dummys, maxi;
int counta, counter;

long long countprofit(int arr[])
{
    dummys = 0;
    for (i=1; i<=N; i++)
    {
        counta = 0;
        for (j=0; j<10; j++)
        {
            if ((arr[j] == 1) && (opentime[i][j]==1))
                counta++;
        }
        dummys = dummys + profit[i][counta];
    }
    return dummys;
}

long long forrecursion(int arr[], int no)
{
    int dummy1[15];
    int dummy2[15];
    int doublecheck;
    for (i=0; i<10; i++)
    {
        dummy1[i] = arr[i];
        dummy2[i] = arr[i];
    }
    dummy1[no] = 0;
    dummy2[no] = 1;
    if (no == 0)
    {
        doublecheck = 0;
        for (i=0; i<10; i++)
            if (dummy1[i] != 0) doublecheck++;
        if (doublecheck == 0)
            return countprofit(dummy2); 
        else
            return max(countprofit(dummy1), countprofit(dummy2));
    }
    else
        return max(forrecursion(dummy1, no-1), forrecursion(dummy2, no-1));
}

int main ()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> N;
    for (i=1; i<=N; i++)
        for (j=0; j<10; j++)
            cin >> opentime[i][j];
    for (i=1; i<=N; i++)
        for (j=0; j<11; j++)
            cin >> profit[i][j];
    maxi = forrecursion(mystoreopen, 9);
    cout << maxi;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <map>
#include <vector>
#include <cmath>

using namespace std;

void c_dubious_document2(void) {
	string s, t;
	cin >> s >> t;

	int s_size = s.size();
	int t_size = t.size();
	vector<string> s_que;
	int diff = s_size - t_size;
	for (int i = 0; i <= diff; i++) {
		//cout << i << endl;
		string s_ans = s.substr(0, i) + t + s.substr(i + t_size, s_size - t_size - i);
		//cout << s_ans << endl;
		bool match_judge = true;
		for (int j = 0; j < t_size; j++) {
			if (s[i + j] == '?') {
				s_ans[i + j] = t[j];
				continue;
			}
			if (s[i + j] != t[j]) {
				match_judge = false;
				break;
			}
		}

		if (match_judge) {
			//cout << s_ans << endl;
			s_que.push_back(s_ans);
		}

	}

	if (s_que.size() == 0) {
		cout << "UNRESTORABLE" << endl;
		return;
	}

	sort(s_que.begin(), s_que.end());
	for (int i = 0; i < s_que[0].size(); i++) {
		if (s_que[0][i] == '?')s_que[0][i] = 'a';
	}

	cout << s_que[0] << endl;
}

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

Measured memory_bytes: 3612
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cmath>
#include <sstream>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define INF (1<<10)
double solve(double &x,int &a,int &b){
	return x + sqrt(4*a*b);
}

#define shift(n) (1<<n)

string solve(int &capacity,vector<int> &item){
	int n = item.size();
	double dp[1<<n][n];
	
	rep(i,1<<n)rep(j,n)dp[i][j] = INF;
	
	rep(i,n)dp[1<<i][i] = item[i];
	
	rep(bit,1<<n){
		rep(rmost,n){
			if( (shift(rmost) & bit) == 0 )continue;
			rep(cur,n){
				if(shift(cur) & bit)continue;
				int nextBit = bit | shift(cur);
				dp[nextBit][cur] = min(dp[nextBit][cur],solve(dp[bit][rmost],item[rmost],item[cur]) );
			}
		}
	}
	rep(i,n){
		if(dp[(1<<n)-1][i] + item[i]<= capacity)return "OK";
	}
	return "NA";
}
int main(){
	string line;
	int tmp;
	while(getline(cin,line)){
		while(~line.find(","))line[line.find(",")] = ' ';
		stringstream input(line);
		int capacity;
		vector<int> item;
		
		input >> capacity;
		while(input >> tmp)item.push_back(tmp);
		cout << solve(capacity,item) << endl;
	}
}

Measured memory_bytes: 0
#include <iostream>

using namespace std;

int main() {
  	int n;
  	
  	cin >> n;
  
  	int V[n];
  	int C[n];
  
  	int ans = 0;
  
  	for (int i=0; i<n; i++) {
  		cin >> V[i];
    }
  	for (int i=0; i<n; i++) {
  		cin >> C[i];
    }
  
  	for (int i=0; i<n; i++) {
    	if (V[i]-C[i] > 0) {
        	ans += V[i] - C[i]; 
        }
    }
  
  	cout << ans;
  
	return 0; 
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll int t,n,i,ans,k,j,ar[200],mx,b;
	
		cin>>n;
		for(i=0;i<n;i++)
		{
			cin>>ar[i];
		}
		ans=0;
		for(i=0;i<n;i++)
		{
			for(j=i+1;j<n;j++)
			{
				for(k=j+1;k<n;k++)
				{
					if(ar[i]==ar[j]||ar[i]==ar[k]||ar[j]==ar[k])continue;
					mx=max(ar[i],max(ar[j],ar[k]));
					b=ar[i]+ar[j]+ar[k]-mx;
					if(b>mx)ans++;
				}
			}
		}
		cout<<ans<<endl;
	
	return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
    string S; cin >> S;
    int ans = 0;
    int cur = 0;
    for(auto s: S) {
        if(s == 'A' || s == 'C' || s == 'G' || s == 'T') {
            cur++;
            if (cur > ans) {
                ans = cur;
            }
        } else {
            cur = 0;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
using P = pair<int,int>;
using ll = long long;
static const int INF = 1000000000;
static const ll MOD = 1000000007;

ll gcd(ll a, ll b){return b!=0 ? gcd(b, a%b) : a;}
ll lcm(ll a, ll b){return a / gcd(a, b) * b;}

int main(){
	string s;
	cin >> s;
	vector<int> c(26, 0);
	rep(i, s.size()){
		int index = s[i] - 'a';
		if(c[index]){
			cout << "no" << endl;
			return 0;
		}
		c[index]++;
	}
	cout << "yes" << endl;
	return 0;
}



Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <complex>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << #x << " = " << (x) << endl;


#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 100010


int main(){
  ll a[SIZE];
  int n;

  scanf("%d",&n);

  for(int i=0;i<n;i++){
    scanf("%lld",a+i);
  }


  sort(a, a+n,greater<ll>());

  vector<ll> vec;
  
  for(int i=0;i<n-1;i++){
    if(a[i] == a[i+1]){
      vec.push_back(a[i]);
      i++;
    }
  }

  if(vec.size() == 0){
    puts("0");
  }else{
    printf("%lld\n",vec[0] * vec[1]);
  }
  
  return 0;
}


Measured memory_bytes: 1660
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>

using namespace std;

int main()
{
    double distance;
    int n;
    double d;
    double x, y;
    int ans = 0;
    
    cin >> n >> d;

    for (int i = 0; i < n; i++)
    {
        cin >> x >> y;
        distance = sqrt(x * x + y * y);

        if (distance <= d)
        {
            ans += 1;
        }
    }

    cout << ans;

}

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

using namespace std;

using int64 = long long;

template< typename Monoid >
struct SegmentTree
{
  using F = function< Monoid(Monoid, Monoid) >;

  int sz;
  vector< Monoid > seg;

  const F f;
  const Monoid M1;

  SegmentTree(int n, const F f, const Monoid &M1) : f(f), M1(M1)
  {
    sz = 1;
    while(sz < n) sz <<= 1;
    seg.assign(2 * sz, M1);
  }

  void set(int k, const Monoid &x)
  {
    seg[k + sz] = x;
  }

  void build()
  {
    for(int k = sz - 1; k > 0; k--) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }

  void update(int k, const Monoid &x)
  {
    k += sz;
    seg[k] = x;
    while(k > 1) {
      k >>= 1;
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }

  Monoid query(int a, int b)
  {
    Monoid L = M1, R = M1;
    for(a += sz, b += sz; a < b; a >>= 1, b >>= 1) {
      if(a & 1) L = f(L, seg[a++]);
      if(b & 1) R = f(seg[--b], R);
    }
    return f(L, R);
  }

  Monoid operator[](const int &k) const
  {
    return seg[k + sz];
  }
};


int main()
{
  int N, Q;
  scanf("%d %d", &N, &Q);
  SegmentTree< int > seg(N, [](int a, int b) { return a + b; }, 0);
  while(Q--) {
    int T, X, Y;
    scanf("%d %d %d", &T, &X, &Y);
    if(T == 0) seg.update(X, seg[X] + Y);
    else printf("%d\n", seg.query(X, Y + 1));
  }
}



Measured memory_bytes: 3872
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>
#include <set>
#include <map>
#include <stdio.h>
#include <numeric>
#include <cstring>

#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i < (n); i++)
#define FOR(i,a,b) for (int i=(a); i < (b); i++)
#define MOD 1000000007 //10^9+7
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using PLL = pair<ll, ll>;
const int INF = numeric_limits<int>::max();
const ll INFL = numeric_limits<ll>::max();


// 負の数にも対応した % 演算
long long mod(long long val, long long m) {
    long long res = val % m;
    if (res < 0) res += m;
    return res;
}

//greatest common divisor
long long gcd(ll a, ll b) 
{
    if (a % b == 0) {
        return b;
    } else {
        return gcd(b, a % b);
    }
}

//least common multiple
long long lcm(ll a, ll b)
{
    return a / gcd(a, b) * b ;
}

ll factorial(ll n) {
    ll res = 1;
    for (ll i = 1; i <= n; i++) {
        res *= i;
    }
    return res;
}

int main()
{
    char c;
    rep(i,3) {
        cin >> c;
        if (c - '0' == 7) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3604
import java.util.*;

public class Main {
  public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    String[] vowel = {"a", "e", "i", "o", "u"};

    for (String s : vowel) {
      if (str.equals(s)) {
        System.out.println("vowel");
        return;
      }
    }
    System.out.println("consonant");
  }
}


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

int main()
{
	int n,i;

	for(i=1;i<=10000;i++)	
	{
		cin >> n;
		if(n == 0) 
			break;
		cout << "Case " << i << ": " << n <<endl;
	}

	return 0;
}

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

int main() {
  double n, k;
  cin >> n >> k;
  double ans = 0;
  for (int i = 1; i <= n; i ++) {
    if (i < k) {
      double t = i;
      double x = (double)1/n;
      while (t < k) {
        t *= 2;
        x *= (double)1/2;
      }
      ans += x;
    } else {
      ans += (double)1/n;
    }
  }
  cout << setprecision(15) << ans << endl;
}


Measured memory_bytes: 256
/*
    STARK_BOY
*/
#include <bits/stdc++.h>
#include <fstream>
using namespace std;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repe(i,a,b) for(ll i=a;i<=b;i++)
#define bac(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef long long ll;
typedef vector< ll > vi;
typedef vector<pair<ll,ll> > vpii;
typedef pair<ll,ll> pii;
#define all(c) c.begin(),c.end()
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define setbitc(x) __builtin_popcount(x)
#define init(x,a) memset(x,a,sizeof(x))
#define PI           3.14159265358979323846  /* pi */
mt19937 rng32(chrono::steady_clock::now().time_since_epoch().count());
#define N 1000005
//Variables Start
ll inf=1e18,MOD=1e9+7;
ll n,m,k,ar[N],br[N];
string s,s1;
//Variables End

int main()
{
    ios
    int ti=1;
    //cin>>ti;
    while(ti--)
    {
		cin>>n>>m;
		ll su=0;
		rep(i,0,m){ll x;cin>>x;su+=x;}
		if(su>=n)cout<<"Yes";
		else cout<<"No";   
    }
    return 0;
        
}

Measured memory_bytes: 256