akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < ll(n); i++)

const ll mod = 1000000007;
struct mint {
    ll x;  // typedef long long ll;
    mint(ll x = 0) : x((x % mod + mod) % mod) {}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    mint inv() const {
        return pow(mod - 2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};

int main() {
    string s;
    cin >> s;
    int n = s.size();

    vector<vector<mint>> dp(n + 1, vector<mint>(13));
    dp[0][0] = mint(1);
    for (ll i = 0; i < n; i++) {
        for (ll j = 0; j < 13; j++) {
            if (s[i] == '?') {
                for (ll k = 0; k <= 9; k++) {
                    dp[i + 1][(10 * j + k) % 13] += dp[i][j];
                }
            } else {
                ll num = s[i] - '0';
                dp[i + 1][(10 * j + num) % 13] += dp[i][j];
            }
        }
    }
    cout << dp[n][5].x << endl;
}

Measured memory_bytes: 16676
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n) ; ++i)
#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define emb emplace_back
#define fcout cout << fixed << setprecision(15)

using namespace std;
using ll = long long;
using P = pair<int,int>;

template<typename T> void pv(vector<T> vec) {
  cout << "[";
  for(auto& v : vec) { cout << v << ","; }
  cout << "]" << endl;
}

template<>
void pv(vector<P> vec) {
  cout << "[";
  for(auto& v : vec) {
    cout << "<" << v.fi << ","<< v.se << ">" << ",";
  }
  cout << "]" << endl;
}

int INF = 1001001001;

