akhauriyash/Code-Regression huggingface dataset:
N = int(input())

# 入力が奇数のときははじく
if N % 2 == 1:
    print(0)
    exit(0)

exp = 1
zero_count = 0
#counters = []
while 2*(5 ** exp) <= N:
    count = N // (2* (5 ** exp))
    zero_count += count
    exp += 1

print(zero_count)


Measured memory_bytes: 2940
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = Integer.parseInt(scan.next());
		int preA = Integer.parseInt(scan.next());
		int postA = 0;
		long sum=0;
		for(int i=1;i<N;i++) {
			postA = Integer.parseInt(scan.next());
			if(preA > postA) {
				sum += preA - postA;
			} else {
				preA = postA;
			}
			
		}
		System.out.print(sum);
	}
	
}

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

namespace abc146_b
{
  class Program
  {
    static void Main(string[] args)
    {
      var n = CIn.ReadInt();
      var s = CIn.Read().Select(c => (char)(((c - 'A' + n) % 26) + 'A')).ToArray();
      Console.WriteLine(s);
    }
  }

  class CIn
  {
    private static readonly Queue<string> fieldBuffer = new Queue<string>();

    public static string Read()
    {
      if (fieldBuffer.Count == 0)
      {
        foreach (var field in Console.ReadLine().Split())
        {
          fieldBuffer.Enqueue(field);
        }
      }
      return fieldBuffer.Dequeue();
    }

    public static int ReadInt() => int.Parse(Read());
    public static long ReadLong() => long.Parse(Read());
    public static double ReadDouble() => double.Parse(Read());

    public static string[] ReadStringArray(long n)
    {
      var array = new string[n];
      for (var i = 0; i < n; i++)
      {
        array[i] = Read();
      }
      return array;
    }

    public static int[] ReadIntArray(long n)
    {
      var array = new int[n];
      for (var i = 0; i < n; i++)
      {
        array[i] = ReadInt();
      }
      return array;
    }

    public static long[] ReadLongArray(long n)
    {
      var array = new long[n];
      for (var i = 0; i < n; i++)
      {
        array[i] = ReadLong();
      }
      return array;
    }

    public static double[] ReadDoubleArray(long n)
    {
      var array = new double[n];
      for (var i = 0; i < n; i++)
      {
        array[i] = ReadDouble();
      }
      return array;
    }
  }
}

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

int main() {
  int N = 0, i,J = 0;
  cin >> N;
  string A;
  
  for ( i=0; i<N; i++) {
    cin >> A;
    if ( A == "Y" ) {
      cout << "Four" << endl;
      J = 1;
      break;
    }
  }
  if ( J != 1 ) {
    cout << "Three" << endl;
  // ここにプログラムを追記
  }
}



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

#define FAST ios_base::sync_with_stdio(false); cin.tie(0)
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
typedef long long int ll;

#define min(x,y)(x<y?x:y)
 
using namespace std;

#define MAX 1000

int main() {
	FAST;

	char s[4];

	int res=0;

	cin >> s;

	for (int i=0; i<4; i++) {
		if (s[i] == '+') res += 1;
		else res -= 1;
	}

	cout << res << "\n";

    return 0;
}

Measured memory_bytes: 256
import sys, io, os, re
import bisect
from pprint import pprint
from math import sin, cos, pi, radians, sqrt
from copy import copy, deepcopy
from collections import deque
from fractions import gcd

def array1(n): return [0] * n
def array2(n, m): return [[0] * m for x in range(n)]
def array3(n, m, l): return [[[0] * l for y in xrange(m)] for x in xrange(n)]



a, b = map(int, sys.stdin.readline().strip().split())

print(a*b)


Measured memory_bytes: 72800
#include<bits/stdc++.h>
using namespace std;
namespace FastIO
{
	static char c;
	static int top,buf[22];
	template<typename T>
	inline void read(T& x)
	{
		x=0,c=getchar();
		while(!isdigit(c))c=getchar();
		while(isdigit(c))x=x*10+c-'0',c=getchar();
	}
	template<typename T>
	inline void write(T x,int f=0)
	{
		top=0;
		do buf[top++]=x%10,x/=10;while(x);
		for(int i=top-1;~i;i--)putchar(buf[i]+48);
		if(f)putchar(f&1?' ':'\n');
	}
}
using FastIO::read;
using FastIO::write;
const int maxn=100005;
typedef long long LL;

int n,m,fa[maxn],siz[maxn],t[maxn];
LL e,p,q;
vector<int> g[maxn];
bool odd[maxn];

inline int find(int x){return x==fa[x]?x:fa[x]=find(fa[x]);}
inline bool dfs(int u,int d)
{
	t[u]=d;
	for(vector<int>::iterator it=g[u].begin();it!=g[u].end();++it)
		if(!t[*it]&&dfs(*it,d+1))return 1;
		else if((t[*it]+d+1)&1)return 1;
	return 0;
}

int main()
{
	read(n),read(m);
	for(int i=1;i<=n;i++)fa[i]=i;
	for(int i=1,u,v,f1,f2;i<=m;i++)
	{
		read(u),read(v);
		g[u].push_back(v),g[v].push_back(u);
		f1=find(u),f2=find(v);
		if(f1==f2)continue;
		fa[f1]=f2;
	}
	for(int i=1,f;i<=n;i++)
	{
		f=find(i),siz[f]++;
		if(f!=i)continue;
		if(dfs(i,1))odd[i]=1;
	}
	for(int i=1;i<=n;i++)
		if(siz[i]==1)e++;
		else if(siz[i]&&odd[i])p++;
		else if(siz[i]&&!odd[i])q++;
	write(2*e*n-e*e+(p+q)*(p+q)+q*q);
	return 0;
}

