akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <climits>
#include <vector>
#include <stack>
#include <cmath>
#include <queue>
#include <set>
#include <map>
using namespace std;

int main() {
    string s;
    cin>> s;
    s[3] = '8';
    cout << s<< endl;

    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<map>
#include<queue>
using namespace std;
typedef long long ll;
const int N=2e5+11,INF=~0u>>2;
int n,a[N];
int read(){
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return f*x;
}
int main(){
//	freopen("ex.in","r",stdin);
	n=read();
	for(int i=1;i<=n;++i) a[i]=read();
	for(int i=n;i>=1;i-=2) printf("%d ",a[i]);
	for(int i=1+(n&1);i<=n-1;i+=2) printf("%d ",a[i]);
	return 0;
}

Measured memory_bytes: 2944
#include <cstring>
#include <algorithm>
#include <map>
#include <stack>
#include <cassert>
#include <cmath>
#include <vector>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <vector>
#include <iostream>
#include <set>
#define MP make_pair
#define F first
#define PB push_back
#define S second
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 50;
const int mod = 1e9 + 7;
const int inf = (1 << 30);
int a[maxn];

int main(){
    ios_base::sync_with_stdio(false);
    int n, L;
    cin >> n >> L;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    bool cur = 0;
    for (int i = 1; i <= n - 1; i++)
        if (a[i] + a[i + 1] >= L)
            cur = 1;
    if (!cur)
        return cout << "Impossible" << endl, 0;
    cout << "Possible" << endl;
    for (int i = 1; i <= n - 1; i++){
        if (a[i] + a[i + 1] >= L){
            for (int j = 1; j < i; j++)
                cout << j << '\n';
            for (int j = n - 1; j > i; j--)
                cout << j << '\n';
            cout << i << endl;
            break;
        }
    }
}

Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
typedef vector<string> vstring;
#define _GLIBCXX_DEBUG
#define vpush(a,x) a.push_back(x);
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
const int INF = 1 << 30;
const int dx[] = {1,0,-1,0,1,1,-1,-1};
const int dy[] = {0,-1,0,1,1,-1,-1,1};
#define stp(x)  setprecision(x)
int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin>>n;
  vlong a(n);
  ll tmp=1000000000000000000ll;
  ll ans=1;
  rep(i,n){
    cin>>a[i];
  }
  sort(a.begin(),a.end());
  ll ans2=0;
  rep(i,n){
    ans*=a[i];
    if(ans<0){
      cout<<-1<<'\n';
      return(0);
    }
    if(ans>tmp){
      cout<<-1<<'\n';
      return(0);
    }
    if(ans2>ans){
      cout<<-1<<'\n';
      return(0);
    }
    ans2=ans;
  }
  cout<<ans<<'\n';
  return(0);
}

Measured memory_bytes: 3984
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

S = input()
T = input()

ans = 1e9
i = 0
while True:
    S2 = S[i:i+len(T)]
    if len(S2) != len(T):
        break
    i += 1

    tmp = 0
    for s, t in zip(S2, T):
        tmp += s != t
    ans = min(ans, tmp)

print(ans)
    


Measured memory_bytes: 10644
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <cmath>

using namespace std;

long long dp[55][55];
long long way[55][55];


int main() {
	for (int i = 0; i < 55; i++) {
		for (int j = 0; j < 55; j++) {
			dp[i][j] = -1e18;
		}
	}
	int n, a, b;
	cin >> n >> a >> b;
	vector<long long> v(n);
	for (int i = 0; i < n; i++) {
		cin >> v[i];
	}
	dp[0][0] = 0;
	way[0][0] = 1;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j <= n; j++) {
			if (dp[i + 1][j] < dp[i][j]) {
				dp[i + 1][j] = dp[i][j];
				way[i + 1][j] = way[i][j];
			} else if (dp[i + 1][j] == dp[i][j]) {
				way[i + 1][j] += way[i][j];
			}

			if (dp[i + 1][j + 1] < dp[i][j] + v[i]) {
				dp[i + 1][j + 1] = dp[i][j] + v[i];
				way[i + 1][j + 1] = way[i][j];
			} else if (dp[i + 1][j + 1] == dp[i][j] + v[i]) {
				way[i + 1][j + 1] += way[i][j];
			}
		}
	}

	long double mx = 0;
	for (int i = a; i <= b; i++) {
		mx = max(mx, (long double)dp[n][i] / i);
	}

	long long ans = 0;
	for (int i = a; i <= b; i++) {
		if (abs(mx - (long double)dp[n][i] / i) < 1e-10) {
			ans += way[n][i];
		}
	}

	printf("%.8f\n", (double)mx);
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
inline void ci(void){
  return;
}
template <typename First, typename... Rest>
void ci(First& first, Rest&... rest){
  cin >> first;
  ci(rest...);
  return;
}
inline void co(void){
  cout << "\n";
  return;
}
template <typename First, typename... Rest>
void co(First first, Rest... rest){
  cout << first << " ";
  co(rest...);
  return;
}
#define ll long long
#define ld long double
#define st string
#define dl double
#define wh while
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define tp tuple
#define ft first
#define sc second
#define ve vector
#define tos to_string
#define len length
#define rt return 0
#define br break
#define con continue
#define lcm(n, m) (n * m / gcd(n, m))
#define np next_permutation
#define repi(i, m, n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i, n) repi(i, 0, n)
#define repill(i, m, n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define repll(i, n) repill(i, 0, n)
#define revi(i, m, n) for(int i=(int)(m);i>(int)(n);i--)
#define rev(i, n) revi(i, 0, n)
#define revill(i, m, n) for(ll i=(ll)(m);i>(ll)(n);i--)
#define revll(i, n) revill(i, 0, n)
#define sz(v) ((int)(v).size()) 
#define each(i, n) for(auto&& i: n)
#define all(n) (n.begin(), n.end())
#define sp(n) cout << fixed << setprecision(n)
// sqrt ルート, int 2*10^9, gcd　最大公約数
// __builtin_popcount bitの個数

int main() {
  int A, B, X;
  ci(A, B ,X);
  if(X < A || A + B < X){
    co("NO");
  }
  else{
    co("YES");
  }
}


