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


int main(){

int n,y;
cin >> n >> y;
int co=0;
int a,b,c;



    rep(j,n+1){
        rep(k,n+1){
            if(y==(n-j-k)*10000+j*5000+k*1000 and 0<= n-j-k){
                cout << n-j-k << " " << j << " " << k << endl;
                co++;
                break;
            }
        }
        if(co!=0)break;
    }

if(co==0)cout << -1 << " " << -1 << " " << -1 << endl;
return 0;
}






Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using namespace std;
#define ll long long
#define ALL(x) begin(x),end(x)
  
int main(){
  ll n,l; cin >> n >> l;
  vector<string> s(n);
  rep(i,n) cin >> s[i];
  sort(ALL(s));
  rep(i,n) cout << s[i];
  cout << endl;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
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;
}
typedef long long int ll;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define endl "\n"
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b, c;
    cin >> a >> b >> c;
    if(a == b && b != c) {
        cout << "Yes" << endl;
    } else if(b == c && c != a) {
        cout << "Yes" << endl;
    } else if(c == a && a != b) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

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

const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int main(){
    int n, w;
    cin >> n >> w;
    vi wi(n), v(n);
    rep(i, n) cin >> wi[i] >> v[i];
    vector<vll> dp(n+5, vll(w+w+5));
    rep(i, n) rep(j, w+1) {
        dp[i+1][j+wi[i]] = max(dp[i+1][j+wi[i]], dp[i][j]+v[i]);
        dp[i+1][j] = max(dp[i+1][j], dp[i][j]);
    }
    cout << dp[n][w] << endl;
    return 0;
}


Measured memory_bytes: 168876
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;

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

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

constexpr int MOD = 1e9 + 7;
constexpr ll INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

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

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

    int n, d; cin>>n>>d;
    int id = 0;
    int cnt = 1 + 2 * d;
    int ans = 0;
    while(id < n){
        id += cnt;
        ans++;
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n, s[100005];
long long ans, tmp;
int main(){
    scanf("%d", &n);
    for(int i = 0; i < n; i++) scanf("%d", s+i);
    n--;
    for(int i = 1; i < n; i++){
        tmp = 0;
        for(int j = i; j + (n%i ? i : j) < n; j += i){
            ans = max(ans, tmp += s[j] + s[n-j]);
        }
    }
    printf("%lld\n", ans);
}

Measured memory_bytes: 640
n = int(input())
a = [list(map(int, input().split())) for _ in range(2)]

ans = 0
for i in range(n):
   x = 0
   row = 0
   for j in range(n):
      x += a[row][j]
      if i == j:
         row += 1
         x += a[row][j]
   ans = max(ans, x)

print(ans)


Measured memory_bytes: 9036
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>

using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,a,n) for(int i=a;i<n;i++)
#define all(a) (a).begin(),(a).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eps 1e-15

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef map<int,int> mii;
typedef pair<int,int> pii;
typedef tuple<int,int,int> ti3;

void Main()
{
	int N, A, B; cin >> N >> A >> B;
	cout << (N * A > B ? B : N * A) << endl;
}

int main()
{
    cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	Main();
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <unordered_map>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iomanip>
#include <queue>
using namespace std;

typedef int64_t ll;
const ll INF = 1000000000000000000;
#define fori(i, a, b) for (ll i = (a); i < (b); ++i)
#define ford(i, a, b) for (ll i = (b - 1); (a) <= i; --i)
#define rep(i, n) fori(i, 0, n)
#define vll vector<ll>
#define all(v) v.begin(), v.end()





int main() {
	ll a, b;
	cin >> a >> b;
	if (a % 2 == 1 && b % 2 == 1) cout << "Yes" << endl;
	else cout << "No" << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int t, n;
		int ans = 0;
		
		for(int i = 0; i < 4; i++){
			t = scan.nextInt();
			n = scan.nextInt();
			
			if(t == 1)ans = n * 6000;
			else if(t == 2)ans = n * 4000;
			else if(t == 3)ans = n * 3000;
			else if(t == 4)ans = n * 2000;
			
			System.out.println(ans);
		}
	}
}

Measured memory_bytes: 26392
#include <iomanip>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
using namespace std;