Measured memory_bytes: 8064
#include <cassert>
#include <iostream>
#include <vector>
#include <map>

using llong = long long;
llong MOD = 1.0e+9 + 7;

template <class T> inline void chadd(T &a, const T &b) {
  a += b;
  a %= MOD;
}

template <typename T> std::vector<T> vectors(std::size_t n, T val) {
  return std::vector<T>(n, val);
}

template <typename T, typename... Args>
auto vectors(std::size_t n, Args... args) {
  return std::vector<decltype(vectors<T>(args...))>(n, vectors<T>(args...));
}

bool check_AGC(int c3, int c2, int c1) {
  return (c3 == 0 and c2 == 2 and c1 == 3) ? true : false;
}

bool check_AGC_neighbor(int c2, int c1, int c0, int c) {
  return (check_AGC(c2, c1, c0) or check_AGC(c1, c2, c0) or
          check_AGC(c2, c0, c1) or check_AGC(c1, c0, c) or
          check_AGC(c0, c1, c) or check_AGC(c1, c, c0) or
          check_AGC(c2, c0, c) or check_AGC(c2, c1, c))
             ? true
             : false;
}

int main() {
  // Input
  int N;
  std::cin >> N;
  assert(3 <= N and N <= 100);

  // Initialization
  // {'A': 0, 'T': 1, 'G': 2, 'C': 3}
  auto dp = vectors<llong>(1 + N + 1, 4, 4, 4, 0LL);

  // Initial condition
  for (int c2 = 0; c2 < 4; ++c2) {
    for (int c1 = 0; c1 < 4; ++c1) {
      for (int c0 = 0; c0 < 4; ++c0) {
        if (check_AGC(c2, c1, c0) or check_AGC(c1, c2, c0) or
            check_AGC(c2, c0, c1))
          continue;
        dp[3][c2][c1][c0] = 1;
      }
    }
  }

  // DP main
  for (int i = 3; i <= N; ++i) {
    for (int c2 = 0; c2 < 4; ++c2) {
      for (int c1 = 0; c1 < 4; ++c1) {
        for (int c0 = 0; c0 < 4; ++c0) {
          for (int c = 0; c < 4; ++c) {
            if (check_AGC_neighbor(c2, c1, c0, c))
              continue;
            chadd(dp[i + 1][c1][c0][c], dp[i][c2][c1][c0]);
          }
        }
      }
    }
  }

  // Output
  llong res = 0LL;
  for (int c2 = 0; c2 < 4; ++c2) {
    for (int c1 = 0; c1 < 4; ++c1) {
      for (int c0 = 0; c0 < 4; ++c0) {
        res += dp[N][c2][c1][c0];
        res %= MOD;
      }
    }
  }
  std::cout << res << std::endl;

  return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <map>
using namespace std;
int main(void){
    int N;
    cin >> N;
    map<int, bool> is_written;
    int A;
    int count = 0;
    for( int i = 0; i < N; ++i ){
        cin >> A;
        if( is_written[A] == false ){
            is_written[A] = true;
            ++count;
        }else{
            is_written[A] = false;
            --count;
        }
    }
    cout << count << endl;
    return 0;
}


Measured memory_bytes: 4992
#include<stdio.h>
#include<math.h>
int main()
{
    int x,y;
    double a,b;
    scanf("%d %d",&x,&y);
    b=(y-2*x)/2.0;
    a=x-b;
    if(a>=0&&b>=0&&floor(a)==ceil(a)&&floor(b)==ceil(b))
        printf("Yes\n");
    else
        printf("No\n");
    return 0;
}

Measured memory_bytes: 2152
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = Integer.parseInt(in.next());
            int A = Integer.parseInt(in.next());
            int B = Integer.parseInt(in.next());

            int sum = 0;
            for (int i = 1; i <= N; i++) {
                int n = i;
                int digSum = 0;
                while (n > 0) {
                    digSum += n % 10;
                    n /= 10;
                }
                if (digSum >= A && digSum <= B)
                    sum += i;
            }
            out.println(sum);
        }

    }
}



Measured memory_bytes: 35844
#include <iostream>
#include<algorithm>
#include<string>
#include <cmath>
#include <vector>
#include <map>
#include <cstdio>
#include <iomanip>
#include <numeric>
#pragma region Macros
#define int long long
#define double long double
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979323846;
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define LAST(x) x[x.size()-1]
#define ALL(x) (x).begin(),(x).end()
#define swap(a,b) (a += b,b = a - b,a -= b)
#define CEIL(a,b) ((a+b-1)/b)
int FACT(int a) {
	if (a == 0)
		return 1;
	else
		return a * FACT(a - 1);
}
int nPr(int n, int r) {
	int s = n - r + 1;
	int sum = 1;
	for (int i = s; i <= n; i++)
		sum *= i;
	return sum;
}
//int nCr(int n, int r)
int nCr2(int n, int r) {
	return FACT(n) / (FACT(r) * FACT(n - r));
}
int GCD(int a, int b) // assuming a,b >= 1
{
	if (a < b)
		swap(a, b);
	if (b == 0)
		return a;
	if (a % b == 0)
		return b;
	return GCD(b, a % b);
}
int LCM(int a, int b) // assuming a,b >= 1
{
	return  a * b / GCD(a, b);
}
double LOG(int a, int b) {
	return log(b) / log(a);
}
inline bool BETWEEN(int x, int min, int max) {
	if (min <= x && x <= max)
		return true;
	else
		return false;
}
inline bool PRIMEOR (int x) {
	if (x ==1)
		return false;
	if (x == 2)
		return true;
	if (x%2==0)
		return false;
	double sqrtx = sqrt(x);
	for (int i = 3; i <= sqrtx; i += 2) {
		if (x % i == 0)
			return false;
	}
	return true;
}