int main() {
  int d,g;
  cin >> d >> g;
  vector<int> p(d,0);
  vector<int> c(d,0);

  rep(i,d) cin >> p.at(i) >> c.at(i);

  int ans = INF;
  rep(i,1 << d) {
    int numg = 0;
    int numa = 0;
    for(int j = d - 1;j >= 0;j--) if(i>>j&1) {
      numg += c.at(j);
      numg += p.at(j) * (j+1) * 100;
      numa += p.at(j);
    }
    if(numg >= g) {
      ans = min(ans,numa);
    } else {
      for(int j = d - 1;j >= 0;j--) if((i>>j&1) == 0) {
        rep(k,p.at(j) - 1) {
          numg += ((j+1) * 100);
          numa += 1;
          if(numg >= g) {
            ans = min(ans,numa);
            break;
          }
        }
        if(numg >= g) {
          ans = min(ans,numa);
          break;
        }
      }
    }
  }

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


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(int argc, const char * argv[]) {
    
    int S,W;
    
    cin>>S>>W;
    
    if(W>=S){
        cout<<"unsafe"<<endl;
    }else if(W<S){
        cout<<"safe"<<endl;
    }
    
    
    
    return 0;
}


Measured memory_bytes: 3636
#include <math.h>

#include <algorithm>
#include <array>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <sstream>
#include <vector>

using namespace std;
using Graph = vector<vector<int>>;

using ll = long long;
typedef pair<ll, ll> P_ll;
typedef pair<int, int> P;

const ll mod = 1000000007;

ll powmod(ll x, ll y) {
  ll res = 1;
  for (ll i = 0; i < y; i++) {
    res = res * x % mod;
  }
  return res;
}

int main() {
  int n;
  cin >> n;
  ll ans = powmod(10, n) - powmod(9, n) - powmod(9, n) + powmod(8, n);
  ans = ans % mod;
  ans = (ans + mod) % mod;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3580
#include <iostream>
#include <vector>
#include <queue>
#include <string.h>
#include <math.h>
using namespace std;
typedef long long ll;

int main(void){
    int h, w, a, b;
    cin >> h >> w;
    cin >> a >> b;
    
    int r = h % a, s = w % b;
    
    cout << h * w - (h - r) * (w - s) << endl;
}



Measured memory_bytes: 3104
#include <algorithm>
#include <iostream>

using namespace std;
using ll = long long;
using ld = long double;

#define ALL(x) begin(x), end(x)
#define REP(i, n) for (size_t i = 0, i##_len = (n); i < i##_len; ++i)

void solve(ll A, ll B, ll K) {
  ll a = max(0ll, A - K);
  ll b = a ? B : max(0ll, B + A - K);

  cout << a << " " << b << endl;
}

int main() {
  ll A;
  cin >> A;
  ll B;
  cin >> B;
  ll K;
  cin >> K;
  solve(A, B, K);
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define debug(x) cerr << #x << " " << x << '\n'
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
const int INF = 0x3f3f3f3f, N = 2e5 + 5;
const ll LINF = 1e18 + 5;
constexpr int mod = 998244353;
int n, d[N];
ll powmod(ll a,ll b)
{
	ll ans = 1;
	while(b)
	{
		if(b&1) ans = ans*a%mod;
		a = a*a%mod;
		b >>= 1;
	}
	return ans;
}
int main()
{
 	ios::sync_with_stdio(false);
 	cin.tie(0);
 	cin >> n;
 	for(int i=1;i<=n;i++) cin >> d[i];
 	if(d[1]) return cout << 0, 0;
 	sort(d+1,d+n+1);
 	if(n>1&&!d[1]&&!d[2]) return cout << 0, 0;
 	ll ans = 1;
 	int pre = 1;
 	for(int i=2;i<=n;)
 	{
 		int j = i + 1, cur = 1;
 		while(j<=n&&d[j]==d[i]) cur++, j++;
 		if(d[i]!=d[i-1]+1) return cout << 0, 0;
 		ans = (ans * powmod(pre,cur))%mod;
 		pre = cur;
 		i = j;
 	}
 	cout << ans;
	return 0;
}


Measured memory_bytes: 640
N,M=map(int,input().split())
G=[list() for _ in range(N)]
for _ in range(M):
    a,b=map(int,input().split())
    a-=1
    b-=1
    G[a].append(b)
    G[b].append(a)
G[0].sort()
G[N-1].sort()
i=0
j=0
while i<len(G[0]) and j<len(G[N-1]):
    if G[0][i]==G[N-1][j]:
        print("POSSIBLE")
        break
    elif G[0][i]<G[N-1][j]:
        i+=1
    else:
        j+=1
else:
    print("IMPOSSIBLE")


Measured memory_bytes: 41716
#include <iostream>
#include <cmath>
#include <iomanip>

int main(){
  int A,B,H,M;
  std::cin >> A >> B >> H >> M;

  const double pi = 3.1415926535897932384626433832795;

  double hour_x = A * std::sin(2.0*pi*(60.0*H+M)/720.0);
  double hour_y = A * std::cos(2.0*pi*(60.0*H+M)/720.0);
  double min_x  = B * std::sin(2.0*pi*M/60);
  double min_y  = B * std::cos(2.0*pi*M/60);

  std::cout << std::setprecision(15) << std::sqrt((hour_x - min_x)*(hour_x - min_x) + (hour_y - min_y)*(hour_y - min_y)) << std::endl;
  return 0;
}


Measured memory_bytes: 4160
#include <iostream>
#include <string>
using namespace std;
int main(){
    int blue=0,red=0;
    string a;
    cin>>a;
    for(int i=0;i<a.size();i++){
        if(a[i]-'0'==1)blue++;
        else red++;
    }
    cout<<min(blue,red)*2<<endl;
    return 0;
}


Measured memory_bytes: 512
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    T = LI()
    M = I()
    PX = [LI() for _ in range(M)]

    sum_T = sum(T)
    for px in PX:
        P, X = px
        print(sum_T - T[P - 1] + X)

if __name__ == '__main__':
    resolve()


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

int main() {
  int N;
  cin >> N;
  
  vector<int> vec(100);
    
  for (int i = 0;i < N;i++) {
    cin >> vec.at(i);
  }

  sort(vec.begin(), vec.end()); // {1, 2, 2, 5}
  reverse(vec.begin(), vec.end()); // {5, 2, 2, 1}

  int sum = 0;
  
  for (int i = 0; i < vec.size(); i++) {

    if (i % 2 == 0) {
      sum += vec.at(i);
    }
    else {
      sum -= vec.at(i);
    }

  }
  cout << sum << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(a); (i)<(b); (i)++)
#define rFor(i, a, b) for(int (i)=(a)-1; (i)>=(b); (i)--)
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
using namespace std;
typedef long long lint;

lint dsum(lint b, lint n){
    lint ret = 0;
    while(n){
        ret += n % b;
        n /= b;
    }
    return ret;
}

int main(){
    lint n, s; cin >> n >> s;
    lint b = 1e15;
    for(lint i=2; i*i<=n; i++)if(dsum(i, n) == s) b = min(b, i);
    for(lint i=1; i*i<n; i++){
        lint t = (n-s)/i + 1;
        if((n-s)%i == 0 && t >= 2 && dsum(t, n) == s) b = min(b, t);
    }
    if(n == s) b = min(b, s+1);
    cout << (b == 1e15 ? -1 : b) << endl;
}

Measured memory_bytes: 256
mod = 2019
s = input()
n = len(s)
w = 0
d = [0] * mod
p = 1
for i in reversed(range(n)):
	w += int(s[i]) * p
	p *= 10
	p %= mod
	w %= mod
	d[w] += 1
d[0] += 1
o = 0
for x in d:
	o += x * (x - 1) // 2
print(o)


Measured memory_bytes: 9252
#include <iostream>


#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <string>
#include <vector>
#include <list>
using namespace std;
#include <stdio.h>
#include <vector> 
#include <map> 
#include <algorithm>
#include <functional>
#include <algorithm>
#include <functional>
#include <array>
#include <iostream>

#include<iostream>
using namespace std;


int main()
{
	std::vector<int> a;
	int N, K;
	std::string S;
	cin >> N;

	a.resize(N);

	int c = 0;
	for (int i = 0; i < N; ++i) {
		int h;
		cin >> h;

		a[h-1] = i+1;
		
	}

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

	return 0;
}



Measured memory_bytes: 1152
#define LOCAL

#include<bits/stdc++.h>

using namespace std;

#define IOS ios::sync_with_stdio(false);cin.tie(0)
#define all(x) x.begin(), x.end()
#define ff first
#define ss second
#define LLINF 0x3f3f3f3f3f3f3f3f
#define INF 0x3f3f3f3f

using llong = long long;
using PII = pair<int, int>;

const llong MOD = 123456789LL;
const double PI = acos(-1);

int main() {
	IOS;
	string s; cin >> s;
	if (s == "AAA" || s == "BBB") cout << "No";
	else cout << "Yes";
}

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

using namespace std;
typedef long long lint;

#define RPT(i, b, e) for (int i = (b); i <= (e); i++)
#define RPT0(i, n) RPT(i, 0, n - 1)
#define RPT1(i, n) RPT(i, 1, n)
#define EACH(it, v) for (const auto& it : v)
#define ALL(v) v.begin(), v.end()

int N;

// dp[x][y][z] :
// 残り1個の皿がx、2個の皿がy、3個の皿がz枚のとき、全部食べるまでの期待値
double dp[301][301][301];

double f(int i, int j, int k)
{
    if (i < 0 || j < 0 || k < 0) return 0;
    if (i == 0 && j == 0 && k == 0) dp[i][j][k] = 0;
    if (dp[i][j][k] == -1)
        dp[i][j][k] = (N + i * f(i - 1, j, k) + j * f(i + 1, j - 1, k) +
                       k * f(i, j + 1, k - 1)) /
                      (i + j + k);
    return dp[i][j][k];
}

void resolve()
{
    cin >> N;
    int count[3] = {0};
    RPT0(i, N)
    {
        int tmp;
        cin >> tmp;
        count[tmp - 1]++;
    }

    RPT(i, 0, N) RPT(j, 0, N) RPT(k, 0, N) dp[i][j][k] = -1;
    double ans = f(count[0], count[1], count[2]);
    printf("%.10f\n", ans);
}

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


Measured memory_bytes: 213376
def main():
    from builtins import int, map, list, print, min
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    N = input_number()
    ls = []
    for i in range(5):
        ls.append(input_number())
    mini = min(ls)
    cnt = -(-N//mini)+4
    print(cnt)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
import Control.Applicative ((<$>))
import Control.Monad (replicateM, unless)
import Data.List (unfoldr, foldl')

main :: IO ()
main = do
  [n, k] <- f
  unless (n == 0 && k == 0) $ do
    solve k <$> replicateM n (read <$> getLine) >>= print
    main
  where
    f = map read <$> words <$> getLine
    
solve :: Int -> [Int] -> Int
solve k xs = ck - cdk
  where
    ls = split3 k xs
    cdk = maximum $ map (\(_,ys,_) -> product ys) ls
    ck = foldl' f 0 ls
    f pt (ls, ms, rs) = let mn = minimum ms
                            mx = maximum (ls ++ rs)
                            pm = product ms
                        in maximum [pt, pm, pm `div` mn * mx]
    
split3 :: Int -> [Int] -> [([Int],[Int],[Int])]
split3 k xs = unfoldr f (Just ([],take k xs, drop k xs))
  where f Nothing = Nothing
        f (Just (ls, ms, [])) = Just ((ls, ms, []), Nothing)
        f (Just (ls, (m:ms), (r:rs))) = Just ((ls, (m:ms), (r:rs)), Just (m:ls, ms ++ [r], rs))



Measured memory_bytes: 5500
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

	private int prim(int n, int[][] map) {
		int[] p = new int[n];
		int[] d = new int[n];
		boolean[] c = new boolean[n];
		Arrays.fill(p, -1);
		Arrays.fill(d, Integer.MAX_VALUE);
		d[0] = 0;
		while (true) {
			int min = Integer.MAX_VALUE;
			int u = -1;
			for (int i = 0; i < n; i++) {
				if (d[i] < min && !c[i]) {
					min = d[i];
					u = i;
				}
			}
			if (u == -1) break;
			c[u] = true;
			for (int i = 0; i < n; i++) {
				if (!c[i] && map[u][i] != Integer.MAX_VALUE && map[u][i] < d[i]) {
					d[i] = map[u][i];
					p[i] = u;
				}
			}
		}
		int sum = 0;
		for (int i = 0; i < n; i++) {
			if (p[i] != -1) sum += map[i][p[i]];
		}
		return sum;
	}
	
	private void run() throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(reader.readLine());
		int[][] map = new int[n][n];
		for (int i = 0; i < n; i++) {
			StringTokenizer st = new StringTokenizer(reader.readLine());
			for (int j = 0; j < n; j++) {
				int v = Integer.parseInt(st.nextToken());
				map[i][j] = v == -1?Integer.MAX_VALUE:v;
			}
		}
		reader.close();
		System.out.println(prim(n, map));
	}

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



Measured memory_bytes: 26940
#include<iostream>
#include<iomanip>
#include<string>
#include<cstdlib>
#include<cmath>
#include<algorithm>

using namespace std;

int main() {
	while(1) {
		int n, m;
		cin >> n >> m;
		if(n == 0 && m == 0) break;
		double data[n][n];
		for(int i=0; i<n; i++) {
			for(int j=0; j<n; j++) {
				cin >> data[i][j];
			}
		}

		double dp[n][m];
		for(int i=0; i<n; i++)
			dp[i][0] = 1.0;

		for(int i=1; i<m; i++) {
			for(int j=0; j<n; j++) {
				double max = 0;
				for(int k=0; k<n; k++) {
					double value = dp[k][i-1] * data[k][j];
					if(value > max) max = value;
				}
				dp[j][i] = max;
			}
		}

		double ans = 0;
		for(int i=0; i<n; i++) {
			if(ans < dp[i][m-1]) ans = dp[i][m-1];
		}
		cout << fixed << setprecision(2) << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 1376
using System;
using System.Linq;

class Program
{
    static void Main()
    {
        var n = int.Parse(Console.ReadLine());
        var vals = new int[n];
        for (int i = 0; i < n; i++)
        {
            vals[i] = int.Parse(Console.ReadLine());
        }

        var sum = vals.Sum() - vals.Max() + vals.Max() / 2.0;
        Console.WriteLine((int)sum);
    }
}

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

int main() {
  ll N, M, X;
  ll C[100001];
  ll A[13][13];
  ll min_cost = 12000000;
  cin >> N >> M >> X;
  for (int i = 0; i < N; i++){
      cin >> C[i];
      for (int j = 0; j < M; j++){
          cin >> A[i][j];
      }
  }
  for (int s = 0; s < (1 << N); s++){
      vector<int> skill(M);
      bool ok = true;
      ll cost = 0;
      for (int i= 0; i < N; i++){
          if ((s >> i) & 1){
              rep(j, M) skill.at(j) += A[i][j];
              cost += C[i];
          }
      }
      // 判定
      rep(i, M) if(skill.at(i) < X) ok = false;
      if (ok) min_cost = min (min_cost, cost);
  }
  if (min_cost == 12000000) cout << -1 << endl;
  else cout << min_cost << endl;
}


Measured memory_bytes: 3652
#include <iostream>
#include <cstdint>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<ll>> vvll;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (ll i = (n)-1; i >= 0; --i)
#define mes(a) cout << (a) << endl
#define dmes(a, b) cout << (a) << " " << (b) << endl
#define re0 return 0
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define rSort(a) sort(a.rbegin(), a.rend())
#define Rev(a) reverse(a.begin(), a.end())
#define MATHPI acos(-1)
#define itn int
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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;
}
struct io
{
    io()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
};
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-19;


struct UnionFind { //UnionFind
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};



signed main() {
    ll n, m;
    cin >> n >> m;
    UnionFind tree(n);
    
    ll a, b;
    rep(i, m) {
        cin >> a >> b; a--; b--;
        tree.unite(a, b);
    }
    
    map <ll, ll> mp;
    
    rep(i, n) {
        mp[tree.root(i)] ++;
    }
    
    ll r = 0;
    
    for(auto i: mp) {
        r = max(r, (ll)i.second);
    }
    
    mes(r);
    
    
}

Measured memory_bytes: 16392
/*input
8 9
7 9 3 2 3 8 4 6
*/
#include<bits/stdc++.h>
#define ll long long int
#define nl "\n"
using namespace std;


int main()
{
  ll n,k;
  cin>>n>>k;
  vector<ll>v(n);
  for(int i=0; i<n; i++)
  {
  	cin>>v[i];
  }
  sort(v.begin(), v.end());
  if(n<=k)
  {
  	cout<<0;
  	return 0;
  }
  ll sum=0;
  for(int i=0; i<n-k; i++)
  {
    sum+=v[i];
  }
  cout<<sum;
return 0;
}
	

Measured memory_bytes: 1792
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define maxn 511
#define LL long long
#define maxm 10011
using namespace std;
typedef long long ll;
const LL inf=1e15;ll n;
ll work(ll x,ll i){
	if(i==n) return x;
	else {
		i++;
		return work(x*2+2,i);
	}
}
int main(){
	ll ans;
	cin>>n;
	ans=work(2,0);
	cout<<ans;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
//CLOCKS_PER_SEC
#define se second
#define fi first
#define ll long long
#define Pii pair<int,int>
#define Pli pair<ll,int>
#define ull unsigned long long
#define pb push_back
#define fio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
const double Pi=3.14159265;
const int N=4e5+10;
const ull base=163;
const int INF=0x3f3f3f3f;
const ll mod=1e9+7;
using namespace std;
char s[200][200];
bool vis[200][200];
int main(){
    int n,m;cin>>n>>m;
    for(int i=1;i<=n;++i)scanf("%s",s[i]+1);
    for(int i=1;i<=n;++i){
        int tot=0;
        for(int j=1;j<=m;++j){
            if(s[i][j]=='.')tot++;
        }
        if(tot==m)for(int j=1;j<=m;++j)vis[i][j]=1;
    }
    for(int i=1;i<=m;++i){
        int tot=0;
        for(int j=1;j<=n;++j){
            if(s[j][i]=='.')tot++;
        }
        if(tot==n)for(int j=1;j<=n;++j)vis[j][i]=1;
    }
    for(int i=1;i<=n;++i){
            int p=0;
        for(int j=1;j<=m;++j){
            if(!vis[i][j])cout<<s[i][j],p=1;
        }
    if(p)
        cout<<endl;
    }
    return 0;
}



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

int N;
int A[20];
int x[20][20];
int y[20][20];

int counter(int x) {
    if(x == 0) return 0;
    return counter(x >> 1) + (x & 1);
}

void solve() {
    cin >> N;
    for(int i = 1; i <= N; i++) {
        cin >> A[i];
        for(int j = 1; j <= A[i]; j++) {
            cin >> x[i][j] >> y[i][j];
        }
    }
    int ans = 0;
    for(int bits = 1; bits < (1 << N); bits++) {
        bool ok = true;
        for(int i = 1; i <= N; i++) {
            if(!(bits & (1 << (i-1)))) continue;
            for(int j = 1; j <= A[i]; j++) {
                 if(((bits >> (x[i][j]-1)) & 1) ^ y[i][j]) 
				{
					ok = false;break;
				}
            }
            if(ok)continue;
            else break;
        }
        if(ok) ans = max(ans, counter(bits));
    }
    cout << ans << endl;
    return;
}

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
constexpr int64_t mod=1e9+7;

int main()
{
  int64_t 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];
  }
  int64_t sum_a=accumulate(a.begin(), a.end(),0LL);
  int64_t sum_b=accumulate(b.begin(), b.end(),0LL);
  if(sum_b>sum_a){
    cout<<-1;
    return 0;
  }
  int64_t s=0;
  int64_t cnt=0;
  std::vector<int64_t> vec;
  for (int i = 0; i < n; ++i)
  {
    if(a[i]<b[i]){
      cnt++;
      s+=b[i]-a[i];
    }
    else{
      vec.emplace_back(a[i]-b[i]);
    }
  }
  if(cnt==0){
    cout<<0;
    return 0;
  }
  sort(vec.begin(), vec.end(),greater<int64_t>());
  int64_t tmp=0;
  for(auto&& e: vec) {
    tmp+=e;
    cnt++;
    if(tmp>=s) break;
  }
  cout<<cnt;
}

Measured memory_bytes: 2936
#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
using ll = long long;
using ii = pair<int, int>;
constexpr int MN = 100001;

ll A[MN], B[MN], C[MN], P[MN], pre[MN], erp[MN];

int main() {
    if (fopen("in", "r")) freopen("in", "r", stdin), freopen("out", "w", stdout);
    ios_base::sync_with_stdio(0), cin.tie(0);

	int X, Y, Z; cin >> X >> Y >> Z;
    ll sum = 0;
	for (int i = 0; i < X+Y+Z; ++i) {
        cin >> A[i] >> B[i] >> C[i];
        sum += A[i], B[i] -= A[i], C[i] -= A[i], P[i] = i;
    }
    sort(P, P+X+Y+Z, [](int i, int j) { return B[i] > B[j]; });
    priority_queue<ll> pq;
    for (int i = 0; i < Y+Z; ++i) {
        pre[i+1] = pre[i]+B[P[i]], pq.push(C[P[i]]-B[P[i]]);
        if (pq.size() > Y) pre[i+1] += pq.top(), pq.pop();
    }
    while (pq.size()) pq.pop();
    for (int i = X+Y+Z; i > Y; --i) {
        erp[i-1] = erp[i], pq.push(C[P[i-1]]);
        if (pq.size() > X) erp[i-1] += pq.top(), pq.pop();
    }
    ll ans = -1e18;
    for (int i = Y; i <= Y+Z; ++i) ans = max(pre[i]+erp[i], ans);
    cout << sum+ans;
}


Measured memory_bytes: 8228
n,L=(int(i) for i in input().split())

mylist=[i+1 for i in range(n)]

maxval=0
for i in range(n):
  maxval+=L+mylist[i]-1
  
#print(maxval)

ans=float('inf')
for i in range(n):
  mylist=[i+1 for i in range(n)]
  tmp=0
  del mylist[i]
  for i in range(n-1):
    tmp+=L+mylist[i]-1
  tmp2=abs(maxval-tmp)
  if tmp2<ans:
    ans=tmp2
    ans2=tmp
    
print(ans2)

Measured memory_bytes: 39024
//order_of_key(k): Number of items strictly smaller than k .
//find_by_order(k): K-th element in a set (counting from zero).
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define full(x,n) x,x+n+1
#define full(x) x.begin(),x.end()
#define finish return 0

#define putb push_back
#define f first
#define s second

//logx(a^n)=loga(a^n)/logx(a)
//logx(a*b)=logx(a)+logx(b)
//logx(y)=log(y)/log(x)

#define ordered_set tree<ll,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>
#define putf push_front
#define gainb pop_back

#define gainf pop_front
#define len(x) (ll)x.size()

// 1/b%mod=b^(m-2)%mod
// (a>>x)&1==0

typedef double db;
typedef long long ll;

const ll ary=5e3+5;
const ll mod=1e9+7;
const ll inf=1e18;

using namespace std;
using namespace __gnu_pbds;
ll n,h[ary],bp[ary],p=31;
string s;
ll ch(ll k){
	for(int i=0;i<len(s);i++){
		if(i+k-1>=len(s)){
			break;
		}
		for(int j=i+k;j<len(s);j++){
			if(j+k-1>=len(s)){
				break;
			}
			ll a=(h[i+k-1]-(h[i-1]*bp[k]%mod)+mod)%mod;
			ll b=(h[j+k-1]-(h[j-1]*bp[k]%mod)+mod)%mod;
			if(a==b){
				return 1;
			}
		}
	}
	return 0;
}
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	bp[0]=1;
	for(int i=1;i<=ary-5;i++){
		bp[i]=bp[i-1]*p;
		bp[i]%=mod;
	}
	cin>>n>>s;
	for(int i=0;i<len(s);i++){
		h[i]=s[i];
		if(i){
			h[i]+=(h[i-1]*p);
		}
		h[i]%=mod;
	}
	ll l=1,r=n,ans=0;
	while(l<=r){
		ll m=(l+r)/2;
		if(ch(m)){
			l=m+1;
			ans=m;
		}
		else{
			r=m-1;
		}
	}
	cout<<ans;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main() {
    int N, ans = 0, it;
    cin >> N;
    vector<int> A(N), B(N, -1);
    for (auto& a:A) cin >> a;
    for (int i = 0; i<N; i++) {
        it = lower_bound(B.begin(), B.end(), A[i])-B.begin();
        B[it-1] = A[i];
    }
    for (auto b:B) if (b != -1) ans++;
    printf("%d\n", ans);
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define ll long long 
using namespace std;

int main()
{
    
    string s,t;
    
    cin>>s>>t;
    
    ll st=s.size();
    ll tt=t.size();
    int flag=0;
    for(ll i=0;i<st;i++)
   {
       if(s[i]!=t[i])
       {
           flag=1;
           break;
       }
   } 
   
   if (tt==st+1 && flag==0)
     cout<<"Yes";
     
    else
     cout<<"No";
   
   
     
    return 0;
}

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

int main(void) {
int n;
cin >> n;
vector<int> x(n);
for(int i = 0; i < n; ++i) cin >> x[i];
sort(x.begin(), x.end());
cout << x[n-1] - x[0] << endl;
return 0;
}

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

void printString(long long int n) 
{ 
	char str[1000001]; 
	long long int i = 0; 

	while (n > 0) { 
	long long 	int rem = n % 26; 

		if (rem == 0) { 
			str[i++] = 'z'; 
			n = (n / 26) - 1; 
		} 
		else 
		{ 
			str[i++] = (rem - 1) + 'a'; 
			n = n / 26; 
		} 
	} 
	str[i] = '\0'; 

	reverse(str, str + strlen(str)); 
	cout << str << endl; 

	return; 
} 

int main() 
{ 
    long long int n;
    cin>>n;
    
	printString(n); 
	
	return 0; 
} 


Measured memory_bytes: 3640
//g++ -std=c++14 test.cpp -o test.out
//問題URL
//https://atcoder.jp/contests/abc112/tasks/abc112_d

//参考：
//https://drken1215.hatenablog.com/entry/2018/11/06/120600

//ポイント：
//a1,a2,…,aN の最大公約数は必ず M の約数になる

//考え方
//(1)まず a1,a2,…,aN の最大公約数が必ず M の約数になることがわかる。
//(2)さらにd=GCD(a1,a2,…aN) とすると、ai≥d なので Nd ≤ M である
//よって
//答えは「M の約数 d のうち、Nd≤M を満たす最大のもの」

//(1)の説明
//dを a1,a2,…,aN の最大公約数とする
//この時 a1+a2+⋯+aN もdの倍数
//M = a1+a2+⋯+aN よりdはMの約数でもある

#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <map> 
#include <utility>
#include <limits.h>
#include <bitset>
#include <set>
using namespace std;
 
#define LL long long int
const LL INF = (1LL<<60);
const int INF_INT = 2147483647-1e6-1;
const LL mod = 1000000007ll;
const int mod_int = 1000000007;

vector<LL> divisor(LL x){
	vector<LL> ret;
	for(int i=1;i*i<x;i++){
		if(x%i==0){
			ret.push_back(i);
			ret.push_back(x/i);
		}
	}
	sort(ret.begin(),ret.end());
	return ret;
}

LL N,M;

LL ans = 1;

void solve(){
	vector<LL> div = divisor(M);
	for(int i=0;i<div.size();i++){
		if(div[i]*N<=M) ans = div[i];
	}
}
 
int main(){
    cin >> N >> M;
 
    solve();

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

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define N 13
#define pi M_PI

int main(){
    int n;
    scanf("%d",&n);
    int count;
    for(int i=0;i<n;i++){
        int p;
        int check = 1;
        scanf("%d",&p);
        for(int j=2;j*j<=p;j++){
            if(p%j==0){
                check=0;
                break;
            }
        }
        if(check==1){
            count++;
        }
    }
    printf("%d\n",count);
   return 0;
}


Measured memory_bytes: 2040
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)n;i++)
int main(void){
    // Your code here!
    int n;cin>>n;
    vector<pair<string, int>> pr(n);
    rep(i,n){
        string s;
        int x;cin>>s>>x;
        pr[i]=make_pair(s,x);
    }
    string X;cin>>X;
    int res=0;
    bool jud=false;
    rep(i,n){
        if(pr[i].first==X){
            jud=true;
        }else{
            if(jud==true)res+=pr[i].second;
            else continue;
        }
    }
    cout<<res<<endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int r=sc.nextInt();
		int g=sc.nextInt();
		int b=sc.nextInt();
		if((2*g+b)%4==0) {
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}
	}
}


Measured memory_bytes: 21588
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int INF=1e9;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};

int main(){
  string s;
  cin>>s;
  int cnt0=0;
  int cnt1=0;
  rep(i,len(s)){
    if(s[i]=='0') cnt0++;
    if(s[i]=='1') cnt1++;
  }
  cout<<len(s)-abs(cnt0-cnt1)<<endl;
}

Measured memory_bytes: 3712
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <iostream>
#include <climits>

using namespace std;

int main()
{
	int n;
	int a[5000];
	while (true)
	{
		scanf("%d", &n);
		if (n == 0)
			break;

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

		int res = -100000;
		int sum = 0;
		for (int i = 0; i < n; ++i)
		{
			if (sum < 0)
				sum = 0;
			sum += a[i];
			if (sum > res)
				res = sum;
		}
		printf("%d\n", res);
	}

	return 0;
}

Measured memory_bytes: 0
/*input
4 3
0 12 71
81 0 53
14 92 0
1 1 2 1
2 1 1 2
2 2 1 3
1 1 2 2
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#ifdef leowang
#define debug(...) do{\
	fprintf(stderr,"%s - %d : (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
	_DO(__VA_ARGS__);\
}while(0)
template<typename I> void _DO(I&&x){cerr<<x<<endl;}
template<typename I,typename...T> void _DO(I&&x,T&&...tail){cerr<<x<<", ";_DO(tail...);}
#else
#define debug(...)
#endif
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}
//}}}
const ll maxn=300005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const double PI=acos(-1);
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		
		b>>=1;
	}
	return res;
}

int v[35][35];
int a[505][505];
int sum[3][35];


int main()
{
	int n,c;
	cin>>n>>c;
	REP(i,c) REP(j,c) cin>>v[i][j];	
	REP(i,n) REP(j,n) cin>>a[i][j];
	REP(i,n) REP(j,n) a[i][j]--;

	REP(i,n) REP(j,n){
		REP(k,c) sum[(i+j)%3][k]+=v[a[i][j]][k];
	}
	//REP(i,3) REP(j,c) cout<<sum[i][j]<<" \n"[j==c-1];
	int ans=INF;
	REP(i,c) REP(j,c) if(i!=j) REP(k,c) if(i!=k&&k!=j){
		ans=min(ans,sum[0][i]+sum[1][j]+sum[2][k]);
	}
	cout<<ans<<'\n';

	return 0;
}


Measured memory_bytes: 1280
let split_int str =
  let rec split_inner ct b=
    if String.length str = ct then [int_of_string b]
    else
      match str.[ct] with
        ' ' -> (int_of_string b)::split_inner (ct+1) ""
      | c -> split_inner (ct+1) (b^(Char.escaped c))
  in split_inner 0 "";;

let () =
  let _n = read_line ()
  and s = read_line () in
  let l = split_int s in
  let (min, max, sum) =
    List.fold_left (fun (x1,x2,x3) y-> ((min x1 y),(max x2 y),(x3+y))) (1000000,-1000000,0) l in
  Printf.printf "%d %d %d\n" min max sum;;

Measured memory_bytes: 5624
#include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <cstring>
#include <iostream>
#include <math.h>
using namespace std;
int main ()
{
	int a,b,c,k;
	scanf("%i%i%i%i",&a,&b,&c,&k);
	if(a>=b && a>=c)
	{
		for(int i=1;i<=k;i++)
		{
			a*=2;
		}
		printf("%i",a+b+c);
	}
	else if(b>=a && b>=c)
	{
		for(int i=1;i<=k;i++)
		{
			b*=2;
		}
		printf("%i",a+b+c);
	}
	else if(c>=b && c>=a)
	{
		for(int i=1;i<=k;i++)
		{
			c*=2;
		}
		printf("%i",a+b+c);
	}
	return 0;
}


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

using namespace std;

int main() {

	string s;
	cin >> s;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == '?') {
			cout << "D";
		}
		else {
			cout << s[i];
		}
	}

	cout << endl;
	return 0;

}

Measured memory_bytes: 3724
#include <bits/stdc++.h>
#define ll long long
using namespace std;
 
int main() {
    int n;
    cin >> n;
    ll ans = 0;
    for (int i = 1; i <= n; i++) {
        if (i % 3 != 0 && i % 5 != 0) {
            ans += i;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using lint = long long int;
using ulint = unsigned long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T, class U> void assign(V<T>& v, int n, const U& a) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


int scc(const VV<>& g, V<>& comp) {
  int n = g.size();
  VV<> rg(n);
  for (int v = 0; v < n; v++) {
    for (int w : g[v]) {
      rg[w].push_back(v);
    }
  }
  V<> vs;
  V<bool> vis(n);
  comp.resize(n);

  auto dfs = [&](const auto& dfs, int v) -> void {
    vis[v] = true;
    for (int w : g[v]) if (!vis[w]) {
      dfs(dfs, w);
    }
    vs.push_back(v);
  };

  auto rdfs = [&](const auto& rdfs, int v, int k) -> void {
    vis[v] = true;
    comp[v] = k;
    for (int w: rg[v]) if (!vis[w]) {
      rdfs(rdfs, w, k);
    }
  };

  for (int v = 0; v < n; v++) if (!vis[v]) {
    dfs(dfs, v);
  }
  vis.assign(n, false);
  int k = 0;
  reverse(vs.begin(), vs.end());
  for (int v : vs) if (!vis[v]) {
    rdfs(rdfs, v, k++);
  }
  return k;
}

int main() {
  cin.tie(nullptr); ios_base::sync_with_stdio(false);
  int n, m; cin >> n >> m;
  VV<> g(n);
  for (int i = 0; i < m; ++i) {
    int u, v; cin >> u >> v, --u, --v;
    g[u].push_back(v);
  }
  V<> comp;
  scc(g, comp);
  V<> vs(n);
  for (int v = 0; v < n; ++v) {
    vs[comp[v]] = v;
  }
  V<> dp(n);
  for (int i = 0; i < n; ++i) {
    for (int w : g[vs[i]]) {
      dp[comp[w]] = max(dp[comp[w]], dp[i] + 1);
    }
  }
  cout << *max_element(begin(dp), end(dp)) << '\n';
}

Measured memory_bytes: 13312
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cstdio>
using namespace std;
#define F first
#define S second
typedef long long ll;
typedef pair<ll,ll> P;
int main(void){
    int a,b,c;
    cin>>a>>b>>c;
    cout<<a+b+c<<endl;
}



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

using namespace std;

int main() {

	int h,w;
	cin >> h >> w;

	vector<string> bw(h, "");

	for (int i = 0; i < h; i++) {
			cin >> bw[i];
	}

	bool bwcheck = true;
	for (int i = 0; i < h; i++) {
		bwcheck = true;
		for (int j = 0; j < w; j++) {
			if (bw[i][j] == '#') {
				bwcheck = false;
				break;
			}
		}
		if (bwcheck == true) {
			for (int k = i; k < h-1; k++) {
				bw[k] = bw[k + 1];
			}
			i--;
			h--;
		}
	}

	for (int j = 0; j < w; j++) {
		bwcheck = true;
		for (int i = 0; i < h; i++) {
			if (bw[i][j] == '#') {
				bwcheck = false;
				break;
			}
		}
		if (bwcheck == true) {
			for (int i = 0; i < h; i++) {
				for (int k = j; k < w-1; k++) {
					bw[i][k] = bw[i][k + 1];
				}
				bw[i].pop_back();
			}
			j--;
			w--;
		}
	}

	for (int i = 0; i < h; i++) {
		cout << bw[i] << endl;
	}
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>

#define sc(a) scanf("%d",&a)

#define M 1e5

int data[100000+5]={0};

int main()
{
	int n;
	sc(n);
	int k;
	sc(k);
	int q;
	sc(q);
	int temp;
	for(int i =0;i<q;i++)
	{
		sc(temp);
		data[temp]++;
	}
	for(int i =1;i<=n;i++)
	{
		if(k-q+data[i]<=0)
		{
			printf("No\n");
		}
		else
		{
			printf("Yes\n");
		}
	}
	return 0;
}


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

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int h,w;
	cin>>h>>w;
	string s;
	for(int i=0;i<h;++i){
		cin>>s;
		cout<<s<<"\n"s<<s<<"\n"s;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;

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


  int a,b;cin>>a>>b;
  if(a==b){
    cout<<"Draw"<<endl;
  }else if (a==1){
    cout<<"Alice"<<endl;
  } else if (b==1){
    cout<<"Bob"<<endl;
  }else if (a<b){
    cout<<"Bob"<<endl;
  }else{
    cout<<"Alice"<<endl;
  }

  return 0;
}


Measured memory_bytes: 3568
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repf(i,a,b) for (int i = (a); i < (b); i++)
#define repi(i,a,b) for (int i = (a); i <= (b); i++)
#define repr(i,a,b) for (int i = (a); i >= (b); i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SORT(x) sort(all(x));
#define RSORT(x) sort(rall(x));
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vd = vector<double>;
using vb = vector<bool>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;
const ll inf = 1ll<<29;
const ll mod = 1000000007;
const double eps = 1e-9;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//cout << fixed << setprecision(10);

int main() {
  int N, M; cin >> N >> M;

  vector<tiii> data1(M);
  rep(i,M) {
    int P, Y; cin >> P >> Y;
    data1.at(i) = make_tuple(P,Y,i+1);
  }

  SORT(data1);

  vector<tiii> data2(M);
  int x = 1;
  rep(j,M) {
    int P, Y, i;
    tie(P,Y,i) = data1.at(j);
    data2.at(j) = make_tuple(i, P, x);

    bool flag = false;
    if(j!=M-1) {
      int P_next;
      tie(P_next,ignore,ignore) = data1.at(j+1);
      if(P < P_next) flag = true;
    }
    
    if (flag) {
      x = 1;
    }
    else {
      x++;
    }
  }

  SORT(data2);

  rep(i,M) {
    int P, x;
    tie(ignore,P,x) = data2.at(i);
    printf("%06d%06d\n",P,x);
  }
}

Measured memory_bytes: 3840
#include<bits/stdc++.h>
using namespace std;
char s[1050];
int main() {
	cin >> (s + 1);
	int i;
	int n = strlen(s + 1);
	for(i = 1; i <= n; ++i) {
			cout << s[i];
		}
	if(s[n] == 's' ) {
		
		cout << "es";
	}
	else cout << 's';
	return 0;
} 

Measured memory_bytes: 3592
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <time.h>
typedef long long int ll;
#define mod 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define m0(x) memset(x,0,sizeof(x))


//組み合わせ（nとrが少ないとき）
int combination_low(ll n,ll r){
	const ll N = 500;
	ll C[N][N];
	memset(C, 0, sizeof(C));
	C[0][0]=1;
	for(ll n=1; n<N; n++){
		C[n][0]=C[n-1][0];
		for(ll r=1; r<N; r++){
			C[n][r] = C[n-1][r-1] + C[n-1][r];
		}
	}
	return C[n][r];
}

//二分累乗法
int powa(ll a, ll n){
	ll res = 1;
	while(n>0) {
		if(n&1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1; 
	}
	return res;
}

//逆元
int inverse(ll a){
	ll n = mod-2;
	return powa(a, n);
}

/*組み合わせ（いちばんうまくいったやつ）*/
int combination(ll n,ll r){
	ll x=1,y=1;
	for(int i=1;i<=r;i++){
		x = x * (n-i+1) % mod;
		y = y * i % mod;
	}
	return x * inverse(y) % mod;
}

int main(void){
	int n;
	scanf("%d",&n);
	ll a[n];
	int count=0;
	rep(i,n){
		scanf("%d",&a[i]);
		while((a[i]%2)==0){
			a[i]/=2;
			count++;
		}
	}
	printf("%d\n",count);
	return 0;

}

Measured memory_bytes: 256
parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
	n = readline() |> parseInt
	a = zeros(Int,n,n-1)
	for i in 1:n
		a[i,:] = readline() |> split |> parseMap
	end
	now = ones(Int,n)
	fin = 0
	f = 0
	k = 0
	nxt = Int[i for i in 1:n]
	while fin<n
		chk = zeros(Int,n)
		tnx = Int[]
		sx = 0
		for i in nxt
			if now[i]<n&&chk[i]==0
				d = a[i,now[i]]
				if chk[d]==0&&a[d,now[d]]==i
					chk[i]=1
					chk[d]=1
					push!(tnx,i)
					push!(tnx,d)
					sx+=2
					now[i]+=1
					now[d]+=1
					if now[d]==n
						fin += 1
					end
				end
				if now[i]==n
					fin += 1
				end
			end
		end
		if sx == 0
			f = 1
			break
		else
			k += 1
			nxt = copy(tnx)
		end
	end
	println(f==1?-1:k)
end

main()

Measured memory_bytes: 160216
n,m = map(int, input().split())

if m%2==0:
    for i in range(m//2):
        print(i+1,m-i+1)
    for i in range(m//2):
        print(m+i+2,2*m-i+1)
else:
    for i in range(m//2+1):
        print(i+1,m-i+1)
    for i in range(m//2):
        print(m+i+2,2*m-i+1)

Measured memory_bytes: 70188
#include<iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main(){
  	int X;
  	cin >> X;

  	int ans = 1;
  	int k = 2;

  	while(k<=X){
  		int test = k*k; 
  		while(test <= X){
  			ans = max(ans, test);
  			test *= k;
  		}
  		k++;
  	}

  	cout << ans <<endl;




  return 0;
}

Measured memory_bytes: 256
//============================================================================
// Name        : cpptest.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

/*
 * template.cpp
 *
 *  Created on: 2016/10/30
 *      Author: jin
 */
#define MYDEBUG
#include <iostream>
#include <vector>
#include <chrono>
#include <random>
#include <algorithm>

#ifdef MYDEBUG
#define debug(x) cout<<#x<<": "<<x<<endl
#else
#define debug(x)
#endif
#define LL long long
#define ULL unsigned long long
#define eps 1e-14
using std::max;
using std::min;
using std::swap;
using std::cout;
using std::cin;
using std::scanf;
using std::printf;
using std::ostream;
using std::vector;
using std::endl;
using std::string;
using namespace std;

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
	out << "[";
	size_t last = v.size() - 1;
	for (size_t i = 0; i < v.size(); ++i) {
		out << v[i];
		if (i != last)
			out << ",";
	}
	out << "]";
	return out;
}

class AGC011 {
public:
	void A() {
		int N, C, K;
		cin >> N >> C >> K;
		vector<int> t(N);
		for (int i = 0; i < N; ++i) {
			cin >> t.at(i);
		}
		sort(t.begin(), t.end(), greater<int>());
		int i = 0;
		int ans = 0;
		while (i < t.size()) {
			int gotime = t.at(i);
			int count = 1;
			i++;
			while (i < t.size() && ((gotime - t.at(i)) <= K) && count < C) {
				count++;
				i++;
			}
			ans++;
		}
		cout << ans << endl;
	}

	void B() {
		int N;
		cin >> N;
		vector<int> t(N);
		for (int i = 0; i < N; ++i) {
			cin >> t.at(i);
		}
		sort(t.begin(), t.end());
		int ans = N;
		for (int i = 0; i + 1 < t.size(); i++) {
			int par = t.at(i);
			int child = t.at(i + 1);
			if (par > child) {
				int tmp = par;
				par = child;
				child = tmp;
			}
			if (par < (child + 1) / 2) {
				ans--;
			}
		}
		cout << ans << endl;
	}

	void B_review() {
		int N;
		cin >> N;
		vector<int> t(N);
		vector<ULL> sum(N);
		for (int i = 0; i < N; ++i) {
			cin >> t.at(i);
		}
		sort(t.begin(), t.end());
		sum.at(0) = t.at(0);
		for (int i = 1; i < N; ++i) {
			sum.at(i) = t.at(i) + sum.at(i - 1);
		}
		int pos = 0;
		for (int i = sum.size() - 1; i >= 1; --i) {
			int big = t.at(i);
			ULL small = sum.at(i - 1);
			if (small * 2 < big) {
				pos = i;
				break;
			}
		}
		cout << N - pos << endl;
	}
};

int main() {
	AGC011 p;
	p.B_review();
}


Measured memory_bytes: 1408
#include<iostream>
#include<cstdio>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<set>
#include<list>
#include<queue>
#include<deque>
#include<unordered_map>
#include<map>
#include<string>
#include<cstring>
#include<stack>
#include<cmath>

#define vint vector<int>
#define vstr vector<string>
#define vll vector<long long>
#define ll long long
#define pf printf
#define sf scanf
#define sfd(n) scanf("%d", &n)
#define sflf(n) scanf("%lf", &n)
#define sfll(n) scanf("%lld", &n)
#define pfd(n) printf("%d", n)
#define pflf(n) printf("%lf", n)
#define pfll(n) printf("%lld", n)
#define pft	printf("\t")
#define pfn printf("\n")
#define pfk printf(" ")
#define check printf("asd\n")
#define PI 3.1415926
#define MAX 100000
#define M 1e18

using namespace std;

int main() {
	int n, d, k, cnt = 0;
	cin >> n >> d >> k;
	int* a = new int[n];
	for( int i=0; i<n; i++ ) {
		sfd(a[i]);
		for( int j=0; ; j++ ) {
			if( d>=j*a[i]+1 ) {
				cnt++;
			}else {
				break;
			}
		}
	}
	pfd(cnt+k);

	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include<iostream>
#include<map>
#include<algorithm>
#include<vector>
#include <cmath>
#include <iomanip>
#include <regex>
#include <bits/stdc++.h>
#include <string>
using namespace std;

int main(){
    long N;
    cin>>N;
    cout<<(N+1)/2<<endl;


}



Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<cstdlib>
#include<iomanip>
#include<queue>
#include<set>
#include <valarray>
#include<stack>
#include<sstream>
#include<math.h>
 
using namespace std;
 
void Solution()
{
    int H, W;
     
    while(cin>>H>>W)
    {
        if (H == 0 || W == 0)
        {
            break;
        }
         
        for (int i = 0; i < H; i++)
        {
            for (int j = 0; j < W; j++)
            {
                if(i % 2 == 0)
                {
                    if(j % 2 == 0)
                    {
                        cout<<"#";
                    }
                 else
                    {
                        cout<<".";
                    }
                }
                else if(i % 2 != 0)
                {
                    if(j % 2 == 0)
                    {
                        cout<<".";
                    }
                 else
                    {
                        cout<<"#";
                    }
                }
            }
             
            cout<<endl;
        }
         
        cout<<endl;
    }
     
     
}
 
int main()
{
    Solution();
    return 0;
}

Measured memory_bytes: 1152