int main(void) {
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  int X = (double)N / 1.08;
  int M = (double)X * 1.08;
  if (N == M)
    cout << X << endl;
  else {
    X++;
    M = (double)X * 1.08;
    if (N == M)
      cout << X << endl;
    else
      cout << ":(" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll mod=1e9+7;

ll fp(ll b,ll p){ 
	if(p==0) return 1;
	if(p&1) return (b*fp(b,p-1))%mod;
	return fp((b*b)%mod,p/2);
}

ll nCr(ll n, ll r){ 
    ll res=1;
    for(int i=0; i<r; ++i) res=res*(n-i)%mod;
    for(int i=1; i<=r; ++i) res=res*fp(i, mod-2)%mod;
    return res;
}

int main()
{   
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n,a,b;
    
    cin>>n>>a>>b;
    ll ans=(fp(2,n)-1+mod)%mod;
    cout<<(ans-nCr(n,a)+mod-nCr(n,b)+mod)%mod<<endl;

  
  

     
    return 0;
}


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

int main()
{
  int64_t N, s = 0, cnt = 0, ans;
  cin >> N;
  vector<int64_t> A(N);
  for (int i = 0; i < N; i++)
  {
    cin >> A.at(i);
  }
  bool pos = true;
  for (int i = 0; i < N; i++)
  {
    s += A.at(i);
    if (pos && s <= 0)
    {
      cnt += (1 - s);
      s = 1;
    }
    else if (!pos && s >= 0)
    {
      cnt += (s + 1);
      s = -1;
    }
    pos = !pos;
  }
  ans = cnt, cnt = 0, s = 0, pos = false;
  for (int i = 0; i < N; i++)
  {
    s += A.at(i);
    if (pos && s <= 0)
    {
      cnt += (1 - s);
      s = 1;
    }
    else if (!pos && s >= 0)
    {
      cnt += (s + 1);
      s = -1;
    }
    pos = !pos;
  }
  cout << min(cnt, ans) << endl;
}


Measured memory_bytes: 4060
#include <bits/stdc++.h>
using namespace std;
#define vsort(vec) sort(vec.begin(), vec.end())
#define vreverse(vec) reverse(vec.begin(), vec.end())
using ll =long long;
const ll INF =1001001001;

//最大公約数
ll gcd(ll a, ll b){
   if (a%b==0){
       return(b);
   }else{
       return(gcd(b,a%b));
   }
}
//最小公倍数
ll lcm(ll a, ll b){
   return a*b/gcd(a,b);
}

//素数判定
ll isprime(ll n){
  bool prime=true;
  for(int i=2;i<n;i++){
    if(n%i==0){
      prime=false; break;
    }
  }
if(prime){cout<<n<<" is prime"<<endl;
         }else{cout<<n<<" is not prime"<<endl;}

}
//階乗　20くらいが限界
ll factorial(ll n){
  ll a=1;ll b=n;
  for(int i=0;i<n;i++){
    a*=b;
    b--;
  }
  return a;
}

//組み合わせ　nCr
ll comb(ll a,ll b){
  ll c;
  c=factorial(a)/(factorial(a-b)*factorial(b));
  return c; 
}




//10億7。　　　100000007
//2*2行列 H*W
//vector<vector<int>> vec(H,vector<int>(W));
//for(int i=0;i<H;i++){
//for(int j=0;j<W;j++){
//cin>>vec[i][j];
//  }
//}

//文字列→数列
//string S;int A=atoi(S.c_str());
//数列→文字列
//int A;string S=to_string(A);
//数字判定　isdigit(a)
//pair宣言　pair<int,int> p(5,7);
//ソート　sort(vec.begin(),vec.end());


int main(){
cout<<fixed<<setprecision(10);

  int N,Y;
  cin>>N>>Y;
  int a,b,c;
  a=10000;
  b=5000;
  c=1000;
  int sum=0;
  bool A=false;
  for(int i=0;i<=N;i++){
    for(int j=0;j<=N;j++){
      if(a*i+b*j+c*(N-i-j)==Y&&i+j<=N){
        A=true;
        cout<<i<<" "<<j<<" "<<N-(i+j)<<endl;
        break;
      }
    }
    if(A)break;
  }
  
  if(!A){
    cout<<"-1 -1 -1"<<endl;
  }

}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
const int inf=1e9;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
int dp[1010][1010];
int main(){
	string a,b;
	cin>>a>>b;
	rep(i,1010)rep(j,1010)if(i&&j)dp[i][j]=inf;
	else dp[i][j]=max(i,j);
	rep(i,a.size())rep(j,b.size())if(a[i]==b[j])dp[i+1][j+1]=dp[i][j];
	else dp[i+1][j+1]=min(dp[i][j],min(dp[i][j+1],dp[i+1][j]))+1;
	cout<<dp[a.size()][b.size()]<<endl;
}

Measured memory_bytes: 5176
#include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1001001001
#define LINF 1001001001001001001
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define bit(n) (1LL<<(n))
#define MAX_N 1000000000000001
using namespace std;

typedef pair<int, int> P;
typedef pair<long long, long long> LLP;
typedef long long ll;

int main() {

    ll N;
    cin >> N;
    N--;
    int ans[100];
    int k = 0;
    ans[0] = N % 26;
    k++;
    ll sum = 26;
    ll x = 26;
    while (N >= sum) {
        ans[k] = (N - sum) % (x * 26) / x;
        x *= 26;
        sum += x;
        k++;
    }

    rep(i,k) {
        char a = 'a' + ans[k - i - 1];
        cout << a;
    }
    cout << endl;

    return 0;
}

Measured memory_bytes: 3592
#include <stdio.h>

int main() {
	int n,n100,n10,n1;
	scanf("%d", &n);
	n100 = n / 100;
	n10 = (n - n100*100) / 10;
	n1 = n % 10;

	if(n100==7||n10==7||n1==7){
		printf("Yes");
	}
	else {
		printf("No");
	}
}

Measured memory_bytes: 1724
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include <ios> 
#include <iomanip>
using namespace std;

#define N_MAX   (100000)
#define LL_MAX_NUM (1LL<<60)
#define INF 1e7

typedef long long ll;
typedef long long int lli;

int main() {
	int N ,A; cin >> N >> A;
	cout << N * N - A << endl;
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
const double pi = acos(-1);
const int SIZE = 1 << 17;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30];
long long fac[100005], finv[100005], inv[100005];
vector<long long>dij;
struct edge { long long to, cost; };
vector<vector<edge>>G;

int dp[105][5][5][5];
long long ans;
int main() {
	int n;
	cin >> n;
	dp[0][3][3][3] = 1;

	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < 4; ++j) {
			for (int k = 0; k < 4; ++k) {
				for (int l = 0; l < 4; ++l) {
					if (dp[i][j][k][l] == 0) { continue; }
					for (int m = 0; m < 4; ++m) {
						if (m == 2) {
							if ((j == 1 && k == 0) || (j == 0 && k == 1) || (j == 1 && l == 0) || (k == 1 && l == 0)) { continue; }
						}
						else if (m == 1) {
							if (j == 2 && k == 0) { continue; }
						}
						dp[i + 1][m][j][k] += dp[i][j][k][l];
						dp[i + 1][m][j][k] %= MOD;
					}
				}
			}
		}
	}

	for (int i = 0; i < 4; ++i) {
		for (int j = 0; j < 4; ++j) {
			for (int k = 0; k < 4; ++k) {
				ans += dp[n][i][j][k];
				ans %= MOD;
			}
		}
	}
	cout << ans % MOD << endl;
}