using namespace std;
#pragma endregion
signed main() {
	int w;
	string S;
	cin >> S >> w;
	rep(i, S.size()) {
		if (i % w == 0)
			cout << S[i];
	}
	cout << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define pb push_back
using ll = long long;
using vin=vector<int>;
using vvin=vector<vin>;
using vll=vector<ll>;
using vvll=vector<vll>;
using vst=vector<string>;
using P = pair<ll,ll>;
const int inf=1e9+7;
const ll INF=9e18;
template <typename T> bool chmin(T &a, const T& b){if(a > b){a = b;return true;}return false;}
template <typename T> bool chmax(T &a, const T& b){if(a < b){a = b;return true;}return false;}
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; }
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };

int main(){cout<<fixed<<setprecision(20);
		   //gから貪欲
           int n,m;
           string s;
           cin>>n>>m>>s;
           reverse(all(s));
           vin ans(0);
           int now=0;
           while(now<n){
             int last=-1;
             rep(i,1,m+1){
               if(now+i<n+1&&s[now+i]=='0')last=now+i;
             }
             //cout<<now<<endl;
             ans.pb(last-now);
             now=last;
             if(last==-1){
              cout<<last<<endl;
               return 0;
             }
           }
           reverse(all(ans));
           int k=ans.size();
           rep(i,0,k)cout<<ans[i]<<" ";
}