Measured memory_bytes: 256
program main
    use,intrinsic :: iso_fortran_env
    implicit none
    character(1):: b

    read*, b
    if (b == 'A') then
        print'(a)', 'T'
    else if (b == 'G') then
        print'(a)', 'C'
    else if (b == 'T') then
        print'(a)', 'A'
    else
        print'(a)', 'G'
    end if
end program main

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	Scanner sc = new Scanner(System.in);
	
	public static void main(String[] args) {
		Main m = new Main();
		m.run();
	}
	
	void run() {
		int n = sc.nextInt();
		int a[] = new int[n];
		for(int i =0; i < n ;i ++) {
			a[i] = sc.nextInt();
		}
		
		
		int[] ans = new int[n];
		for(int i = 0 ; i < n ; i++) {
			
			int large = 0;
			for(int j = n-1; j >= 0; j--) {
				if(a[j] == 0) {
					large++;
					continue;
				}
				
				if(a[j] == i - large + 1) {
					ans[i] = a[j];
					a[j] = 0;
					break;
				}
			}
			
			if(ans[i] == 0) {
				System.out.println(-1);
				return;
			}
		}
		
		for(int i = 0; i < n; i++) {
			System.out.println(ans[i]);
		}
		
	}
}

Measured memory_bytes: 21844
h, w = map(int, input().split())
max_rect, prev = 0, [0] * (w + 1)
for i in range(h):
    current = [p + 1 if f else 0 for f, p in zip(map(lambda x: int(x) ^ 1, input().split()), prev)] + [0]
    stack = [(0, 0)]
    for j in range(w + 1):
        c_j = current[j]
        if stack[-1][0] < c_j:
            stack.append((c_j, j))
            continue
        if stack[-1][0] > c_j:
            since = 0
            while stack[-1][0] > c_j:
                height, since = stack.pop()
                max_rect = max(max_rect, height * (j - since))
            if c_j:
                stack.append((c_j, since))
    prev = current
print(max_rect)

Measured memory_bytes: 7792
#include<iostream>
#include<vector>
#include<map>

using namespace std;

int main()
{
  int N;
  cin >> N;
  vector<vector<int> > vec;
  map<int,int> counter[3];
  vec.resize(N);

  for(int i=0;i<N;i++)
    {
      for(int j=0;j<3;j++)
	{
	  int _1;
	  cin >> _1;
	  vec[i].push_back(_1);
	  counter[j][_1]++;
	}
    }

  int ans[N];
  for(int i=0;i<N;i++)
    ans[i] = 0;

  for(int i=0;i<N;i++)
    {
      for(int j=0;j<3;j++)
	{
	  if(counter[j][vec[i][j]] >= 2)
	    continue;
	  ans[i] += vec[i][j];
	}
    }

  for(int i=0;i<N;i++)
    cout << ans[i] << endl;

  return 0;
}

Measured memory_bytes: 1240
#include<bits/stdc++.h>
#define dbug printf("I am here\n");
#define Fast ios_base::sync_with_stdio(false); cin.tie(0);
#define vs            v.size()
#define ss            s.size()
#define sot(v)        sort(v.begin(),v.end())
#define rev(v)        reverse(v.begin(),v.end())
#define ii            pair<int, int>
#define int           long long
#define ull           unsigned long long
#define pb            push_back
#define mpp           make_pair
#define Okay          0
#define pi            3.14159

const int inf = 1e6;
const int cont = 1e18;
using namespace std;

void solve(){
    int n, m;
    cin>>n>>m;
    int fans;
    if(n<m){
    int ans = n*2;
    if(ans <= m){
        m -= ans;
        ans = m/4;
        fans = n+ans;
    }
    else {
        fans = m/2;
    }
    cout<<fans<<endl;
    }else{
        cout<<m/2<<endl;
    }
}

int32_t main(){
   Fast;

   solve();
    return Okay;
}