Measured memory_bytes: 256
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main(void)
{
	int K ;
	int A , B;

	scanf("%d",&K);
	scanf("%d %d",&A,&B);

    for (int i = A;i<=B;i++)
	{
      if (i%K==0)
	  {
	  printf("OK");
	  return 0;
	  }
	}

	printf("NG");

	
	return 0;
}


Measured memory_bytes: 1724
import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS

readInt = fst . fromJust . BS.readInteger
readIntList = map readInt . BS.words
getIntList = readIntList <$> BS.getLine

main = do
    [a, b] <- getIntList
    let minA = fst $ properFraction $ realToFrac a * 12.5
        maxA = fst $ properFraction $ realToFrac (a+1) * 12.5
        minB = b * 10
        maxB = (b+1) * 10 - 1
        minElem = max minA minB
        maxElem = min maxA maxB
        priceSet = [p | p <- [minB.. maxB], fst (properFraction (realToFrac p * 0.08)) == a]
    putStrLn . show $ if length priceSet == 0 then -1 else head priceSet

Measured memory_bytes: 380
#pragma region
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <list>
#include <iomanip>
#include <cstdint>
#include <bitset>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()

#pragma region UnionFind
struct UnionFind
{
	vector<int> par;

	UnionFind(int n) : par(n, -1) {}
	void init(int n) { par.assign(n, -1); }

	int root(int x)
	{
		if (par[x] < 0) return x;
		else return par[x] = root(par[x]);
	}

	bool issame(int x, int y)
	{
		return root(x) == root(y);
	}

	bool merge(int x, int y)
	{
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y);
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	int size(int x)
	{
		return -par[root(x)];
	}
};
#pragma endregion
#pragma region GCD
int gcd(int a, int b)
{
	if (a%b == 0)return b;
	return gcd(b, a%b);
}
#pragma endregion
#pragma region chmin
template<class T> inline bool chmin(T& a, T b)
{
	if (a > b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma region chmax
template<class T> inline bool chmax(T& a, T b)
{
	if (a < b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma endregion


int main()
{
	int n, l; cin >> n >> l;
	vector<ll> a(n); rep(i, n)cin >> a[i];
	vector<ll> b(n - 1); rep(i, n - 1)b[i] = a[i] + a[i + 1];
	bool ok = false;
	int last = 0;
	rep(i, n - 1)if (b[i] >= l)
	{
		ok = true;
		last = i;
	}
	if (!ok)cout << "Impossible" << endl;
	else
	{
		cout << "Possible" << endl;
		rep(i, last)cout << i + 1 << endl;
		for (int i = n - 2; i > last; --i)cout << i + 1 << endl;
		cout << last + 1 << endl;
	}
}

Measured memory_bytes: 2432
#include<stdio.h>

int main(void){
  int i,n,x[100],max=0,min=101,p,ans=2147483,sum;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&x[i]);
  }
  
  for(i=0;i<n;i++){
    if(max<x[i])max=x[i];
  }
  for(i=0;i<n;i++){
    if(min>x[i])min=x[i];
  }

  for(p=min;p<=max;p++){
    for(i=0;i<n;i++){
      sum+=(x[i]-p)*(x[i]-p);
    }
    if(ans>sum)ans=sum;
    sum=0;
  }
  printf("%d",ans);
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
using namespace std;
typedef long long ll;

vector<ll> fct(1000001);
vector<ll> invfct(1000001);
const ll MOD = pow(10,9)+7;

map<ll, ll> prime_factorize(int n){
    map<ll, ll> ret;
    for(int i = 2; i * i <= n; i++) {
        while(n % i == 0) {
            ret[i]++;
            n /= i;
        }
    }
    if(n != 1) ret[n] = 1;
    return ret;
}

ll mpow(ll x, ll n){ //x^n(mod M)
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = ans*x % MOD;
        x = x*x % MOD;
        n = n >> 1;
    }
    return ans;
}

ll comb(ll a, ll b){ //aCb(mod M)
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0)return 0;
    ll tmp = invfct[a-b]* invfct[b] % MOD;
    return tmp * fct[a] % MOD;
}

ll dupc(ll a,ll b){
    if(a == 0 && b == 0)return 1;
    if(a < 0 || b == 0)return 0;
    ll tmp = invfct[a-1]* invfct[b] % MOD;
    return tmp * fct[a+b-1] % MOD;
}

int main(void){
    // Your code here!
    ll N, M;
    cin >> N >> M;
    auto pfmap = prime_factorize(M);
    fct[0] = 1;
    invfct[0] = 1;
    for(ll i = 0; i < 1000000; i++){
        fct[i+1] = fct[i] * (i+1) % MOD;
        invfct[i+1] = invfct[i] * mpow(i+1, MOD-2) % MOD;
    }
    
    ll ans = 1;
    for(auto itr = pfmap.begin(); itr != pfmap.end(); ++itr){
        ll tmp = comb(itr->second + N - 1, itr->second) % MOD;
        ans = ans *  tmp % MOD;
    }
    cout << ans % MOD << endl;
}


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

long long A,B,C,K;

int main(void)
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> A >> B >> C >> K;

    if(A>K){
        cout << K << endl;
    }else if(A+B>=K){
        cout << A << endl;
    }else{
        cout << A - (K - A - B) << endl;
    }

    return 0;
}

Measured memory_bytes: 3692
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <numeric>
#include <iostream>

using namespace std;

#define FOR(i, a, b)  for(int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for(int i = (a); i > (b); --i)
#define rep(i, n)	  for(int i = 0; i < (n); ++i)
#define all(c)		  begin(c), end(c)
#define rall(c)		  rbegin(c), rend(c)
#define SZ(a)		  ((ll) a.size())