Measured memory_bytes: 4044
#include<bits/stdc++.h>
using namespace std;
long long int a,b,c,ar[1000009],sum,cnt;
int main()
{
  cin>>a;
 long long int j=1;

  for(int i=1;i<=a;i++)
     cin>>ar[i];
    for(int i=1;i<=a;i++)
    {
      if(ar[i]!=j)
        cnt++;
      else
      {
       j++;
      }
    }

      if(cnt==a)
         cout<<"-1"<<endl;
       else
         cout<<cnt<<endl;

       return 0;
   }





Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  int K;
  cin >> N >> K;
  int ans = 1;
  for(int i = 0; i < N; i++){
    if(ans < K){
      ans *= 2;
    }else{
      ans += K;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3600
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define boost ios_base::sync_with_stdio(false);	cin.tie(0);	cout.tie(0)
#define vi vector<int>
#define P push_back
#define F first
#define S second
#define debug(x) cout<<x<<" "
#define pi vector<pair<int,int> >
#define FOR(i,x,n) for(int i=x;i<n;i++)
using namespace std;
int main(){
    boost;
    ll w,x,h,y;
    cin>>w>>h>>x>>y;
    long double area=(long double)(w*h)/2;
    cout<<area<<" ";
    if((long double)x==(long double)w/2&&(long double)y==(long double)h/2)cout<<"1";
    else cout<<"0";



    return 0;
}


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

bool has3(int x){
    while(x){
        if(x % 10 == 3)return true;
        x /= 10;
    }
    return false;
}

void call(int n){
    for (int x = 1;x <= n;x++){
        if(x % 3 == 0 || has3(x)){
            cout << " " << x;
        }
    }
    cout << endl;
}

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

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#define int long long
#define pb push_back
#define x first
#define y second
#define mk(a,b) make_pair(a,b)
#define rr return 0
#define sqr(a) ((a)*(a))
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()

using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

template<class value, class cmp = less<value> >
using ordered_set = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class value, class cmp = less_equal<value> >
using ordered_multiset = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class key, class value, class cmp = less<key> >
using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;

/// find_by_order()
/// order_of_key()
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
inline int randll(int l = INT_MIN, int r = INT_MAX) {
    return uniform_int_distribution<int>(l, r)(rng);
}
const int INF = 1e9, MOD = 1e9 + 7; /// think
const ll LINF = 1e18;


const int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0};
inline bool inside (int x, int y, int n, int m) {
    return 0 <= x && 0 <= y && x < n && y < m;
}

template<class T> bool umin (T &a, T b) {return a > b ? (a = b, true) : false; }
template<class T> bool umax (T &a, T b) {return a < b ? (a = b, true) : false; }


main()
{
    ios::sync_with_stdio(0);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int a, b;
    cin >> a >> b;
    cout << 6 - a - b << '\n';
}


Measured memory_bytes: 3664
#include <stdio.h>

int main() {
  int a, b, c;
  
  scanf("%d %d %d", &a, &b, &c);
  if(a >= b && a >= c) printf("%d\n", b + c);
  else if(b >= a && b >= c) printf("%d\n", a + c);
  else printf("%d\n", a + b);
  
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
vector<long long int> p;
int main() {
	int n;
	double a=1.0, b=0.0;
	cin >> n;
	p.resize(n);
	rep(i, n) { 
		cin >> p[i];
		a *= p[i];
	}
	rep(i, n) {
		b += (a / p[i]);
	}
	cout << fixed <<setprecision(10)<< a/b << "\n";
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
const int MAX = 700000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
/*第二引数で第一引数を割ったときの切り上げの計算*/
long long int maxtime(long long int x, long long int y) {
	return(x + y - 1) / y;

}
/*最大公約数*/
long long int lcm(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;

	if (number2 > number1) {
		m = number2;
		n = number1;
	}
	long long int s = -1;
	while (s != 0) {
		s = m % n;
		m = n;
		n = s;
	}
	return m;
}
/*最大公倍数*/
long long int gcd(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;
	return m / lcm(m, n) * n;
}
long long int dp[100020] = {};
int main() {
	long long int n;
	cin >> n;
	long long int x = 0;
	long long int sum = 0;
	long long int keisu = 1;
	for (int i = 0; i < n; i++) {
		long long int a;
		cin >> a;
		dp[i] = a;
		sum = sum + a * keisu;
		if (keisu == 1) {
			keisu = -1;
		}
		else {
			keisu = 1;
		}
	}
	x = sum;
	long long int ans = 0;
	cout << sum <<" ";
	for (int i = 0; i < n-1; i++) {
		ans = (dp[i] - x / 2) * 2;
		cout << ans << " ";
		x = ans;
	}
}

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

#define int long long

int N,k;
int a[5050];

bool check(int pos)
{
//	cout<<"check "<<pos<<" : "<<endl;
	
	if(a[pos]>=k) return false;
	bitset<5050> sumwk(1);
	for(int i=0;i<N;i++)
	{
		if(i!=pos) sumwk|=(sumwk<<a[i]);
	}
//	cout<<sumwk<<endl;
	for(int i=k-a[pos];i<k;i++)
	{
		if(sumwk[i]) return false;
	}
	return true;
}

signed main()
{
//	freopen(".txt","r",stdin);
//	freopen(".out","w",stdout);
	ios::sync_with_stdio(false);
	
	cin>>N>>k;
	for(int i=0;i<N;i++)
	{
		cin>>a[i];
	}
	sort(a,a+N);
	
	int sum=0;
	for(int i=0;i<N;i++) sum+=a[i];
	if(sum<k)
	{
		cout<<N<<endl;
		return 0;
	}
	else if(sum==k)
	{
		cout<<0<<endl;
		return 0;
	}
	
	int L=0,R=N-1,mid;
	while(R-L>=5)
	{
		mid=(L+R)/2;
		if(check(mid)) L=mid; // a[mid] is useless
		else R=mid;
	}
	for(int i=min(R+5,N-1);i>=0;i--)
	{
		if(check(i))
		{
			cout<<i+1<<endl;
			return 0;
		}
	}
	cout<<0<<endl;
}








































Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <climits>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <cassert>
#include <unordered_map>

#define _(x) { cout << #x << " = " << x << " "; }

const double E = 1e-8;
const double PI = acos(-1);

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    cout << ceil(n/2.0) << endl;
    return 0;
}



Measured memory_bytes: 384
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int a[200010];
    rep(i, N) cin >> a[i];
    int sum[200010] = {};
    rep(i, N) sum[i + 1] = sum[i] + a[i];
    map<int, int> mp;
    rep(i, N + 1) mp[sum[i]]++;
    int ans = 0;
    int num = 0;
    rep(i, N) {
        ans += mp[num] - 1;
        mp[sum[i]]--;
        num += a[i];
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 18992
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> P;
typedef vector<P> vpl;
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int mod = 1e9 + 7;
const int MAX = 510000;

int main() {
    ll n,A,B; cin >> n >> A >> B;
    vector<tuple<ll,ll,ll>> tp(n);
    rep(i,n){
        ll a,b,c; cin >> a >> b >> c;
        tp[i] = tie(a,b,c);
    }
    ll dp[n+1][405][405];
    rep(i,n+1) rep(j,401) rep(k,401) dp[i][j][k] = inf;
    dp[0][0][0] = 0;
    rep(i,n){
        ll a,b,c;
        tie(a,b,c) = tp[i];
        //cout << a << b << c << endl;
        rep(j,401){
            rep(k,401){
                dp[i+1][j][k] = dp[i][j][k];
                if(j - a >= 0 && k - b >= 0) dp[i+1][j][k] = min(dp[i+1][j][k],dp[i][j-a][k-b]+c);
            }
        }
    }
    ll ans = inf;
    REP(j,1,401){
        if(j%A==0) {
            if(j/A*B<=400) ans = min(ans, dp[n][j][j/A*B]);
        }
    }
    if(ans != inf) cout << ans << endl;
    else puts("-1");
}

Measured memory_bytes: 52736
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double lb;
#define REP(i,j,n) for (int i=j;i<(n);i++)
#define RREP(i,n) for (int i = n; 0<i;i--)
#define print(out) cout<< out  << "\n";
#define mod 1000000007
const int INF = 1e8;
typedef pair<int,int> P;

int main(){
  int N;cin>>N;
  vector<ll> A(N+1),B(N);
  ll tmp,ans=0;
  REP(i,0,N+1)cin>>A[i];
  REP(i,0,N)cin>>B[i];
  REP(i,0,N){
    if(A[i]<B[i]){
      ans+=A[i];
      if(A[i+1]<=B[i]-A[i]){
        ans+=A[i+1];
        A[i+1]=0;
      }
      else{
        A[i+1]-=B[i]-A[i];
        ans+=B[i]-A[i];
      }
    }
    else if(A[i]>=B[i]){
      ans+=B[i];
    }
    // if(i==N){
    //   ans+=min(A[N+1],B[N]-A[N]);
    // }
  }
  print(ans)
  return 0;
}


Measured memory_bytes: 1792
using System;

namespace ABC153A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int h = int.Parse(input[0]);
            int a = int.Parse(input[1]);
            int answer = 0;

            if(h % a == 0)
            {
                answer = h / a;
            }
            else
            {
                answer = h / a + 1;
            }

            Console.WriteLine(answer);

        }
    }
}