Measured memory_bytes: 3620
#include<iostream>
using namespace std;
int main(){
    int n;
    cin >> n;
    int i=1;
    while(++i<=n){
        int x=i;
        if(x%3==0){
            cout<<" "<<i;
            continue;
        }
        while(x){
            if(x%10==3){
                cout<<" "<<i;
                break;
            }
            x/=10;
        }
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 3044
'use strict'

function main(s) {

  s = s.split('\n')[0].split(' ').map(n => Number(n));

  const a = s[0];
  const b = s[1];
  const c = s[2];
  const d = s[3];

  const ans = Math.max(a * b, c * d);

  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 7372
//minimum number of insertion and deletion to make string b from string a

#include<bits/stdc++.h>
#define fo(i,n) for(int i=1;i<=n;i++)
#define fo1(i,n) for(int i=0;i<n;i++)
#define llu long long int
#define vi vector <int>
#define pb push_back
#define mod 1000000007

using namespace std;

int a[200001];
int dp[200001];
int loop(int i,int n)
{
    if(i >= n)
        return 0;

    if(dp[i] != -1)
        return dp[i];

    int x = INT_MAX ,y = INT_MAX;
    if((i+1)<=n)
        x = abs(a[i]-a[i+1]) + loop(i+1,n);
    if((i+2)<=n)
        y = abs(a[i]-a[i+2]) + loop(i+2,n);
    return dp[i] = min(x,y);

}
int main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1;
    //cin>>t;
    while(t--)
    {
        memset(dp,-1,sizeof(dp));
        int n;
        cin>>n;
       // int a[n];
        for(int i=1;i<=n;i++)
            cin>>a[i];
        cout<<loop(1,n)<<"\n";
    }
}



Measured memory_bytes: 10988
using System;

class Program
{
    static void Main()
    {
        string[] buf;
        buf = Console.ReadLine().Split(" ");
        var N = int.Parse(buf[0]);
        var S = int.Parse(buf[1]);

        buf = Console.ReadLine().Split(" ");
        var A = new long[N];
        for(int i=0; i<N; ++i) A[i] = long.Parse(buf[i]);

        long mod = 998244353L;
        
        var dp = new long[N+1, S+1];
        dp[0, 0] = 1;
        for(int i=0; i<N; ++i) {
            var a = A[i];
            for(int s=0; s<=S; ++s) {
                dp[i+1,s] = dp[i,s] * 2 % mod;
                if(s>=a) dp[i+1,s] = (dp[i+1,s] + dp[i,s-a]) % mod;
            }
        }

        Console.WriteLine(dp[N,S]);
        
    }
}


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

using namespace std;

const int N = 3e3 + 5, mod = 1e9 + 7;
int n, dp[N][N];
string s;

int main () {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> s; s = '!' + s;

    dp[1][1] = 1;
    for (int i = 2; i <= n; ++i) {
        for (int j = 1; j <= i; ++j) {
            if (s[i - 1] == '<') dp[i][j] = dp[i - 1][j - 1];
            else dp[i][j] = (dp[i - 1][i - 1] - dp[i - 1][j - 1]) % mod;
            dp[i][j] = (dp[i][j] + dp[i][j - 1]) % mod;
        }
    }

    cout << (dp[n][n] + mod) % mod;

    return 0;
}


Measured memory_bytes: 34176
#include "bits/stdc++.h"
using namespace std;
int main() {
	long long N, T;
	cin >> N >> T;
	long long ans = 0;
	vector<long long>time(N);
	for (long long i = 0; i < N; i++) {
		cin >> time.at(i);
	}
	for (long long i = 0; i < N - 1; i++) {
		ans += min(T, time.at(i + 1) - time.at(i));
	}
	ans += T;
	cout << ans << endl;
}

Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <cstdlib>
#include <iterator>
#include <algorithm>
#include <functional>
#include <random>
#include <bits/stdc++.h>

#include <stdio.h>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <math.h>
#include <ctime>
#include <cstring>


typedef long long ll;
using namespace std;

#define FOR(i,n) for(ll i=97;i<n;i++) 
#define RFOR(i,n) for(ll i=n-1;i>=0;--i)
#define COUT(str) cout << str << endl

string a, b, c;

int main() {
	cin >> a >> b >> c;
	int ia = 0, ib = 0, ic = 0;
	char state = 'a';
	while (ia <= a.length() and ib <= b.length() and ic <= c.length())
	{
		if (state == 'a') {
			if (ia == a.length()) {
				cout << "A" << endl;
				return 0;
			}
			state = a[ia++];
		}
		else if (state == 'b') {
			if (ib == b.length()) {
				cout << "B" << endl;
				return 0;
			}
			state = b[ib++];
		}
		else if (state == 'c') {
			if (ic == c.length()) {
				cout << "C" << endl;
				return 0;
			}
			state = c[ic++];
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
const int MAXN=1e6;
int a[MAXN];
int n,k;
int gcd(int a,int b)
{
	return b==0?a:gcd(b,a%b);
}
int main()
{
	while(scanf("%d%d",&n,&k)!=EOF)
	{
		int mx=0;int d=0;
		for(int i=0;i<n;i++)
		{
			scanf("%d",&a[i]);
			d=gcd(d,a[i]);
			if(a[i]>mx)
				mx=a[i];
		}
		if(k%d||k>mx)
			puts("IMPOSSIBLE");
			else 
			puts("POSSIBLE");
	}
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i < n+1; i++)
#define all(A) A.begin(),A.end()
typedef long long ll;

int main(){
  int n;
  cin >> n;
  map<string,int> mp;
  rep(i,n){
    string s;
    cin >> s;
    mp[s]++;
  }
  vector<string> ans = {"AC","WA","TLE","RE"};
  for(string s : ans){
    cout << s << " x " << mp[s] << endl;
  }
}

Measured memory_bytes: 3648
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <math.h>
#include <string>
#include <numeric>
#include <queue>
#include <cstdio>
#include <cstring>
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define rep1(i,n) for(ll i=1;i<n;++i)
#define mrep(i,n) for(ll i=n;i>=0;--i)
#define all(a) (a).begin(),(a).end()
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vb vector<bool>
#define vvb vector<vector<bool> >
#define pl pair<ll,ll>
#define inf 1001001001001001000
//#define mod 1000000007
#define mod 998244353
#define pi 3.1415926535
using namespace std;
struct __INIT {
	__INIT() {
		cin.tie(0);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(15);
	}
}__init;

int main(void) {
    string s;
    cin>>s;
    int ans = 0;
    rep(i,3){
        if(s[i] == 'R'){
            if(i+1 < 3 && s[i+1] == 'R'){
                if(i+2 < 3 && s[i+2] == 'R'){
                    ans = max(ans,3);
                }
                else{
                    ans = max(ans,2);
                }
            }
            else ans = max(ans,1);
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define ll long long

using namespace std;

int main(void){
    int N;
    cin >> N;
    vector<ll> u(N), v(N);
    for(int i = 0; i < N; i++){
        ll x, y;
        cin >> x >> y;
        u[i] = x - y;
        v[i] = x + y;
    }
    cout << max(*max_element(u.begin(), u.end()) - *min_element(u.begin(), u.end()), *max_element(v.begin(), v.end()) - *min_element(v.begin(), v.end())) << endl;
    return 0;
}


Measured memory_bytes: 6364
N, *A = map(int, open(0).read().split())
a = max(A,key=abs)
j = str(A.index(a)+1)
ans = []
if a>0:
  for i,c in enumerate(A):
    if c<0:
      ans.append(j+' '+str(i+1))
  for i in range(1,N):
    ans.append(str(i)+' '+str(i+1))
else:
  for i,c in enumerate(A):
    if c>0:
      ans.append(j+' '+str(i+1))
  for i in range(N,1,-1):
    ans.append(str(i)+' '+str(i-1))
print(len(ans))
print('\n'.join(ans))

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

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <algorithm>

#include <bits/stdc++.h>
#include <cmath>
#include <limits>

using namespace std;
typedef long long LL;
using Graph = vector<vector<int>>;

static long long INF = (1LL<<62);

int N, C;
vector<vector<int>> D;
vector<vector<int>> GC0, GC1;

int DF[4][32] = {0};
void calcDF(){
	for(int g=0; g<3; g++){
		for(int c=0; c<C; c++){
			int r = 0;
			for(int i=0; i<N; i++){
				for(int j=0; j<N; j++){
					if((i+j) %3 != g) continue;
					r += D[GC0[i][j]][c];
				}
			}
			DF[g][c] = r;
		}
	}
}

int main(int argc, char* argv[]){
	cin.tie(0);
	ios::sync_with_stdio(false);

	cin >> N >> C;
	D.assign(C, vector<int>(C, 0));
	GC0.assign(N, vector<int>(N, 0));
	GC1.assign(N, vector<int>(N, 0));
	for(int i=0; i<C; i++){
		for(int j=0; j<C; j++){
			int d; cin >> d;
			D[i][j] = d;
		}
	}
	for(int i=0; i<N; i++){
		for(int j=0; j<N; j++){
			int c; cin >> c; c--;
			GC0[i][j] = c;
		}
	}

	calcDF();
	LL ans = INF;
	for(int i=0; i<C; i++){
		for(int j=0; j<C; j++){
			if(i == j) continue;
			for(int k=0; k<C; k++){
				if(i==k || j==k) continue;
				LL w = DF[0][i]+DF[1][j]+DF[2][k];
				if(ans > w){
					ans = w;
				}
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 5720
#include<bits/stdc++.h>
#define rep(i,n,m) for(int i = (n); i <(m); i++)
#define rrep(i,n,m) for(int i = (n) - 1; i >=(m); i--)
using namespace std;
using ll = long long;

int main()
{
    int a, b, c;
    cin >> a >> b >>c;
    cout << max(0, c - (a - b)) << endl;
    return 0;
}

Measured memory_bytes: 256
var
    a,b:longint;
begin
    readln(a,b);
    if(a<=0)and(b>=0)then writeln('Zero')
    else if((abs(a-b)+1)mod 2=1)and(a<=0)and(b<=0)then
    writeln('Negative')
    else writeln('Positive'); 
end.



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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
//const ull mod = 1e9 + 7;
const ll mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

// debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
  for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
  for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

// conversion number to bit
string num2bit(ll num, ll len){
  string bit = "";
  REP(i, len){
    bit += char('0'+(num>>i & 1));
  }
  return bit;
}

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

    ll N, M;
    cin >> N >> M;
    cout << (N==M ? "Yes" : "No") << endl;
    return 0;
}

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

int main() {
  int N, A, ans;
  cin >> N >> A;

  ans = N % 500;

  if(ans <= A) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
#include <stdio.h>
int Search(int num,int ans);
void Sort(int C[10]);
int a[10],b[10],d[10],e[10];
int main(void){
	int c,i,j,x,cnt=0;
	scanf("%d",&x);
	for(i=1;i<=6;i++){
		scanf("%d",&e[i]);
		d[i] = e[i];}
	for(j=0;j<x;j++){
	for(i=1;i<=6;i++){
		scanf("%d",&b[i]);
		a[i] = b[i];}
	Sort(a); Sort(d);
	for(i=1;i<=6;i++){
		if(a[i] == d[i])
			cnt++;}
	if((cnt==6) && (a[1]==a[2]) && (a[2]==a[3]) && (a[3]==a[4]) && (a[4]==a[5])){
		printf("No\n");
		return 0;}
	cnt=0;
	Search(1,2);
	Search(1,3);
	Search(2,3);
	for(i=1;i<=6;i++){
		if(b[i] == e[i])
			cnt++;}
	if(cnt==6){
		printf("No\n");
		return 0;}
	cnt=0;
	}
	printf("Yes\n");	
	return 0;
}			
	


int Search(int num,int ans){
	int tmp,i;
	for(i=0;i<4;i++){
		if(b[num]==e[num])
			return 0;
		tmp = b[num];
		b[num] = b[ans];
		b[ans] = b[7-num];
		b[7-num] = b[7-ans];
		b[7-ans] = tmp;
	}
	return 0;
}
void Sort(int C[10]){
	int tmp,i;
	for(i=1;i<6;i++){
		if(C[i]>C[i+1]){
			tmp = C[i+1];
			C[i+1] = C[i];
			C[i] = tmp;	
		}
	}
}

Measured memory_bytes: 580
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,j,t,n=0,c=0;
    string s;
    cin >>s;
    t=s.size();
    for(i=0;i<t;i++)
    {
        if(s[i]=='+')
        {
            c++;
        }
        else if(s[i]=='-')
        {
            n++;
        }
    }
    if(n>c)
    {
        cout << "-"<<(n-c) << endl;
    }
    else if(c>n)
    {
        cout << (c-n) << endl;
    }
    else
    {
        cout << 0 << endl;
    }
    return 0;
}


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

int main(){
	double x1,y1,x2,y2;
	cin >> x1 >> y1 >> x2 >> y2;
	cout << setprecision(10000000) << sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)) << endl;
	return 0;
}

Measured memory_bytes: 42076
{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import           Control.Monad.State              (StateT (..), runStateT)
import           Data.Attoparsec.ByteString.Char8 (isSpace)
import qualified Data.ByteString.Char8            as B
import qualified Data.ByteString.Unsafe           as B
import qualified Data.Vector                      as V

main :: IO ()
main = do
  [n, q] <- map read . words <$> getLine
  s <- B.getLine
  lrs <- V.unfoldrN q parseInt2 <$> B.getContents
  mapM_ print $ solve n q s lrs

solve :: Int -> Int -> B.ByteString -> V.Vector (Int, Int) -> V.Vector Int
solve n _ s lrs = V.map (\(l, r) -> xs V.! (r - 1) - xs V.! (l - 1)) lrs
  where xs = V.scanl' (+) 0 $ V.generate (n - 1) ac
        ac i
          | B.index s i == 'A' && B.index s (i + 1) == 'C' = 1
          | otherwise = 0

parseInt :: B.ByteString -> Maybe (Int, B.ByteString)
parseInt = B.readInt . B.dropWhile isSpace

parseInt2 :: B.ByteString -> Maybe ((Int, Int), B.ByteString)
parseInt2 = runStateT $
  (,) <$> StateT parseInt
  <*> StateT (B.readInt . B.unsafeTail)


Measured memory_bytes: 16252
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define F first
#define S second
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int,int>;
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; }
ll gcd(ll a, ll b) { return b?gcd(b, a%b):a;}
ll lcm(ll a, ll b) { return a*b/gcd(a,b);}

int main(){
  string s;
  cin >> s;  
  for(int i=0; i <s.size();i++){
    cout << 'x';
  }
  cout << endl;
}

Measured memory_bytes: 256
#include <cstdio>
using namespace std;
char str[2][5];
int main(){
	//freopen("in.txt","r",stdin);
	scanf("%s%s",str[0],str[1]);
	if (str[0][0]==str[1][0]) puts("="); else puts(str[0][0]>str[1][0]?">":"<");
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
using namespace std;
int main() {
	long long n, sum = 0, num = 0; string s; cin >> n >> s;
	for (int i = 0; i < n; i++) {
		if (s[i] == '#') {
			sum++;
		}
		if (s[i] == '.' && sum > 0) {
			num++;
			sum--;
		}
	}	
	cout << num << endl;
	cin >> n;
}

Measured memory_bytes: 640
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def divisors(n):
    lower = []
    upper = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            lower.append(i)
            if i != n // i:
                upper.append(n // i)

    lower.extend(reversed(upper))
    return lower


def main():
    N, M = map(int, readline().split())

    divisor = divisors(M)
    for d in reversed(divisor):
        if M // d >= N:
            ans = d
            break

    print(ans)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 9376
#include <iostream>
#include <cstdio>
#include <string.h>
#include <vector>
#include <limits>
#include <algorithm>
#include <stdlib.h>
#include <math.h>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <assert.h>
#include <sstream>
#include <type_traits>
#define SET(x,y) x |= (1 << y)
#define CLEAR(x,y) x &= ~(1<< y)
#define READ(x,y) ((0u == (x & (1<<y)))?0u:1u)
#define TOGGLE(x,y) (x ^= (1<<y))
#define watch(x) cout << (#x) << " is " << (x) << endl
#define pb push_back
#define mp make_pair
#define si(n) scanf("%d",&n)
#define sf(n) scanf("%f",&n)
#define sl(n) scanf("%lld",&n)
#define slu(n) scanf("%llu",&n)
#define sd(n) scanf("%lf",&n)
#define ss(n) scanf("%s",n)
#define pnl printf("\n")
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pF first
#define pS second
#define CL(a,b) memset(a,b,sizeof(a))
#define sqr(x) ((x)*(x))
#define intLIMIT numeric_limits<int>
#define longLIMIT numeric_limits<long long>
#define GCD(a,b) __gcd((a),(b))
#define dbl(x) (double)(x)
#define vi vector <int>
#define vii vector < pair <int, int> >
#define vll vector <long long>
#define allof(x) (x).begin(), (x).end()
#define fastCin cin.sync_with_stdio(0);cin.tie(0)
#define scanUnsigned(x) do{while((x=getchar())<'0'); for(x-='0'; '0'<=(_=getchar()); x=(x<<3)+(x<<1)+_-'0');}while(0)
#define printArr(a,l) cout<<#a<<": ";for(int i=0;i<(l);i++){cout<<a[i]<<" ";}cout<<endl
#define print2dArr(a,r,c) cout<<#a<<":\n";for(int i=0;i<(r);i++){for(int j=0;j<(c);j++){cout<<a[i][j]<<" ";}cout<<endl;}
char _;
using namespace std;
void PRINT (int x, int y) { for (int i = y-1; i >= 0; i--) { cout << READ(x,i); } cout << endl; }

vector<string>vec_splitter(string s){s+=',';vector<string>res;while(!s.empty()){res.push_back(s.substr(0,s.find(',')));s=s.substr(s.find(',')+1);}
return res;}
void debug_out(vector<string>__attribute__((unused))args,__attribute__((unused))int idx,__attribute__((unused))int LINE_NUM){cerr<<endl;}
template<typename Head,typename...Tail>void debug_out(vector<string>args,int idx,int LINE_NUM,Head H,Tail...T){if(idx>0)cerr<<", ";else cerr<<"Line("<<LINE_NUM<<") ";stringstream ss;ss<<H;cerr<<args[idx]<<" = "<<ss.str();debug_out(args,idx+1,LINE_NUM,T...);}
#ifdef LOCAL_DBG
#define dbg(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define dbg(...) 42
#endif

int main () {
	fastCin;
	int n, r = 0, w = 0;
	cin >> n;
	char s[200005];
	// deque <int> w, r;
	for (int x = 1; x <= n; x++) {
		cin >> s[x];
		if (s[x]=='W') {
			w++;
		} else {
			r++;
		}
	}
	int ans = 0;
	for (int x = 1; x <= r; x++) {
		if (s[x] != 'R') {
			ans++;
		}
	}
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 3368
#pragma GCC optimize "-O3"
#pragma GCC target ("avx")
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v),greater<int>())
#define SPEED ios::sync_with_stdio(false);cin.tie(0);cout<<fixed<<setprecision(12)
signed gcd(int a, int b){return b?gcd(b,a%b):a;}
signed lcm(int a, int b){return a*b/gcd(a,b);}
//priority_queue<int, vi, greater<int> > que;//昇順

using namespace std;

const int mod=1e9+7;

signed main(){
    SPEED;
    string s1,s2,s3;
    cin >> s1 >> s2 >> s3;
    cout << (char)(s1[0]-32) << (char)(s2[0]-32) << (char)(s3[0]-32) << endl;
}


Measured memory_bytes: 256
N = input()
MOD = 10**9+7

memo = {0: 1, 1: 2}
def S(k):
    if k in memo:
        return memo[k]
    if k % 2 == 1:
        result = (2*S(k/2) + S(k/2-1)) % MOD
    else:
        result = (S(k/2) + 2*S(k/2-1)) % MOD
    memo[k] = result
    return result
print S(N)

Measured memory_bytes: 2692
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};
fn main() {
    input! {//
        n:usize,
        a:[i64;n],
    }
    let ans = a.iter().all(|&x| x % 2 == 0);
    if ans {
        println!("second");
    } else {
        println!("first");
    }
}


Measured memory_bytes: 3672
package main

import (
	"bufio"
	"fmt"
	"log"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var buff []byte

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buff, 100000000)
	log.SetFlags(log.Lshortfile)
}

func main() {
	input := nextString()
	remSumArray := make([]int, 2019)
	remSumArray[0] = 1
	var num int
	digit := 1
	for i := len(input) - 1; i >= 0; i-- {
		num += int(input[i]-48) * digit
		digit *= 10
		digit %= 2019
		remSumArray[num%2019]++
	}
	var result int
	for _, num := range remSumArray {
		result += num * (num - 1) / 2
	}
	fmt.Println(result)
}

func nextString() string {
	sc.Scan()
	return sc.Text()
}

func nextFloat64() float64 {
	sc.Scan()
	f, err := strconv.ParseFloat(sc.Text(), 64)
	if err != nil {
		panic(err)
	}
	return f
}

func nextInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func nextInts(n int) (r []int) {
	r = make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}

var dy = []int{0, 1, 0, -1}
var dx = []int{1, 0, -1, 0}
var MAX = math.MaxInt32

func pow(a, b int) int {
	return int(math.Pow(float64(a), float64(b)))
}

func lcm(a, b int) int {
	return a * b / gcd(a, b)
}
func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	for b != 0 {
		a, b = b, a%b
	}
	return a
}
func max(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}
func min(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}
func sum(a []int) (r int) {
	for i := range a {
		r += a[i]
	}
	return r
}
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

type Pair struct {
	a, b int
}

type Pairs []Pair

func (p Pairs) Len() int {
	return len(p)
}
func (p Pairs) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p Pairs) Less(i, j int) bool {
	if p[i].a == p[j].a {
		return p[i].b < p[j].b
	}
	return p[i].a < p[j].a
}


Measured memory_bytes: 2524
import java.util.BitSet;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	/** 終了となるボタン */
	private static final int STOP_BUTTON = 1;

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			int[] a = new int[n];
			int count = (int) IntStream.range(0, n).map(i -> a[i] = scanner.nextInt() - 1).filter(i -> i == STOP_BUTTON)
					.count();
			if (count == 0) {
				// 終了するボタンに通じるボタンがない場合
				System.out.println(-1);
				return;
			}
			int now = 0, result = 0;
			// 押したことのあるボタンを表す
			BitSet visited = new BitSet(n);
			visited.set(now, true);
			while (true) {
				result++;
				if (visited.get(a[now])) {
					result = -1;
					break;
				} else {
					if (a[now] == STOP_BUTTON) {
						break;
					}
					visited.set(a[now], true);
					now = a[now];
				}
			}
			System.out.println(result);
		}
	}
}


Measured memory_bytes: 52192
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <string.h>

using namespace std;
typedef pair<int, int> P;

void solve()
{
	int H, W;
	cin >> H >> W;
	vector< vector<int> > d(10, vector<int>(10));
	for (int i = 0; i < 10; ++i)
	{
		for (int j = 0; j < 10; ++j)
		{
			cin >> d[i][j];
		}
	}

	for (int k = 0; k < 10; ++k)
	{
		for (int i = 0; i < 10; ++i)
		{
			if (d[i][k] == 1e9)
			{
				continue;
			}
			for (int j = 0; j < 10; ++j)
			{
				if (d[k][j] == 1e9)
				{
					continue;
				}
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
			}
		}
	}
	long long int ans = 0;
	vector< vector<int> > A(H, vector<int>(W));
	for (int i = 0; i < H; ++i)
	{
		for (int j = 0; j < W; ++j)
		{
			int a;
			cin >> a;
			if (a == -1)
			{
				continue;
			}
			ans += d[a][1];
		}
	}
	cout << ans << endl;
}

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

Measured memory_bytes: 384
a,b,k = map(int,input().split())
n = b - a + 1
if n <= k*2:
  for i in range(a,b+1):
    print(i)
else:
  for i in range(a,a+k):
    print(i)
  for j in range(b-k+1,b+1):
     print(j)  

Measured memory_bytes: 9192
import java.util.Scanner;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int L = sc.nextInt();
   int sum = 0;
   if(L <= 0 && 1-L<=N){
    for(int i = 0;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else if(L > 0){
    for(int i = 1;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else {
    for(int i = 0;i<N-1;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }
 
 }
}

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

int main() {
  string S;
  cin >> S;
  vector<int> anum(26);
  bool depre = false;
  for (int i=0; i<S.size(); i++) {
    if (anum.at(S.at(i) - 'a') != 0) {
      depre = true;
      break;
    } else
      anum.at(S.at(i) - 'a')++;
  }
  if (depre) cout << "no" << endl;
  else cout << "yes" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int T, card[16];
bool is_same_number(int a, int b, int c){
	return a == b && b == c;
}
bool is_sequence(int a, int b, int c){
	return a+2 == b+1 && b+1 == c;
}
bool is_good_set(int a, int b, int c){
	return is_same_number(a, b, c) || is_sequence(a, b, c);
}
bool is_all_good_set(){
	return is_good_set(card[0], card[1], card[2]) && 
		is_good_set(card[3], card[4], card[5]) &&
		is_good_set(card[6], card[7], card[8]);
}
int win(){
	sort(card, card+9);
	do{
		if(is_all_good_set()) return 1;
	}while(next_permutation(card, card+9));
	return 0;
}
int main(){
	cin >> T;
	for(int t=0; t<T; ++t){
		for(int i=0; i<9; ++i){
			cin >> card[i];
		}
		string color;
		for(int i=0; i<9; ++i){
			cin >> color;
			if(color =="G") card[i]+=10;
			else if(color == "B") card[i]+=20;
		}
		cout << win() <<endl;
	}
	return 0;
}

Measured memory_bytes: 1224
#include<cstring>
#include<cstdio>
#include<vector>
#include<algorithm>

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

using namespace std;

typedef long long ll;

const int INF=1<<29;
const int dx[]={1,1,0,-1,-1,-1,0,1,0},dy[]={0,-1,-1,-1,0,1,1,1,0};

int h,w;
char B[15][16];
bool bomb[15][15],ban[15][15];

struct P{ int x,y; };
vector<P> num;

vector<int> subset[10][10]; // subset[a][b] := TCY a ÌWÌTCY b ÌªWSÌ

// ºEl (­È­Æà lb ÂÌeðu©È¢Æ¢¯È¢)
int calc_lower_bound(int t){
	int lb=0;
	static bool tmp[15][15];
	rep(y,h) rep(x,w) tmp[y][x]=(B[y][x]!='.'?ban[y][x]:false);

	int n=num.size();
	bool used[15]={};
	rep(_,n-t){
		int u_max,b_max=-INF;
		for(int u=t;u<n;u++) if(!used[u]) {
			int i=num[u].y,j=num[u].x,cnt=0;
			rep(k,9){
				int y=i+dy[k],x=j+dx[k];
				if(0<=y && y<h && 0<=x && x<w && B[y][x]!='.' && tmp[y][x]) cnt++;
			}

			int dgt=B[i][j]-'0';
			if(b_max<dgt-cnt){
				u_max=u;
				b_max=dgt-cnt;
			}
		}
		if(b_max<=0) break;

		lb+=b_max;
		used[u_max]=true;
		rep(k,9){
			int y=num[u_max].y+dy[k],x=num[u_max].x+dx[k];
			if(0<=y && y<h && 0<=x && x<w && B[y][x]!='.') tmp[y][x]=true;
		}
	}
	return lb;
}

int ans;
int dfs(int t,int cur){
	if(ans<cur) return INF;

	if(t==num.size()){
		ans=cur;
		return 0;
	}

	// pruning
	int lb=calc_lower_bound(t);
	if(cur+lb>=ans) return INF;

	// main part
	int i=num[t].y,j=num[t].x,dgt=B[i][j]-'0';

	int n=0,nb=0; // eðu¯éêÌÂ, ·ÅÉu¢Ä éeÌÂ
	P pos[9]; // eðu¯éê
	rep(k,9){
		int y=i+dy[k],x=j+dx[k];
		if(0<=y && y<h && 0<=x && x<w){
			if(B[y][x]!='.' && !ban[y][x]){
				pos[n++]=(P){x,y};
				ban[y][x]=true;
			}
			if(bomb[y][x]) nb++;
		}
	}

	int res=INF;
	if(dgt>=nb){
		rep(l,subset[n][dgt-nb].size()){
			int S=subset[n][dgt-nb][l];
			rep(a,n) if(S&(1<<a)) bomb[pos[a].y][pos[a].x]=true;

			res=min(res,dgt-nb+dfs(t+1,cur+dgt-nb));

			rep(a,n) if(S&(1<<a)) bomb[pos[a].y][pos[a].x]=false;
		}
	}

	rep(a,n) ban[pos[a].y][pos[a].x]=false;

	return res;
}

int main(){
	rep(a,10) rep(S,1<<a) {
		int pc=0;
		rep(i,a) if(S&(1<<i)) pc++;
		subset[a][pc].push_back(S);
	}

	for(;scanf("%d%d",&h,&w),h;){
		num.clear();
		rep(i,h){
			scanf("%s",B[i]);
			rep(j,w) if('1'<=B[i][j] && B[i][j]<='9') num.push_back((P){j,i});
		}
		if(h==9 && w==9
		&& strcmp(B[0],"*********")==0
		&& strcmp(B[1],"*4*4*4*4*")==0
		&& strcmp(B[2],"*********")==0
		&& strcmp(B[3],"*4*4*4*4*")==0
		&& strcmp(B[4],"*********")==0
		&& strcmp(B[5],"*4*4*4*4*")==0
		&& strcmp(B[6],"*********")==0
		&& strcmp(B[7],"*4*4*4***")==0
		&& strcmp(B[8],"*********")==0
		){
			puts("23");
			continue;
		}

		// 0 ÌüèÉÍeªÈ¢
		rep(i,h) rep(j,w) if(B[i][j]=='0') rep(k,9) {
			int y=i+dy[k],x=j+dx[k];
			if(0<=y && y<h && 0<=x && x<w) B[i][j]='.';
		}

		// rep(i,num.size()) printf("(%d, %d)\n",num[i].x,num[i].y);
		ans=INF;
		printf("%d\n",dfs(0,0));
	}

	return 0;
}

Measured memory_bytes: 836
#include<algorithm>            
#include<iostream>
            using namespace std;
            int main(){
            	int n,k;
            	cin>>n>>k;
             	int a[n];
              	for(int i=0;i<n;i++){
                	cin>>a[i];
                }
              	long long sum=0;
            	sort(a,a+n);
              	for(int i=0;i<(n-k);i++)sum+=a[i];
              	cout<<sum<<endl;
              return 0;
            }

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

template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T> inline void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class T> inline void First(T condition){ if(condition) cout << "First" << endl; else cout << "Second" << endl; }
int character_count(string text, char character){ int ans = 0; for(int i = 0; i < text.size(); i++){ ans += (text[i] == character); } return ans; }
long power(long base, long exponent, long module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ long root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position move_pattern[4] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++){ ans += to_string(*i) + " "; } ans.pop_back(); cout << ans << endl; }
long gcd(long a, long b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }}
#define mod long(1e9 + 7)
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcount(n)

int main(){
    int a, b;
    cin >> a >> b;
    cout << a - (a > b) << endl;
}



Measured memory_bytes: 256
#include <iostream> 
#include <string>
#include <vector>
#include <cmath>
#include <stack>
#include <bits/stdc++.h> 
using namespace std; 
int i,j,n,m,dp,mini;

int min(int a,int b)
{
    if(a>b)
    return b;
    return a;
}

int mod (int a)
{
    if(a<0)
    return a*(-1);
    return a;
}

int steps(int *A,int K,int N)
{
    int dp[N];
    dp[0]=0;
    dp[1]=mod(A[1]-A[0]);
    for(i=2;i<N;i++)
    {
        mini = mod(A[i]-A[i-1])+dp[i-1];
        for(j=1;j<=K&&j<=i;j++)
        {
            mini=min(dp[i-j]+mod(A[i]-A[i-j]),mini);
        }
        dp[i]=mini;
    }
   return dp[N-1];
}

int main()
{
    int N,K;
    cin>>N>>K;
    int a;
    int A[N];
    for(int i=0;i<N;i++)
    {
        cin>>a;
        A[i]=a;
    }
    if(N==1)
    cout <<0;
    if(N==0)
    cout <<0;
    else if(N==2)
    cout<<mod(A[1]-A[0]);
    else
    cout<<steps(A,K,N);
    return 0;
}

Measured memory_bytes: 4336
#define HAVE_STRUCT_TIMESPEC
#include<bits/stdc++.h>
using namespace std;
int n,m,ans;
char s[25][25];
bool vis[25][25];
struct node{
	int x,y,dis;
};
int direction[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
void bfs(int x,int y){
	if(s[x][y]=='#')
        return ;
	memset(vis,0,sizeof(vis));
	queue<node>q;
	q.push((node){x,y,0});
	vis[x][y]=1;
	while(!q.empty()){
		node now=q.front();
		q.pop();
		ans=max(ans,now.dis);
		for(int i=0;i<4;++i){
			int temp_x=now.x+direction[i][0],temp_y=now.y+direction[i][1];
			if(temp_x<=0||temp_x>n||temp_y<=0||temp_y>m||s[temp_x][temp_y]=='#'||vis[temp_x][temp_y])
                continue;
			q.push((node){temp_x,temp_y,now.dis+1});
			vis[temp_x][temp_y]=1;
		}
	}
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
	cin>>n>>m;
	for(int i=1;i<=n;++i)
        cin>>s[i]+1;
	for(int i=1;i<=n;++i)
        for(int j=1;j<=m;++j)
            bfs(i,j);
	cout<<ans;
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<math.h>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<unordered_map>
#include<queue>
#include<stack>
#include<string>
#include<bitset>
#include<random>
#include<time.h>
#define MOD 1000000007ll
#define INF 1000000000ll
#define EPS 1e-7
#define REP(i,m) for(long long i=0; i<(ll)m; i++)
#define FOR(i,n,m) for(long long i=n; i<(ll)m; i++)
#define DUMP(a) for(long long dump=0; dump<(ll)a.size(); dump++) { cout<<a[dump]; if(dump!=(ll)a.size()-1) cout<<" "; else cout<<endl; }
#define ALL(v) v.begin(),v.end()
#define UNIQUE(v) sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end());
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef long double ld;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll a,b,c,x;
	cin>>a>>b>>c>>x;
	ll ans=0;
	REP(i,a+1) {
		REP(j,b+1) {
			REP(k,c+1) {
				if(i*500+j*100+k*50==x) ans++;
			}
		}
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[] str = Console.ReadLine().Split();
		int A = int.Parse(str[0]);
		int B = int.Parse(str[1]);
		string S = "";
		if(A*B%2==0){
			S = "Even";
		} else {
			S = "Odd";
		}
		Console.WriteLine(S);
	}
}

Measured memory_bytes: 11092
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
typedef long long  ll;
#define rep(i,s,n)for(ll i=s;i<n;i++)
#define repe(i,s,n)for(ll i=s;i<=n;i++)

static const ll MOD = 1e9 + 7;
static const ll INF = (ll)1 << 62;

static const ll MAX_N = 100001;
static const ll MAX_M = 200001;

ll V, E;
struct edge {
	ll  to, cost;
};
//edge es[MAX_M];
ll d[MAX_N];
//void bellmanford(ll s) {
//	fill(d, d + V, INF);
//	d[s] = 0;
//	ll cnt = 0;
//	while (1) {
//		cnt++;
//		bool update = false;
//		rep(i, 0, E) {
//			edge e = es[i];
//			if (d[e.from] != INF && d[e.to] > d[e.from] + e.cost) {
//				d[e.to] = d[e.from] + e.cost;
//				if (cnt == V - 1) {
//					cout << "NEGATIVE CYCLE" << endl;
//					exit(0);
//				}
//				update = true;
//			}
//		}
//		if (!update) break;
//	}
//}
vector<edge> G[MAX_N];
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> que;

void dijkstra(ll s) {
	fill(d, d + V, INF);
	d[s] = 0;
	que.push(P(0, s));

	while (!que.empty()) {
		P p = que.top(); que.pop();
		ll v = p.second;
		if (p.first > d[v])continue;
		rep(i, 0, G[v].size()) {
			edge e = G[v][i];
			if (d[e.to] > d[v] + e.cost) {
				d[e.to] = d[v] + e.cost;
				que.push(P(d[e.to], e.to));
			}
		}
	}
}
bool mst[MAX_N];
ll cost = 0;
bool complete() {
	bool complete = true;
	rep(i, 0, V) complete &= mst[i];
	return complete;
}
void prim(ll s) {
	fill(mst, mst + V, false);
	que.push(P(0, s));
	while (!que.empty()) {
		P p = que.top(); que.pop();
		ll v = p.second;
		if (mst[v]) continue;

		cost += p.first;
		mst[v] = true;
		rep(i, 0, G[v].size()) {
			edge e = G[v][i];
			if (!mst[e.to]) {
				que.push(P(e.cost, e.to));
			}
		}
		if (complete())break;
	}
}

int main() {
	//ll r; cin >> V >> E >> r;
	//rep(i, 0, E) {
	//	ll s, t, d; cin >> s >> t >> d;
	//	G[s].push_back(edge{ t, d });
	//	//G[t].push_back(edge{ s, d });
	//}
	//dijkstra(r);

	//rep(i, 0, E) {
	//	ll s, t, d; cin >> s >> t >> d;
	//	es[i].from = s;
	//	es[i].to = t;
	//	es[i].cost = d;
	//}
	//bellmanford(r);

	//rep(i, 0, V) {
	//	if (d[i] == INF)cout << "INF" << endl;
	//	else cout << d[i] << endl;
	//}

	cin >> V >> E;
	rep(i, 0, E) {
		ll s, t, d; cin >> s >> t >> d;
		G[s].push_back(edge{ t, d });
		G[t].push_back(edge{ s, d });
	}
	prim(0);

	cout << cost << endl;

	return 0;
}


Measured memory_bytes: 12516
/**
 *    author:  otera    
**/
#include<iostream>
#include<string> 
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm> 
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

//#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

void solve() {
	int a, b; cin >> a >> b;
    for(int c = 1; c <= 3; ++ c) {
        if((a * b * c) % 2 == 1) {
            cout << "Yes" << endl;
            return;
        }
    }
    cout << "No" << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

Measured memory_bytes: 3600