typedef long long		   ll;
typedef unsigned long long ull;

void solve(string S) {
	bool flag = false;
	rep(i, SZ(S) - 1) {
		if(S.substr(i,  2) == "AC") flag = true;
	}
	if(flag) cout << "Yes";
	else cout << "No";
}

int main() {
	string S;
	cin >> S;
	solve(S);
	return 0;
}


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

int main()
{
		int n, i, j;
		double sum, a, SUM, m;
		double s[1001];
		while (1) {
				sum=0;
				SUM=0;
				cin >> n;
				if (n==0) break;
				for (i=0; i<n; i++) cin >> s[i];
				for (i=0; i<n; i++) sum += s[i];
				m = sum/n;
				for (i=0; i<n; i++) SUM += (s[i]-m)*(s[i]-m);
				cout << fixed << sqrt(SUM/n) << "\n";
		}
}

Measured memory_bytes: 3244
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007 

int main() {
	ll k,a,b;
	cin>>k>>a>>b;
	for(ll i=a;i<=b;i++){
		if(i%k==0){
			cout << "OK";
			return 0;
		}
	}
	cout << "NG";
	// your code goes here
	return 0;
}

Measured memory_bytes: 3636
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int r, D, x;
    scanf("%d%d%d", &r, &D, &x);
    int i;
    for (i = 1; i <= 10; i++)
    {
        x = r * x - D;
        printf("%d\n", x);
    }
    return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<vector>
#include<cstring>
#include<cmath>
#include<set>
#include<queue>
#include<algorithm>
#include<climits>
#include<map>
#include<unordered_map>
#define ll long long

bool isPrime(ll n){
    if(n%2==0 || n%3==0) return false;
    if(n<=1)  return false;
    if(n<=3)  return true;
    for(ll i=5;i*i<=n;i=i+6)
        if(n%i==0||n%(i+2)==0)
           return false;
    return true;
}

#define w(t) ll t,tt=1;	cin>>t;		while(t--)
#define ps(x,y) fixed<<setprecision(y)<<x
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __builtin_ctzll(x)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ff first
#define ss second
#define pb push_back
#define mp make_pair

#define vi vector<int>
#define vll vector<ll>
#define mii map<ll,ll>
#define umii unordered_map<ll,ll>
#define pi pair<int,int>
#define pll pair<ll,ll>
#define vpii vector<pair<int,int>>
#define vpll vector<pair<ll,ll>>

#define mod 1e9+7
#define inf 1e18

#define lln ll n; cin>>n
#define intn int n; cin>>n
#define YES cout<<"Yes"
#define NO cout<<"No"
#define strr    string str; cin>>str;
#define strn   n=str.length()
#define fr(a,n) for(ll i=a;i<n;i++)
#define loop for(ll i=0;i<n;i++)

using namespace std;

void solve (){
    strr;
    ll num=0;
    for(auto i:str)
        num+=(ll)(i-'0');
    if(num%9)   NO;
    else        YES;
}

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


Measured memory_bytes: 3768
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split(), dtype='int')
bad_tower = np.zeros((n), dtype='int')

for i in range(m):
    a, b = map(int, input().split())
    ha = h[a-1]
    hb = h[b-1]

    if ha > hb:
        bad_tower[b-1] = 1
    elif ha < hb:
        bad_tower[a-1] = 1
    elif ha == hb:
        bad_tower[a-1] = 1
        bad_tower[b-1] = 1

ans = n - np.sum(bad_tower)

print(ans)

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

using namespace std;

const int maxn = 100 + 5;

char G[maxn][maxn];