Measured memory_bytes: 11220
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;




public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		String str = buf.readLine();
		int q = Integer.parseInt(buf.readLine());
		String line;
		String[] part;
		String tmp;
		int a;
		int b;
		
		// scan.nextLine()?????¨for?????????????????¨??????????????????????????????
		for (int i = 0; i < q; i++) {
			line = buf.readLine();
			part = line.split(" ");
			a = Integer.parseInt(part[1]);
			b = Integer.parseInt(part[2]);
			if (part[0].equals("print")) {
				System.out.println(str.substring(a, b+1));
			} else if (part[0].equals("reverse")) {
				tmp = str.substring(a, b+1);
				StringBuffer sbuf = new StringBuffer(tmp);
				tmp = sbuf.reverse().toString();
				str = str.substring(0, a) + tmp + str.substring(b+1, str.length());
			} else if (part[0].equals("replace")) {
				str = str.substring(0, a) + part[3] + str.substring(b+1, str.length());
			}
		}
	}

}

Measured memory_bytes: 25244
import math
import copy

def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:

            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l

n=nCast(input())
a=nCast(input().split())
def func():
    if sum(a)/2>max(a):
        return "Yes"
    else:
        return "No"
    
    
    
    
print(func()) 







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

int main(){
    int A, B;
    cin >> A >> B;

    int ctn = 0;

    if(A > B) {
        ctn += A;
        A--;
    } else {
        ctn += B;
        B--;
    }

    if(A > B) {
        ctn += A;
        A--;
    } else {
        ctn += B;
        B--;
    }

    cout << ctn << endl;
}

Measured memory_bytes: 256
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong(),k=sc.nextLong();
		long ans=n%k;
		System.out.println(Math.min(ans,Math.abs(ans-k)));
	}
}

Measured memory_bytes: 21972
#include <stdio.h>
   
int main(void)
{
    int a ,b;
    scanf("%d %d",&a,&b);
      
   int lanLec = (a * 2) + (b * 2);
   int areaLec = a * b;
   
   printf("%d %d\n",areaLec,lanLec);
    return 0;
}

Measured memory_bytes: 596
#include <cstdio>
#include <iostream>

using namespace std;

int main (){
  int n,a,ans = 0;
  scanf("%d",&n);
  for(int i = 1;i <= n;i++){
    scanf("%d",&a);
    if(i%2 == 1 && a%2 == 1) ans++;
  }
  printf("%d",ans);
  return 0;
}

Measured memory_bytes: 3200
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <memory>
#include <regex>
using namespace std;

int main()
{
    string s;
    cin >> s;

    sort(s.begin(), s.end());
    if(s[0] == s[1] && s[1] != s[2] && s[2] == s[3])
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(n) begin(n), end(n)
const long long INF = numeric_limits<long long>::max();
typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef unsigned long long ull;
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;
}
template <typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template <typename T, typename... Ts>
auto make_v(size_t a, Ts... ts)
{
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }

template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v)
{
    for (auto &e : t)
        fill_v(e, v);
}
int main()
{
    int N;
    cin>>N;
    vint H(N);
    int cur = 0;
    for (size_t i = 0; i < N; i++)
    {
        cin>>H[i];
        if(cur <= H[i]-1)
        {
            H[i]--;
        }
        if(cur > H[i])
        {
            cout<<"No";
            return 0;
        }
        cur = H[i];
    }
    cout<<"Yes";
    return 0;
}

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

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define rng(a) a.begin(), a.end()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

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

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

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

template <typename T, size_t S> void printArray(const T (&array)[S]) {
  for (auto val : array)
    std::cout << val << ", ";
  std::cout << "\n";
}

const int mod = 1e9 + 7;
const int inf = 1e9 + 5;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << std::setprecision(10);

  int n; std::cin >> n;
  vi a(n); rep(i, n) std::cin >> a[i];
  auto print = [&]() {
    rep(i, n) std::cout << a[i] << (i+1 < n ? " " : "\n");
  };
  print();
  rrep(i, n-1) {
    int v = a[i];
    int j = i-1;
    for (; j >= 0 && a[j] > v; j--) {
      a[j+1] = a[j];
    }
    a[j+1] = v;
    print();
  }
}



Measured memory_bytes: 3164
#include <iostream>
#include <bitset>
#include <string>
#include <algorithm>
#include <vector>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(c) c.begin(),c.end()
#define PB push_back
#define INF 1100000000
#define LLINF 1100000000000000000

using namespace std;
typedef long long ll;

int main()
{
  int n; cin >> n;
  vector<int> a(n); REP(i, n) cin >> a[i];
  vector<int> ans;
  if (n % 2 == 0) {
    for (int i = n - 1; i >= 1; i -= 2) ans.PB(a[i]);
    for (int i = 0; i <= n - 2; i += 2) ans.PB(a[i]);
  } else {
    for (int i = n - 2; i >= 1; i -= 2) ans.PB(a[i]);
    for (int i = 0; i <= n - 1; i += 2) ans.PB(a[i]);
    reverse(ALL(ans));
  }
  REP(i, ans.size()) cout << ans[i] << ' ';
  cout << endl;

  return 0;
}

Measured memory_bytes: 3828
#include <iostream>

using namespace std;

int main(void){
	int hasnext = 1;
	while(hasnext){
		int a,b;
		char op;
		cin >> a >> op >> b;
		switch(op){
		case '+':
			cout << a+b << endl;
			break;
		case '-':
			cout << a-b << endl;
			break;
		case '*':
			cout << a*b << endl;
			break;
		case '/':
			cout << a/b << endl;
			break;
		case '?':
			hasnext = 0;
			break;
		}
	}

	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#include <sys/types.h>
#include <unistd.h>

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

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

using ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};

const pid_t pid = getpid();
// Problem Specific Parameter:

int main(void){
	ll n;
	cin >> n;
	vector<ll> a(n);
	rep(i,n) cin >> a[i];
	sort(begin(a),end(a));

	ll ans = 0LL;

	rep(loop,2){
	
		deque<ll> b = {a[0]};

		int s = 1, t = n;
		while(s < t){
			if(s < t) b.push_front(a[--t]);
			if(s < t) b.push_back(a[--t]);	
		
			if(s < t) b.push_front(a[s++]);
			if(s < t) b.push_back(a[s++]);	
		}	

		ll cur = 0LL;
		rep(i,n-1) cur += abs(b[i] - b[i+1]);
		chmax(ans,cur);
		reverse(begin(a),end(a));
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 1860
#include<stdio.h>
#include<math.h>

int main(){
  int n,a,b;
  scanf("%d%d%d",&n,&a,&b);
  if(b<n*a){
    printf("%d\n",b);
  }
  else{
    printf("%d\n",a*n);
  }
  return 0;
}


Measured memory_bytes: 128
#include <stack>
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <array>
#include <iomanip>
#include <string>
using namespace std;
int gcd(int a, int b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}
int mod = 1000000000 + 7;

int main(){
    //std::stack<int> stack;
    int n, k;
    cin >> n >> k;
    long long ans = 0;
    
    vector<long long> left(n+1);
    vector<long long> right(n+1);
    left[0] = 0;
    right[0] = n;
    int tmp1 = 1;
    int tmp2 = n-1;
    for(int i = 1; i <= n; i++){
        left[i] = (left[i-1] + tmp1);
        right[i] = (right[i-1] + tmp2);
        tmp1 ++;
        tmp2 --;
    }
    for(int i = k-1; i <= n; i++){
        ans += (right[i] - left[i] + 1);
        ans %= mod;
    }
    // for(int i = 0; i <= n; i++){
    //     cout << left[i] << " " << right[i] << endl;
    // }
    cout << ans << endl;
     return 0;
}





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

int h[1500],w[1500];
int H[1500000],W[1500000];


int comb(int *A,int *a,int k){
  int mx;
  for(int i=0;i<k;i++){
    int sum=0;
    for(int j=i;j<k;j++){
      sum+=a[j];
      A[sum]++;
    }
    if(i==0)mx=sum;
  }
  // for(int i=0;i<=mx;i++)
  //   cout << A[i] << " ";
  //cout << endl;
  return mx;
}

int main(){
  int n,m;
  while(cin>>n>>m,n){
    memset(H,0,sizeof(H));
    memset(W,0,sizeof(W));
    int mh,mw;
    for(int i=0;i<n;i++)cin>>h[i];
    mh=comb(H,h,n);
    for(int i=0;i<m;i++)cin>>w[i];
    mw=comb(W,w,m);
    int ans=0;
    for(int i=0;i<=min(mh,mw);i++)
      ans+=H[i]*W[i];
    cout << ans << endl;
  }
}

Measured memory_bytes: 12896
package main 

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

var sc = bufio.NewScanner(os.Stdin)

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

func main () {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	var A []int
	for i := 0; i < n; i++ {
		A = append(A,nextInt())
	}
	insertionSort(A, n)
}

func insertionSort(A []int, N int) []int {
	v := 0
	j := 0
	for j, y := range A {
		if (j == len(A)-1) {
			fmt.Println(y)
		} else {
			fmt.Printf("%d ", y)
		}
	}

	for i := 1; i <=  N-1; i++ {

		v = A[i]
		j = i - 1
		for (j >= 0 && A[j] > v) {
			A[j+1] = A[j]
			j--
		}
		A[j+1] = v
		for i, x := range A {
			if (i == len(A)-1) {
				fmt.Printf("%d", x)
			} else {
				fmt.Printf("%d ",x)
			}
		}
		fmt.Println()
	}
	return A
}



Measured memory_bytes: 1188
#include <iostream>

using namespace std;

const int NIL = -1; 

typedef struct {
	int degree; //度 
	int parent; 
	int left;
	int right;
} Node;

Node *Tree; //树 

/*int *Depth; //深度 

int *Heigh; //高度 

void setDepth(int node,int dep) {
	Depth[node] = dep;
	if (Tree[node].left != NIL) {
		setDepth(Tree[node].left,dep+1);
	}
	if (Tree[node].right != NIL) {
		setDepth(Tree[node].right,dep+1);
	}
}

void setHeigh(int node) {	
	if (Tree[node].left == NIL && Tree[node].right == NIL) {
		Heigh[node] = 0;
		return;
	}
	if (Tree[node].left != NIL) {
	    setHeigh(Tree[node].left);
    }
    
    if (Tree[node].right != NIL) {
    	setHeigh(Tree[node].right);
    }
    
	int leftH = Tree[node].left == NIL ? 0 : Heigh[Tree[node].left];
	int rightH = Tree[node].right == NIL ? 0 : Heigh[Tree[node].right];
	Heigh[node] = max(leftH,rightH) + 1;
}

void printTree(int n) {
	for (int i=0;i<n;i++) {
		cout << "node " << i << ": parent = " << Tree[i].parent << ", sibling = ";
		if (Tree[i].parent == NIL) {
			cout << NIL;
		} else {
			int parent = Tree[i].parent;
			if (i == Tree[parent].left) {
				cout << Tree[parent].right;
			} else {
				cout << Tree[parent].left;
			}
		}
		cout << ", degree = " << Tree[i].degree << ", depth = " << Depth[i] << ", height = " << Heigh[i] << ", ";
		if (Tree[i].parent == NIL) {
			cout << "root";
		} else if (Tree[i].degree == 0) {
			cout << "leaf"; 
		} else if (Tree[i].degree > 0) {
			cout << "internal node";
		} 
		cout << endl;
	}
}*/

void Preorder(int node) {
	cout << " " << node;
	if (Tree[node].left != NIL) {
	  Preorder(Tree[node].left);
    }
    if (Tree[node].right != NIL) {
	  Preorder(Tree[node].right);
    }
}

void Inorder(int node) {
	if (Tree[node].left != NIL) {
	  Inorder(Tree[node].left);
    }
    cout << " " << node;
    if (Tree[node].right != NIL) {
	  Inorder(Tree[node].right);
    }
}

void Postorder(int node) {
	if (Tree[node].left != NIL) {
	  Postorder(Tree[node].left);
    }
    if (Tree[node].right != NIL) {
	  Postorder(Tree[node].right);
    }
    cout << " " << node;
}

int main() {
	int n;
	cin >> n;
	Tree = new Node[n];
	/*Depth = new int[n];
	Heigh = new int[n];*/
	 
	for (int i=0;i<n;i++) {
		Tree[i].parent = Tree[i].left = Tree[i].right = NIL;
	}
	
	for (int i=0;i<n;i++) {
		int p,l,r;
		cin >> p >> l >> r;
		Tree[p].left = l;
		Tree[p].right = r;
		Tree[p].degree = 0;
		if (l != NIL) {
			Tree[l].parent = p;
			Tree[p].degree++;
		}
		
		if (r != NIL) {
			Tree[r].parent = p;
			Tree[p].degree++;
		}
	}
	int root;
	for (int i=0;i<n;i++) {
		if (Tree[i].parent == NIL) {
			root = i;
			break;
		}
	}
	/*setDepth(root,0);
	setHeigh(root);*/
	cout << "Preorder" << endl;
	Preorder(root);
	cout << endl;
	cout << "Inorder" << endl;
	Inorder(root);
	cout << endl;
	cout << "Postorder" << endl;
	Postorder(root);
	cout << endl;
	
	delete[] Tree;
	
	/*delete[] Depth;
	delete[] Heigh;*/
	
	return 0;
	
}


Measured memory_bytes: 3076
//naveen mall
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb               push_back
#define sz(c)            (int)c.size()
#define len(c)           (int)c.length()
#define vec              vector
#define int              long long int
#define all(c)           c.begin(), c.end()
#define rall(c)          c.rbegin(), c.rend()
#define trav(a,i)        for(auto i: a)
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define invect(v,n)       for(int i=0;i<n;i++ ){int arb;cin>>arb;v.pb(arb);}
#define inset(s,n)        fl(i,0,n){int aset;cin>>aset;s.insert(aset);}
#define display(c)        trav(c,i) cout<<i<<" ";cout<<"\n";
#define F                 first
#define S                 second
#define pii               pair<int,int>
#define PB                pop_back
#define endl              "\n"
#define what(x) cerr <<  #x << " is " << x << endl;
int sum() { return 0; }template<typename T,typename... Args>T sum(T a, Args... args) { return a + sum(args...); }


void solve()
{ 
   int n;
   cin>>n;
   int ans=0;
   rep(i,1,n+1)
     {
        if(i%3!=0 and  i%5!=0)
             ans+=i;
     }
     cout<<ans;

}
signed main()
{fast
    int t;
  t=1;
   //cin>>t;
  while(t--)
     {
      solve();
     }



}
  













Measured memory_bytes: 3636
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <vector>
#include <utility>

using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int n,k;
int main(){
	scanf("%d%d",&n,&k);
	if(k * 2 - 1 <= n) puts("YES");
	else puts("NO");
	return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    S=input()
    if S[0]=='A' and S[2:-1].count('C')==1 and S[1:S.index('C')].islower() and S[S.index('C')+1:].islower():
        print('AC')
    else:
        print('WA')

if __name__ == '__main__':
    main()


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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    ll N, A, B, C, D, E;
    cin >> N >> A >> B >> C >> D >> E;
    ll m = min({A, B, C, D, E});
    cout << (N + m - 1) / m + 4 << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9+7;
typedef pair<int,int> P;
#define INF 1e9
#define rep(i,N) for(int i=0;i<N;i++)

int main(){
    int l,k;
    cin>>l>>k;
    ll dp[l+1][2];
    int cnt = 0;
    memset(dp,0,sizeof(dp));
    dp[0][0] = 1;
    rep(i,l+1){
        rep(j,2){
            if(i>=1){
                dp[i][j] += dp[i-1][j^1];
            }
            if(j%2==1 && i>=k)dp[i][j] += dp[i-k][j^1];
        }
    }
    ll ans = 0;
    rep(i,l+1){
        //cout<<"i:"<<i<<" dp:"<<dp[i][1]<<endl;
        ans += dp[i][1];
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3084
h, w = map(int, input().split())
A = [list(str(input())) for _ in range(h)]

p = -1
q = -1
for i in range(h):
    for j in range(w):
        if A[i][j] == '#':
            if q > j:
                print('Impossible')
                exit()
            else:
                p = j
    q = p
else:
    print('Possible')


Measured memory_bytes: 38384
#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; }
 

int main(){
  int n;
  cin >> n;
  vi h(n);
  rep(i,n) cin >> h.at(i);

  int ans = 0;
  int tmp = 0;
  for(int i=0;i <n-1; i++){
    if(h.at(i) >= h.at(i+1)){
      tmp+=1;
    }else{
      tmp = 0;
    }
    ans = max(ans,tmp);
  }

  cout << ans << endl;
}

Measured memory_bytes: 640
#include<iostream>
using namespace std;
int main() {
	int A[3]; int a,b,c;for(int i=0;i<10;i++){
		cin>>a;if(a>A[0]){b=A[0];A[0]=a;c=A[1];A[1]=b;A[2]=c;}
		else if(a>A[1]){b=A[1];A[1]=a;A[2]=b;}
		else if(a>A[2]){A[2]=a;}
} 
cout<<A[0]<<endl<<A[1]<<endl<<A[2]<<endl;
return 0;
}

Measured memory_bytes: 1160
#グラフの連結成分を調べる
def Graph(ab):
    G=[[] for i in range(n)]
    for a,b in ab:
        G[a-1].append(b)
        G[b-1].append(a)
    return G

from collections import deque
def dfs(G, a, b):
    #(a, b)は除外する辺
    q=deque()
    q.append((1, -1, 0))
    log = [0] * n
    log[0] = 1
    while q:
        V,P,S=q.pop()
        if S==0:
            #下に遷移していくときの処理
            #q.append((V,P,1))
            for new_v in G[V-1]:
                if {a, b} == {new_v, V}:continue
                if new_v==P:continue
                if log[new_v - 1]:continue
                log[new_v - 1] = 1
                q.append((new_v,V,0))

    return sum(log) != n

n, m = map(int,input().split())
ab = [list(map(int,input().split())) for i in range(m)]
G = Graph(ab)
'''
ab一個を除いた時に連結かどうか調べる
'''

ans = 0
for a, b in ab:
    if dfs(G, a, b):ans += 1
print(ans)

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

int main(int argc, char const *argv[])
{
  int a, b, c;
  cin >> a >> b >> c;
  if(a == b)
  {
    cout << (b == c ? 1 : 2) << flush;
  }
  else
    cout << ((a == c || b == c) ? 2 : 3) << flush;
  return 0;
}


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

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

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

int main() {
  int64_t r, c, k;
  cin >> r >> c >> k;
  vector<int64_t> x(k), y(k), v(k);
  for (int i = 0; i < k; i++) {
    cin >> x.at(i) >> y.at(i) >> v.at(i);
    x.at(i)--;
    y.at(i)--;
  }
  vector<vector<int64_t>> value(r, vector<int64_t>(c));
  for (int i = 0; i < k; i++) {
    value.at(x.at(i)).at(y.at(i)) = v.at(i);
  }
  vector dp(r, vector(c, vector(4, 0L)));
  dp.at(0).at(0).at(1) = value.at(0).at(0);
  for (int i = 1; i < c; i++) {
    dp.at(0).at(i).at(0) = dp.at(0).at(i - 1).at(0);
    for (int j = 1; j < 4; j++) {
      dp.at(0).at(i).at(j) = max(dp.at(0).at(i - 1).at(j - 1) + value.at(0).at(i),
                                 dp.at(0).at(i - 1).at(j));
    }
  }
  for (int i = 1; i < r; i++) {
    dp.at(i).at(0).at(0) = dp.at(i - 1).at(0).at(1);
    dp.at(i).at(0).at(1) = dp.at(i - 1).at(0).at(1) + value.at(i).at(0);
  }
  for (int i = 1; i < r; i++) {
    for (int j = 1; j < c; j++) {
      int64_t prevmax = *max_element(dp.at(i - 1).at(j).begin(), dp.at(i - 1).at(j).end());
      dp.at(i).at(j).at(0) = max(prevmax, dp.at(i).at(j - 1).at(0));
      dp.at(i).at(j).at(1) = prevmax + value.at(i).at(j);
      for (int l = 1; l < 4; l++) {
        dp.at(i).at(j).at(l) = max({dp.at(i).at(j).at(l),
                                    dp.at(i).at(j - 1).at(l),
                                    dp.at(i).at(j - 1).at(l - 1) + value.at(i).at(j)});
      }
    }
  }
  cout << *max_element(dp.at(r - 1).at(c - 1).begin(),
                       dp.at(r - 1).at(c - 1).end()) << endl;
}


Measured memory_bytes: 711336