int main() {
  int row, col;
	cin >> row >> col;
	for (int i = 0; i < row; i++) cin >> G[i];
	for (int i = 0; i < col + 2; i++) cout << "#";
	cout << endl;
	for (int i = 0; i < row; i++) {
    cout << "#";
		cout << G[i];
		cout << "#" << endl;
	}
	for (int i = 0; i < col + 2; i++) cout << "#";
	cout << endl;

	return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
D - Gathering Children
https://atcoder.jp/contests/abc136/tasks/abc136_d

"""
import sys


import re

def solve(S):
    ans = []
    for r in re.findall(r'R+L+', S):
        t = [0] * len(r)
        p = r.index('RL')
        x = sum(1 for i in range(p % 2, len(r), 2))
        t[p] = x
        t[p+1] = len(r) - x
        ans.extend(t)
    return ans


def main(args):
    S = input()
    ans = solve(S)
    print(*ans)


if __name__ == '__main__':
    main(sys.argv[1:])


Measured memory_bytes: 7284
s = input()
K = int(input())


def main():
    st = set()

    for i in range(len(s)):
        for j in range(i + 1, min(i + K + 1, len(s) + 1)):
            st.add(s[i:j])

    l = sorted(st)

    print(l[K - 1])
    return


main()


Measured memory_bytes: 4464
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;
  cin >> s;
  string a = "yes";
  int N = s.size();
  
  
  for(int i=0;i<N;i++){
    for(int j=i+1;j<N;j++){
    if(s.at(i)==s.at(j)){
    a = "no";
    }
  }
  }
  
  cout << a <<endl;
}

Measured memory_bytes: 3604
#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i,s,n)for(ll i=s;i<n;i++)
#define rep_r(i,s,n)for(ll i=n-1;i>=s;i--)
#define repe(i,s,n)for(ll i=s;i<=n;i++)
#define repe_r(i,s,n)for(ll i=s;i<=n;i++)
static const ll MOD = 1e9 + 7;

ll s[100];
ll minV = 1 << 21;
int main() {
	ll n; cin >> n;
	ll sum = 0;
	rep(i, 0, n) {
		ll x; cin >> x;
		s[i] = x;
		sum += x;
		if (x % 10 != 0) {
			minV = min(minV, x);
		}
	}
	if (sum % 10 == 0 && minV != 1 << 21) {
		cout << sum - minV << endl;
	}
	else if (sum % 10 == 0 && minV == 1 << 21) {
		cout << 0 << endl;
	}
	else {
		cout << sum << endl;
	}

	return 0;
}

Measured memory_bytes: 256
n, k = map(int, input().split())
sunuke = []
for s in range(n):
    sunuke.append(str(s+1))

for t in range(k):
    d = int(input())
    hito = input().split(" ")
    for u in range(d):
        for v in range(n):
            if hito[u] == sunuke[v]:
                sunuke[v] = 0
            else:
                pass

m = sunuke.count(0)
print(n-m)

Measured memory_bytes: 9192
#include <iostream>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <stack>
#include <assert.h>
#include <bitset>
#define Endl endl
#define mp make_pair
#define ll long long 
#define ull unsigned long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define over(A) {cout<<A<<endl;exit(0);}
#define all(A) A.begin(),A.end()
#define ceil(a,b) ((a-1)/b+1)
#define quickcin ios_base::sync_with_stdio(false);
const int mod=1e9+7;
const int inf=1039074182;
const ll llinf=1LL*inf*inf;
using namespace std;
template <typename T1,typename T2> inline void chmin(T1 &x,T2 b) {if(b<x) x=b;}
template <typename T1,typename T2> inline void chmax(T1 &x,T2 b) {if(b>x) x=b;}
template <typename T1,typename T2> inline void chadd(T1 &x,T2 b) {x+=b;if(x>=mod) x-=mod;}
template <typename T1,typename T2> inline void chmul(T1 &x,T2 b) {x=1LL*x*b%mod;}
template <typename T1,typename T2> inline void chmod(T1 &x,T2 b) {x%=b,x+=b;if(x>=b) x-=b;}
string s;
int n;
int sum[1000005];
int maxch[1000005];

int main()
{
//	freopen("input.txt","r",stdin);
	cin>>s;
	n=s.size();
	string ts=s;
	int mx=0;
	for(int i=0;i<n;i++)
	{
		sum[i]=(i?sum[i-1]:0)+(s[i]=='1'?1:-1);
		chmax(mx,sum[i]);
	}
	int res=inf;
	for(int k=0;k<2;k++)
	{
		s=ts;
		int mx=0;
		for(int i=0;i<n;i++)
		{
			sum[i]=(i?sum[i-1]:0)+(s[i]=='1'?1:-1);
			chmax(mx,sum[i]);
		}
		mx+=k;
		for(int i=n-1;i>=0;i--)
		{
			maxch[i]=min((i==n-1?inf:maxch[i+1]),(mx-sum[i])/2);
		}
		int ss=0;
		for(int i=0;i<n;i++)
		{
			if(s[i]!='?') continue;
			if(ss<maxch[i])
			{
				ss++;
				s[i]='1';
			}
		}
		for(int i=0;i<n;i++)
		{
			if(s[i]=='?') s[i]='0';
		}
		int mn=0;
		for(int i=0;i<n;i++)
		{
			sum[i]=(i?sum[i-1]:0)+(s[i]=='1'?1:-1);
			chmin(mn,sum[i]);
		}
		chmin(res,mx-mn);
	}
	cout<<res<<endl;
	return 0;
}

Measured memory_bytes: 13196
from sys import stdin
from itertools import product


n = int(stdin.readline().rstrip())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    #divisors.sort()
    return divisors
point = 0
for i in range(1,n+1):
    if len(make_divisors(i)) == 8 and i%2 == 1:
        point += 1

print(point)

Measured memory_bytes: 3064
//--------------------------------------//
#include <bits/stdc++.h>
//-------------------------------------//
#define faster               ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ROF(x, y)            for(int i=int(x)-1; i>=int(y); i--)
#define FOR(x, y)            for(int i=int(x); i<int(y); i++)
#define test                 int t; cin >>t; while(t--)
#define strsort(s)           sort(s.begin(), s.end());
#define eofstr               string s; while(cin >>s)
#define cs(i)                printf("Case %d: ", i);
#define eof                  int n; while(cin>>n)
#define Y                    cout <<"YES" <<endl;
#define N                    cout <<"NO" <<endl;
#define noo                  cout <<"-1" <<endl;
#define pi a                 cos(-1)
#define cube(x)              (x*x*x)
#define sqr(x)               (x*x)
#include <algorithm>
//-------------------------------------//
//sort(arr, arr+n, greater<int>());
//get line(c i n, s t r);
//*max_element(x, x+n);
//-------------------------------------//
typedef unsigned long long   ull;
typedef long long int        lld;
typedef long double          ld;
using namespace std;
//------------------------------------//
lld i, j, f, k;

int main()
{
    string s;
    cin >>s;
    int c=0;
    int x[3]= {0};
    j=0;

    for(i=0; i<3; i++)
    {
        if(s[i]=='R')
        {
            f=0;
            c++;
        }
        else
        {
            f=1;
            x[j] = c;
            c=0;
            j++;
        }
    }

    if(f==0)
    {
        x[j] = c;
        c=0;
        j++;
    }

    sort(x, x+3);
    cout <<x[2] <<endl;
}




Measured memory_bytes: 3616
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>


#define INF 4000000000000000000LL
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)


int main(int argc, char** argv)
{
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);

  std::cout << std::fixed << std::setprecision(6);
  std::cerr << std::fixed << std::setprecision(6);

  int A, B;

  std::cin >> A >> B;

  std::cout << std::max(A - B - B, 0) << std::endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
template<class T> inline bool chmin(T&a, T b){if(a > b){a = b; return true;}else{return false;}}
template<class T> inline bool chmax(T&a, T b){if(a < b){a = b; return true;}else{return false;}}
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1.0)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;

int main() {
    int w, a, b;
    cin >> w >> a >> b;
    if(abs(a-b) <= w)cout << 0 << endl;
    else cout << min(abs(b-a-w), abs(a-b-w)) << endl;
}

Measured memory_bytes: 3584
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(signed i=0;i<n;++i)
#define repi(n) rep(i,n)
#define int long long
#define str string
#define vint vector<int>
#define pint pair<int,int>
#define pb(a) push_back(a)
#define all(v) v.begin(),v.end()
#define yn(b) cout<<((b)?"Yes":"No")<<endl
#define YN(b) cout<<((b)?"YES":"NO")<<endl
#define call(a) for(auto t:a)cout<<t<<" ";cout<<endl
#define ENDL printf("\n");
#define debg(a) cout<<#a<<":"<<a<<endl;
#define SORT(a) sort(all(a));
#define INF 1LL<<60
#define inf INF
#define out(i) cout<<i<<endl;
#define allSum(a) accumulate(a.begin(),a.end(),0)
int min(int a,int b){if(a>b)return b;return a;}
int max(int a,int b){if(a>b)return a;return b;}

signed main(){
  int n;
  cin>>n;
  vint a(n);
  rep(i,n)cin>>a[i];
  int res=0,cnt=1;
  rep(i,n-1){
    if(a[i]==a[i+1]){
      cnt++;
    }
    else {
      res+=(cnt/2);
      cnt=1;
    }
  }
  res+=cnt/2;
  out(res);

  return 0;
}



Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
	
	public static void main(String[] args) throws IOException {
		MyScanner sc = new MyScanner();
		PrintWriter out = new PrintWriter(System.out);
		int A = sc.nextInt() * 60 + sc.nextInt();
		int B = sc.nextInt() * 60 + sc.nextInt();
		out.println(B - A -sc.nextInt());
		
		out.flush();
	}
	
	static class MyScanner {
		private BufferedReader br;
		private StringTokenizer tokenizer;
		
		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		
		public int nextInt() {
			return Integer.parseInt(next());
		}
		
		public long nextLong() {
			return Long.parseLong(next());
		}
	}
}


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

int main(){
	/*input*/
	int n;	cin >> n;
	vector<char>s(n);
	for(int i = 0; i < n; i++){
		cin >> s[i];
	}
	/*calculation*/
	bool flag = true;	//true:Three false:Four
	for(int i = 0; i < n; i++){
		if(s[i] == 'Y')flag = false;
	}
	/*output*/
	if(flag){
		cout << "Three" << endl;
	}else{
		cout << "Four" << endl;
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i <= (n); i++)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((int)(x).size())
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000 //10^12
#define MOD 10000007      //10^9+7
#define root sqrt
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vs = vector<string>;
using ll = long long;
// vector入力
template <typename T>
istream &operator>>(istream &is, vector<T> &vec)
{
  for (T &x : vec)
    is >> x;
  return is;
}
// vector出力
template <typename T>
ostream &operator<<(ostream &os, vector<T> &vec)
{
  // os << '{';
  for (int i = 0; i < vec.size(); i++)
  {
    os << vec[i] << (i + 1 == vec.size() ? "" : ' ');
  }
  // os << '}';
  return os;
}

int main()
{
  int r;
  cin >> r;
  double ans = 3.141592648777698869248;
  printf("%.10lf\n", r * 2 * ans);
}


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

int main(){
	int n;
	cin >> n;
	int h[n] = {};
	REP(i,n) cin >> h[i];
	int res = h[0];
	REP(i,n - 1){
		if(h[i + 1] > h[i])res += h[i + 1] - h[i];
	}
	cout << res << endl;
}

Measured memory_bytes: 256
from collections import deque
H, W, K = map(int, input().split())
T = [list(input().strip()) for _ in range(H)]

A = [[0] * W for _ in range(H)]
cnt = 0
sharp = [True if '#' in T[i] else False for i in range(H)]
for i in range(H):
    ext = False
    for j in range(W):
        if sharp[i]:
            if (ext == False) & (T[i][j]=='.'):
                A[i][j] = cnt+1
            elif T[i][j] == '#':
                cnt += 1
                A[i][j] = cnt
                ext = True
            else:
                A[i][j] = cnt

k = 0 
li = [i for i in range(H) if sharp[i]]
trs = [i for i in range(H)]
for i in range(li[0]):
    trs[i] = li[0]
now = li[0]
for i in range(li[0], H):
    if sharp[i]:
        now = i
    else:
        trs[i] = now
    

for i in range(H):
    if sharp[i]:
        pass
    else:
        A[i] = A[trs[i]]


for i in range(H):
    print(*A[i])

Measured memory_bytes: 8648
#include <bits/stdc++.h>
using namespace std;
 
using ll=long long;
 
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define pb push_back
#define eb emplace_back
#define a first
#define b second
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
const ll MOD = 1e9 + 7;

int main() {
    int n; cin >> n;
    vector<vector<string>> ds(n+1);
    ds[1].push_back("a");
    for (int i = 2; i <= n; ++i) {
        vector<vector<string>> ds2(n+1);
        for (int j = 1; j < i; ++j) {
            for (auto& s :ds[j]) {
                for (int k = 0; k <= j; ++k) {
                    char t = 'a' + k;
                    int ij = j + (k == j); 
                    ds2[ij].emplace_back(s + t); 
                }
            }
        }
        swap(ds, ds2); 
    }
    vector<string> ret;
    rng(i,1, n+1) ret.insert(ret.end(), ds[i].begin(), ds[i].end());
    sort(all(ret));
    for (auto& s : ret) cout << s << endl; 
    
    return 0;
}

Measured memory_bytes: 10232
/*⠄⢰⣧⣼⣯⠄⣸⣠⣶⣶⣦⣾⠄⠄⠄⠄⡀⠄⢀⣿⣿⠄⠄⠄⢸⡇⠄⠄
⠄⠄⠄⣾⣿⠿⠿⠶⠿⢿⣿⣿⣿⣿⣦⣤⣄⢀⡅⢠⣾⣛⡉⠄⠄⠄⠸⢀⣿⠄
⠄⠄⢀⡋⣡⣴⣶⣶⡀⠄⠄⠙⢿⣿⣿⣿⣿⣿⣴⣿⣿⣿⢃⣤⣄⣀⣥⣿⣿⠄
⠄⠄⢸⣇⠻⣿⣿⣿⣧⣀⢀⣠⡌⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠿⠿⣿⣿⣿⠄
⠄⢀⢸⣿⣷⣤⣤⣤⣬⣙⣛⢿⣿⣿⣿⣿⣿⣿⡿⣿⣿⡍⠄⠄⢀⣤⣄⠉⠋⣰
⠄⣼⣖⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⢇⣿⣿⡷⠶⠶⢿⣿⣿⠇⢀⣤
⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣽⣿⣿⣿⡇⣿⣿⣿⣿⣿⣿⣷⣶⣥⣴⣿⡗
⢀⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠄
⢸⣿⣦⣌⣛⣻⣿⣿⣧⠙⠛⠛⡭⠅⠒⠦⠭⣭⡻⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠄
⠘⣿⣿⣿⣿⣿⣿⣿⣿⡆⠄⠄⠄⠄⠄⠄⠄⠄⠹⠈⢋⣽⣿⣿⣿⣿⣵⣾⠃⠄
⠄⠘⣿⣿⣿⣿⣿⣿⣿⣿⠄⣴⣿⣶⣄⠄⣴⣶⠄⢀⣾⣿⣿⣿⣿⣿⣿⠃⠄⠄
⠄⠄⠈⠻⣿⣿⣿⣿⣿⣿⡄⢻⣿⣿⣿⠄⣿⣿⡀⣾⣿⣿⣿⣿⣛⠛⠁⠄⠄⠄
⠄⠄⠄⠄⠈⠛⢿⣿⣿⣿⠁⠞⢿⣿⣿⡄⢿⣿⡇⣸⣿⣿⠿⠛⠁⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠉⠻⣿⣿⣾⣦⡙⠻⣷⣾⣿⠃⠿⠋⠁⠄⠄⠄⠄⠄⢀⣠⣴
⣿⣿⣿⣶⣶⣮⣥⣒⠲⢮⣝⡿⣿⣿⡆⣿⡿⠃⠄⠄⠄⠄⠄⠄⠄⣠⣴⣿*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ll long long
#define ii pair<ll,ll>
#define iii pair<ii,ll>
#define fi first
#define se second
#define endl '\n'
#define debug(x) cout << #x << " is " << x << endl;

#define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()

ll MAX(ll a){return a;}
ll MIN(ll a){return a;}
template<typename... Args>
ll MAX(ll a,Args... args){return max(a,MAX(args...));}
template<typename... Args>
ll MIN(ll a,Args... args){return min(a,MIN(args...));}

#define indexed_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>

mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	int arr[5];
	
	rep(x,0,5){
		cin>>arr[x];
		if (arr[x]==0){
			cout<<x+1;
			return 0;
		}
	}
}


Measured memory_bytes: 3616
using System;
public class Hello{
    public static void Main(){
        string[] input = Console.ReadLine().Split(' ');
        int[] num = new int[3];
        
        for(int x = 0;x < 3;x++){
            num[x] = int.Parse(input[x]);
        }
        for(int y = 0;y < 2;y++){
            for(int z = y + 1;z < 3;z++){
                if(num[y] == num[z]){
                    Console.WriteLine(num[3 - y - z]);
                    break;
                }
            }
        }
    }
}


Measured memory_bytes: 13140
A,B,C,D,E,F = map(int, input().split())
q = int(input())

for i in range(q):
    x, y = map(int, input().split())
    while A != x:
        A,B,C,D,E,F = D,B,A,F,E,C #E
        if A == x:
            break
        A,B,C,D,E,F = B,F,C,D,A,E #N
    while B != y:
        A,B,C,D,E,F = A,C,E,B,D,F #R
    print(C)

Measured memory_bytes: 7688
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
#from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
#from math import floor, ceil
#from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
#inf = 10**17
#mod = 10**9 + 7
n,m,c=MI()
B=LI()
ans=0
for i in range(n):
    A=LI()
    sm=c
    for j in range(m):
        sm+=A[j]*B[j]
    if sm>0:
        ans+=1
print(ans)
    

Measured memory_bytes: 3316
#include<iostream>
#include<string>
using namespace std;
long int b[100000];
long int d[100000];

int main(){
	int a[100000];
	int i,n=6,max=0,k,c=1,x=0,j,max1=0;

	string mozi;
	
	cin >> n >> k;

	cin >> mozi;

	

	for (i = 0; i < n; i++) {
		a[i]=(int(mozi[i]-48));
	
    }




	for (i = 1; i < n; i++) {
		if (a[i - 1] == a[i]) {
			c++;

		}
		else {
			b[x] = c;
				c = 1;
				x++;
		}
	}

	b[x] = c;


	if (a[n - 1] == 0) {
		b[x + 1] = 0;
		x++;
	}

	if (a[0] == 0) {
		d[0] = 0;

		for (i = 0; i < x+1; i++)
			d[i + 1] = b[i];
		x++;
		for (i = 0; i < x+1; i++)
			b[i] = d[i];
	}
	
	
	if (x / 2 <= k)
		max = n;
	else {
		for (i = k; i <= (x -k); i += 2) {
			for (j = i - k; j <= i + k; j++)
				max1 = max1 + b[j];


			if (max < max1)max = max1;
			max1 = 0;
		}
	
	
	
	}




		cout << max << "\n";


	
	
	//cout << max;
	


	return 0;
	}



Measured memory_bytes: 2432
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::*;
use std::str::FromStr;

#[allow(unused_macros)]
macro_rules! debug {($($a:expr),*) => {println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);}}
#[allow(unused_macros)]
macro_rules! input {(source=$s:expr,$($r:tt)*) => {let mut iter=$s.split_whitespace(); let mut next=||{iter.next().unwrap()}; input_inner! {next,$($r)*}};($($r:tt)*) => {let stdin=std::io::stdin();let mut bytes=std::io::Read::bytes(std::io::BufReader::new(stdin.lock())); let mut next=move||->String{bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect()}; input_inner! {next,$($r)*}};}
#[allow(unused_macros)]
macro_rules! input_inner {($next:expr) => {}; ($next:expr,) => {}; ($next:expr,$var:ident:$t:tt$($r:tt)*) => {let $var=read_value!($next,$t); input_inner! {$next$($r)*}};}
#[allow(unused_macros)]
macro_rules! read_value {($next:expr,($($t:tt),*)) => {($(read_value! ($next,$t)),*)}; ($next:expr, [$t:tt; $len:expr]) => {(0..$len).map(|_|read_value! ($next,$t)).collect::<Vec<_>>()}; ($next:expr,chars) => {read_value! ($next,String).chars().collect::<Vec<char>>()}; ($next:expr,usize1) => {read_value! ($next,usize)-1}; ($next:expr,$t:ty) => {$next().parse::<$t>().expect("Parse error")};}

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);
impl<T: PartialEq> Eq for Total<T> {}
impl<T: PartialOrd> Ord for Total<T> {
    fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering {
        self.0.partial_cmp(&other.0).unwrap()
    }
}

#[allow(dead_code)]
const MAX: usize = 100006;
#[allow(dead_code)]
const INF_U32: u32 = 1 << 31;
#[allow(dead_code)]
const INF_I32: i32 = 1 << 30;
#[allow(dead_code)]
const INF_U64: u64 = 1 << 63;
#[allow(dead_code)]
const INF_I64: i64 = 1 << 62;
#[allow(dead_code)]
const MOD: i64 = 1e9 as i64 + 7;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

#[allow(unused_imports)]
use std::f64;


fn main() {
    input!{n:usize, a:[i64;n]};
    let mut x:i64 = 0i64;
    let mut y:i64 = a.iter().sum::<i64>();
    let mut ans:i64 = a.iter().map(|&t| t.abs()).sum::<i64>();
    for i in 0..n-1 {
        x += a[i];
        y -= a[i];
        ans = min(ans, (x-y).abs());
        //debug!(ans, x, y);
    }
    println!("{}", ans);
}

Measured memory_bytes: 6396
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#include <cctype>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define INF (2 << 28)
#define fr first
#define sc second
using namespace std;

typedef long long ll;
typedef pair<int, int> iP;

int sum[1100000];

int main(){

  int n, cnt = 0;

  for(int i = 0; i <= 1000; i++) {
    for(int j = 0; j <= 1000; j++) {
      sum[cnt++] = i + j;
    }
  }

  sort(sum, sum + cnt);
  while(cin >> n){
    int res = 0;
    for(int i = 0; i <= n; i++) {
      res += (upper_bound(sum, sum + cnt, n - i) - lower_bound(sum, sum + cnt, n - i)) *
        (upper_bound(sum, sum + cnt, i) - lower_bound(sum, sum + cnt, i));
    }
    cout << res << endl;
  }
}

Measured memory_bytes: 5268
//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error("\n");
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr("time : " + end + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function makeClone(obj){return JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  var returnObj = {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException ‚There is no more input";}else{var returnInput = this.list[this.index++];return returnInput;}}
  };
  return returnObj;
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var N = nextInt();
  myout(N * N * N);
}

Measured memory_bytes: 30948
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <algorithm>
#include <stack>
#include <string>
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
using ll = long long ;
ll MOD=1e9+7;
string s;
int lsum=0;
ll dp(ll x,ll sum,ll nowsum){
    if(x==s.size()){
        return sum+nowsum;
    }else{
        return dp(x+1,sum,nowsum*10+(s[x]-'0'))+dp(x+1,sum+nowsum,0);
    }
}
int main()
{
    cin >> s;
    cout<<dp(0,0,0)<<endl;
    
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int window = sc.nextInt();
        int curtain = sc.nextInt();
        if (window <= (curtain * 2) ) {
            System.out.println(0);
        } else {
            System.out.println(window - (curtain * 2));
        }
    }
}


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

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount

using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
typedef pair<int,ll> pil;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;

template <typename T> T id(T b) {return b;};
template <class It> bool all(It f,It l){return std::all_of(f,l,id<bool>);}
template <class It> bool any(It f,It l){return std::any_of(f,l,id<bool>);}
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}

const int MAX_N = 10, MAX_D = 10;
int n,d;
int x[MAX_N][MAX_D];

int main()
{
#ifdef FASTIO
  ios_base::sync_with_stdio(false); cin.tie(nullptr);
#endif

  cin >> n >> d;
  forn(i,n) {
    forn(j,d) cin >> x[i][j];
  }

  int c = 0;
  forn(i,n) for (int j = i+1; j < n; j++) {
    if (i == j) continue;
    int total = 0;
    forn(k,d) {
      int d = abs(x[i][k]-x[j][k]);
      total += d*d;
    }

    for (int i = 1; i*i <= 200000; i+=1) {
      if (i*i == total) c++;
    }
  }

  cout << c << endl;


  return 0;
}


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

l = [0]*(10**5+1)
for i in a:
    l[i] += 1
ans = 0
for i in range(10**5-1):
    ans = max(ans, l[i]+l[i+1]+l[i+2])
print(ans)





Measured memory_bytes: 20720