akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef map<int, int> mi;
typedef set<int> si;
#define VV(T) vector<vector< T > >
#define dump(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl

#define rep(i, n) REP(i, 0, n)                              // 0, 1, ..., n-1
#define REP(i, x, n) for(int i = x; i < n; i++)             // x, x + 1, ..., n-1
#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(v) (v).begin() , (v).end()
#define RALL(v) (v).rbegin(), (v).rend()

#define pb push_back
#define pu push
#define mp make_pair
#define fi first
#define sc second

#define COUT(x) cout << (x) << endl
#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define VECCOUT(x) for(auto&youso_: (x) )cout<<youso_<<" ";cout<<endl

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


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

    int N, M; cin >> N >> M;
    vector<int> imos(N + 1, 0);
    rep(i, M) {
        int l, r; cin >> l >> r;
        l--; r--;
        imos[l]++; imos[r + 1]--;
    }
    rep(i, N) {
        imos[i + 1] += imos[i];
    }
    int ans = 0;
    rep(i, N) {
        if(M == imos[i]) ans++;
    }
    COUT(ans);
}

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

using namespace std;


int main() {
        int count = 0;
        string s;
        cin >> s;
        long long int cnt=0,ans=0;
        //int last_ia=-1;
        int n = s.length();
        for(int i=0;i<n;i++){
            if(s[i]=='A')++cnt;
            else if(s[i]=='B'){
                if(i+1<n&&s[i+1]=='C'){
                 ans+=cnt;
                  ++i;}
                else
                  cnt=0;
            }
          else cnt=0;
        }
     cout << ans;    
    
}

Measured memory_bytes: 640
#pragma region template 2.4
#include <bits/stdc++.h>
using namespace std;
template <typename T>
using pq_asc = priority_queue<T, vector<T>, greater<T>>;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REP1(i, n) for (ll i = 1; i <= (n); ++i)
#define FOR(i, a) for (auto &i : a)
#define CH(f, x, y) x = f(x, y)
#define IN(T, x) \
    T x;         \
    cin >> x;
#define AIN(T, a, n) \
    vector<T> a(n);  \
    FOR(i, a)        \
    cin >> i;
#define A2IN(T1, a, T2, b, n) \
    vector<T1> a(n);          \
    vector<T2> b(n);          \
    REP(i, n)                 \
    cin >> a[i] >> b[i];
#define OUT(x) cout << (x) << endl;
#define FOUT(x) cout << fixed << setprecision(15) << (x) << endl;
#define ALL(a) (a).begin(), (a).end()
#define SORT(a) sort(ALL(a))
#define RSORT(a) \
    SORT(a);     \
    reverse(ALL(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define DUMPA(a)          \
    cout << #a << " = {"; \
    JOUT(ALL(a), ", ", cout) << "}" << endl;

template <typename T>
ostream &JOUT(T s, T e, string sep = " ", ostream &os = cout)
{
    if (s != e)
    {
        os << *s;
        ++s;
    }
    while (s != e)
    {
        os << sep << *s;
        ++s;
    }
    return os;
}

ostream &YES(bool cond, string yes = "Yes", string no = "No", ostream &os = cout)
{
    if (cond)
    {
        os << yes << endl;
    }
    else
    {
        os << no << endl;
    }
    return os;
}

template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p)
{
    os << '(' << p.first << ", " << p.second << ')';
    return os;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v)
{
    os << '[';
    JOUT(ALL(v), ", ", os) << ']';
    return os;
}

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
#pragma endregion template

int main()
{
    IN(ll, H);
    IN(ll, N);
    A2IN(ll, A, ll, B, N);
    vi dp(H + 1, INF);
    dp[0] = 0;
    REP(i, N)
    {
        REP(j, H + 1)
        {
            CH(min, dp[min(H, j + A[i])], dp[j] + B[i]);
        }
    }
    OUT(dp[H]);
}

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

using ll = long long;
const ll MOD = 1e9 + 7;

int main() {
    string S, ans = "Yes\n";
    cin >> S;
    int n = S.size();
    if (n % 2) {
        ans = "No\n";
    } else {
        rep(i, n / 2) {
            if (S.substr(i * 2, 2) != "hi") ans = "No\n";
        }
    }
    cout << ans;
}

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

typedef long long ll;
ll MOD = 1000000007;

template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
vector.erase(vector.begin() + index);
}

int main(){
  ll N,K;
  cin >> N >> K;
  ll A = N / K;
  ll B = 0;
  if(K % 2 == 0){
    B = (N / (K/2)) - A; 
  }
  cout << A * A * A + B * B * B << endl;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  int n;
  cin >> n;
  long a[n+1];
  long b[n];
  long sum = 0;
  int i;
  for(i=0;i<n+1;i++){
    cin >> a[i];
    sum += a[i];
  }
  for(i=0;i<n;i++){
    cin >> b[i];
  }
  for(i=0;i<n;i++){
    if(a[i] >= b[i]) a[i] -= b[i];
    else{
      b[i] -= a[i];
      a[i] = 0;
      if(b[i] <= a[i+1]) a[i+1] -= b[i];
      else a[i+1] = 0;
    }
    
  }
  
  for(i=0;i<n+1;i++){
   sum -= a[i];
  }
  
  
  
      
      
      
      
  cout << sum;
}



Measured memory_bytes: 1792
using System;

namespace ABC086C
{

    class Program
    {
        static void Main(string[] args)
        {
            int[] t = new int[100000];
            int[] x = new int[100000];
            int[] y = new int[100000];
            int N = int.Parse(Console.ReadLine());
            for(int i = 0; i < N; i++){
                var str = Console.ReadLine().Split(' ');
                t[i] = int.Parse(str[0]);
                x[i] = int.Parse(str[1]);
                y[i] = int.Parse(str[2]);
            }
            Boolean f = true;
            for(int i = 0; i < N; i++){
                f = atdeer(0,0,0,t[i], x[i], y[i]);
                if (!f) break;
            }

            if (f) Console.WriteLine("Yes"); else  Console.WriteLine("No");
        }
        public static Boolean atdeer(int t1,int x1,int y1, int t2,int x2,int y2){
            int distance = Math.Abs(x1+y1-(x2+y2));
            int time = t2-t1;
            if(distance > time) return false;
            if ( (distance % 2) == (time % 2) ) return true;
            return false;  
        }
   }
}


Measured memory_bytes: 16200
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <bitset>
#include <utility>
#include <cstring>
#include <numeric>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pair<int,int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
#define rep(i,n) for(int i=0;i<n;i++)
#define repll(i,n) for(long long int i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define P 1000000007
#define STI(s) atoi(s.c_str())//string to int
#define mp(p,q) make_pair(p,q)
#define Sort(a) sort(a.begin(),a.end())
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;}
const int INF = INT_MAX;
const long long LLINF = 1LL<<60;
template <typename T_char>
char ToUpper (char cX) { return toupper(cX); }
//g++ -std=c++1z temp.cpp
//./a.exe
ll digit(ll a){
    ll count = 0;
    for (ll i = 0; i < a; i++)
    {   if (a == 0)
        {
            break;
        }else
        {
            a = a/10;
            count++;
        }
    }
    return count;
}
//桁数のカウント
//pow(x,n) == x^n
//sum = accumulate(v.begin(),v.end(),0);
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a,   b) * b;}



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

int n;
cin >> n;
if(n/100 == 7 || (n%100)/10 == 7 || n%10 == 7){
    cout << "Yes" << endl;
    return 0;
}else{
    cout << "No" << endl;
}


//////////////////////////////////////////////////////
return 0;}

Measured memory_bytes: 3648
N = int(input())
H = list(map(int,input().split()))

ans = 0
tmp = 0
for n in range(N-1):
  l = H[n]
  r = H[n+1]
  if l >= r:
    tmp += 1
  else:
    ans = max(ans,tmp)
    tmp = 0

ans = max(ans,tmp)
print(ans)
  


Measured memory_bytes: 14252
#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

#define int long long
#define MOD 998244353

int mpow(int a, int b)
{
    int ans = 1;
    while (b != 0)
    {
        if (b & 1)
        {
            ans = (ans * a) % MOD;
        }
        a = a * a % MOD;
        b >>= 1;
    }
    return ans;
}

vector<int> frac(2e5 + 1);
void make_frac()
{
    frac[0] = 1;
    for (int i = 1; i < frac.size(); i++)
    {
        frac[i] = frac[i - 1] * i % MOD;
    }
}

int comb(int a, int b)
{
    if (b == 0 || b == a)
        return 1;
    int ans = frac[a];
    ans *=mpow(frac[b], MOD - 2);
    ans %= MOD;
    ans *=mpow(frac[a - b], MOD - 2);
    ans %= MOD;
    return ans;
}

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

    make_frac();

    //dp[n][k] => M * (M-1)^(N-1-k) N-1Ck
    int ans = 0;
    vector<int> Mpow(N, 1);
    for (int i = 1; i < N; i++)
    {
        Mpow[i] = Mpow[i - 1] * (M - 1);
        Mpow[i]%=MOD;
    }

    for (int i = 0; i <= K; i++)
    {
        int tmp_ans = M * Mpow[N - 1 - i] % MOD;
        tmp_ans =tmp_ans * comb(N - 1, i) % MOD;
        ans += tmp_ans;
        ans %= MOD;
        //cout << ans <<endl;
    }

    cout << ans << endl;
}

Measured memory_bytes: 6428
#define rep(i,n) for (int i = 0; i < n; i++)
#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <math.h>
#include <complex>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> p;
typedef complex<double> com;
const int mod = 1e9 + 7;
const int MOD = 998244353;
const int inf = 2e9;
const ll INF = 1e18;


int main() {
	int n, m;
	cin >> n >> m;
	vector<int> a(n);
	rep(i, n) {
		cin >> a[i];
	}
	sort(a.begin(), a.end());
	vector<vector<int>> dp(n);
	rep(i, n) {
		dp[i].resize(m + 1);
	}
	rep(i, m+1) dp[0][i] = i % a[0];
	rep(i, n-1) {
		rep(j, m + 1) {
			dp[i + 1][j] = 1LL*dp[i][j] * (i+1) % mod + dp[i][j%a[i + 1]];
			dp[i + 1][j] %= mod;
		}
	}
	cout << dp[n - 1][m] << endl;
	return 0;
}


Measured memory_bytes: 78592
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class CAntiDivision {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long a = in.nextLong(), b = in.nextLong(), c = in.nextLong(), d = in.nextLong();

            long answer = 0;

            long cd = (c * d) / NumberTheory.gcd(c, d);
            answer += (b - (a - 1));
            answer -= (b / c - (a - 1) / c);
            answer -= (b / d - (a - 1) / d);
            answer += (b / cd - (a - 1) / cd);

            out.println(answer);
        }

    }

    static class NumberTheory {
        public static long gcd(long a, long b) {
            long c;
            while (a != 0) {
                c = a;
                a = b % a;
                b = c;
            }
            return b;
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}



Measured memory_bytes: 22740
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef pair<int, int> pii;  // pair<int, int> に pii という別名を付ける
typedef long long ll;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  int a;
  a = N % 2 ;
  N = N / 2;
  cout << N + a << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
const double PI = 3.14159265358979323846;

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int ab = a*b;
  int cd = c*d;
  if(ab >= cd) cout << ab << endl;
  else cout << cd << endl;
}

Measured memory_bytes: 3620
#include <stdio.h>
#include <string.h>
char s[105],t[105];
int f(int i)
{
	int j,flag=0;
	int n=strlen(s);
	for(j=0;j<n;j++)
	{
		if(s[i]==t[j])
		{
			i++;
			if(i==n) i=0;
		}
		else 
		{flag=1;break;}
	}
	if(flag) return 0;
	else return 1;
}
int main()
{
	int i,n,j=1;
	scanf("%s%s",s,t);
	n=strlen(s);
	for(i=0;i<n;i++)
	{
		if(f(i))
		{
			j=0;
			printf("Yes\n");
			break;
		}
	}
	if(j) printf("No\n");
	return 0;
}

Measured memory_bytes: 128
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        String s, p;
        s = input.readLine();
        if (s != null && s.length() > 0 && s.length() <= 100) {
            p = input.readLine();
            if (p != null && p.length() > 0 && p.length() <= s.length()) {
                s += s.substring(0, s.length() - 1);
                System.out.println(
                    s.indexOf(p) == -1? "No": "Yes"
                );
            }
        }
    }
}

Measured memory_bytes: 24296
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
  int N;
  cin >> N;
  vector<int> a(N);
  for(int i = 0; i < N; i++){
    cin >> a.at(i);
  }
  sort(a.begin(), a.end());
  cout << a.back() - a.front();
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int H,W;
  cin >> H >> W;
  vector<char> vec(W);
  
  for(int i=0; i<W+2; i++){
    cout << '#';
  }
  
  cout << endl;
  
  for(int i=0; i<H; i++){
    cout << '#';
    for(int l=0; l<W; l++){
      cin >> vec.at(l);
    }
    for(int l=0; l<W; l++){
      cout << vec.at(l);
    }
    cout << '#' << endl;
  }
   for(int i=0; i<W+2; i++){
    cout << '#';
  }
  
  cout << endl; 
}

Measured memory_bytes: 256
N = int(input())
a = list(map(int, input().split()))
d = {-1:0,max(a)+1:0}
num_X = 0
for i in range(max(a)+1):
    d[i] = 0
for i in a:
    d[i] += 1
for i in range(max(a)+1):
    num_X = max(num_X,d[i-1]+d[i]+d[i+1])
print(num_X)


Measured memory_bytes: 19700
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
#define show(a, n) rep(i,n) {cout<<a[i]<<' ';} cout<<endl;

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<long long, long long> pll;

const int INF = 1 << 30;
const long long INFL = 1LL << 62;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 100000;

int main() {
	int n, q;
	string s;
	cin >> n >> q >> s;
	int c[N + 1];
	c[0] = c[1] = 0;
	for(int i = 1; i <= n - 1; i++) {
		if(s[i - 1] == 'A' && s[i] == 'C') {
			c[i + 1] = c[i] + 1;
		}
		else {
			c[i + 1] = c[i];
		}
	}
	int ans[N];
	rep(i, q) {
		int l, r;
		cin >> l >> r;
		ans[i] = c[r] - c[l - 1];
		if(c[l] == c[l - 1] + 1) {
			ans[i]--;
		}
	}
	rep(i, q) cout << ans[i] << endl;
}


Measured memory_bytes: 1792
use std::io::prelude::*;

fn input<T>() -> T
where
    T: std::str::FromStr,
{
    let stdin = std::io::stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}

fn main() {
    let n: usize = input();
    let d: usize = input();
    let x: Vec<Vec<i64>> = (0..n).map(|_| (0..d).map(|_| input()).collect()).collect();

    let mut ans = 0i64;
    for i in 0..n - 1 {
        for j in i + 1..n {
            let s: i64 = (0..d)
                .map(|k| (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]))
                .sum();
            let mut ok = false;
            for k in 0..s + 1 {
                if k * k > s {
                    break;
                }
                if k * k == s {
                    ok = true;
                    break;
                }
            }
            if ok {
                ans += 1;
            }
        }
    }

    println!("{}", ans);
}


Measured memory_bytes: 4352
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Calc c = new Calc();
		c.abc119C();
	}
}

class Calc{
	int N,A,B,C,INF=(int)Math.pow(10, 9);
	int[] L;
	void abc119C() {
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		A = sc.nextInt();
		B = sc.nextInt();
		C = sc.nextInt();
		L = new int[N];
		for(int i=0 ; i < N ; i++) {
			L[i] = sc.nextInt();
		}
		System.out.println( dfs(0,0,0,0) );
	}
	
	int dfs(int i, int a, int b, int c) {
		if(i == N) {
			if(a>0 && b>0 && c>0) {
				return Math.abs(a-A) + Math.abs(b-B) + Math.abs(c-C) - 30;
			}else {
				return INF;
			}
		}
		int ret0 = dfs(i+1, a, b, c);
		int ret1 = dfs(i+1, a+L[i], b, c) + 10;
		int ret2 = dfs(i+1, a, b+L[i], c) + 10;
		int ret3 = dfs(i+1, a, b, c+L[i]) + 10;
		return Math.min(Math.min(Math.min(ret0, ret1), ret2), ret3);
	}
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define f(i,a,b) for(int i=a;i<b;i++)
#define fin for(int i=0;i<n;i++)
#define pi pair<int,int>
#define pb push_back
#define mp make_pair
#define endl '\n'
#define fi first
#define se second

void solve(){
  int x;
  cin>>x;
  if(x) cout<<"0"<<endl;
  else if(x == 0) cout<<"1"<<endl;
 
}

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int t = 1;
    while(t--) solve();
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std; 
using ll = long long;
ll gauss(ll i){
	return i*(i+1)/2;
}
ll MOD = 1e9+7;
signed main() { 
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	ll n, k; 
	cin>>n>>k;
	ll tot = 0;
	for(int i = k; i <= n+1; i++){
		ll min = gauss(i-1);
		ll max = gauss(n) - gauss(n-i);
		tot = (tot + (max-min+1)) % MOD;
	}

	cout << tot;
}


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

int main(){
	int count = 0;
	vector<int> A(3);
	rep(i,3) cin >> A[i];
	sort(A.begin(),A.end());
	while(A[1]!= A[2]){
		A[0]++;
		A[1]++;
		count++;
	}
	while(A[0] != A[1]){
		A[0] += 2;
		count++;
		if(A[0] > A[1]){
			count++;
			break;
		}
	}
	cout << count << endl;
}

Measured memory_bytes: 256
N, K, Q = map(int, input().split())

player = []
for j in range(N):
    player.append(0)
# print(player)

winner = []
for i in range(Q):
    winner.append(input())
    winner[i] = int(winner[i])
# print(winner[0])

for k in range(len(winner)):
    player[winner[k]-1] += 1
    
for m in range(len(player)):
    player[m] = K-Q+player[m]
# print(player)

for n in range(len(player)):
    if player[n] <= 0:
        print('No')
    elif player[n] > 0:
        print('Yes')

Measured memory_bytes: 11800
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>

using namespace std;

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

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

    vector<int> nums(n);
    rep(i, n){
        cin >> nums[i];
        nums[i] -= (i+1);
    }

    sort(nums.begin(), nums.end());

    int b = nums[n/2];

    long long out = 0;
    rep(i, n) out += abs(nums[i] - b);

    cout << out << endl;
}

Measured memory_bytes: 1024
/*
1: . , ! ? (????????????)
2: a b c
3: d e f
4: g h i
5: j k l
6: m n o
7: p q r s
8: t u v
9: w x y z
*/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;

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

  vector<int> v[9];
  int cnt=0;
  v[0].push_back('.');v[0].push_back(',');v[0].push_back('!');v[0].push_back('?');v[0].push_back(' ');
  for(int i=1;i<=5;i++){
      for(int j=0;j<3;j++){
          v[i].push_back('a'+cnt);
          cnt++;
      }
  }
  v[6].push_back('p');v[6].push_back('q');v[6].push_back('r');v[6].push_back('s');
  v[7].push_back('t');v[7].push_back('u');v[7].push_back('v');
  v[8].push_back('w');v[8].push_back('x');v[8].push_back('y');v[8].push_back('z');

  int n;
  cin >> n;
  string s;
  for(int i=0;i<n;i++){
      string res="";
    cin >> s;
    int pre=0,num=0;
    for(int j=0;j<(int)s.length();j++){
      if(s[j]=='0'){
          if(num==0&&pre==0) continue;
          res.push_back(v[pre-1][num%(v[pre-1].size())]);
          //cout<<res<<endl;
          num=0;pre=0;
      }
      else{
          if(pre) num++;
          else pre=(s[j]-'0');
      }
    }
    cout<<res<<endl;
  }
}

Measured memory_bytes: 3160
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <functional> 
#include <vector>
 
using namespace std;
 
int main(){
 
    string a;
    string b;
 
    cin >> a;
    cin >> b;
 
    if((a[0] == b[2] && a[2] == b[0]) && a[1] == b[1]){
        cout << "YES";
    }else {
        cout << "NO";
    }
 
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cstring>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <algorithm>
#include <functional>
#include <iomanip>
using namespace std;

#define LL long long
const int maxn = 100000 + 100;
int n;
LL tmp;
LL num[maxn], ans[maxn];

int main() {
    ios::sync_with_stdio(false);

    while(scanf("%d", &n) != EOF) {
        for(int i = 0; i < n; ++i) {
            scanf("%lld", &num[i]);
        }
        tmp = 0;
        int f = 1;
        for(int i = n - 1; i >= 0; --i) {
            tmp += f * num[i];
            f *= -1;
        }
        tmp /= 2;
        for(int i = 0; i < n; ++i) {
            int Pre = (i - 1 + n) % n;
            ans[i] = tmp * 2;
            num[i] -= tmp;
            num[Pre] -= tmp;
            tmp = num[i];
        }
        for(int i = 0; i < n; ++i) {
            if(i != 0) {
                printf(" ");
            }
            printf("%lld", ans[i]);
        }
        printf("\n");
    }

    return 0;
}

Measured memory_bytes: 2944
import itertools as it

n, k = map(int, input().split())
vs = [int(s) for s in input().split()]
vs_acc = [0] + list(it.accumulate(vs))
vs_total = vs_acc[-1]

ans = 0
for left in range(min(n, k) + 1):
    for right in range(min(n, k) - left + 1):
        cnt = k - (left + right)
        remaining = vs_acc[n - right] - vs_acc[left]
        subsum = vs_total - remaining

        rest = sorted(vs[:left] + vs[n - right :])[:cnt]
        for x in rest:
            if x < 0:
                subsum -= x
            else:
                break
        ans = max(ans, subsum)

print(ans)



Measured memory_bytes: 3064
using namespace std;
using ll=long long;
#include <string>
#include <vector>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <map>
#define out(S) cout<<(S)<<endl;
#define mod(i) ((i)%(ll)(1000000000 + 7))
ll modpow(ll i, ll j) { ll tmp = 1; while (j) { if (j % 2)tmp = mod(tmp*i); i = mod(i*i); j /= 2; }return tmp; }
#define divmod(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define For(i,a,b) for(size_t i=(a);i<(b);i++)
#define rFor(i,a,b) for(size_t i=(a)-1;i>=(b);i--)
#define Rep(i,a) for(size_t i=0;i<(a);i++)
#define rRep(i,a) for(size_t i=(a)-1;i>=0;i--)
#define Foreach(item,collection) for(auto item:collection)

vector<int> makeFactor(int x) {
	vector<int> factors;
	factors.push_back(2);
	for (size_t i = 3; i <= sqrt(x); i+=2)
	{
		bool flag = false;
		Foreach(item, factors) if (i%item == 0) { flag = true; break; }
		if (!flag) factors.push_back(i);
	}
	return factors;
}

int main(){
	int x;
	cin >> x;
	if (x < 1200) { out("ABC") }
	else { out("ARC"); }
	return 0;
}



Measured memory_bytes: 256
N = int(input()) 
hotel = list(map(int, input().split())) #入力してint型リストに格納
view = 1

for i in range (1, N, 1):
    judge = 1
    for j in range (0, i, 1):
        if hotel[i] >= hotel[j]:
            pass#何もしない
        else:
            judge = 0
            break
    if judge == 1:
        view += 1

print (view)

Measured memory_bytes: 3060
n=int(input())
l1=[]
l2=[]
for i in range(n):
  x,y=(int(i) for i in input().split())
  l1.append(x)
  l2.append(y)
c=0
for i in range(n-2):
  if(l1[i]==l2[i] and l1[i+1]==l2[i+1] and l1[i+2]==l2[i+2]):
    c=1
    break
if(c==0):
  print("No")
else:
  print("Yes")


Measured memory_bytes: 9188
#include <iostream>
#include <string>

using namespace std;

int main(void)
{
  string s;
  cin >> s;
  int i,j;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == 'A')
      break;
  }
  for (j = s.size() - 1; j >= 0; j--) {
    if (s[j] == 'Z')
      break;
  }
  printf("%d\n", j - i + 1);
  return 0;
}



Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using in6 = int64_t;
using ind = double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int gcd(int a, int b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

int main() {
  int n,x;
  cin >> n >> x;
  vi data(n);
  rep(i,n) cin >> data[i];
  rep(i,n) data[i] = max(data[i]-x,x-data[i]);
  int ans = data[0];
  rep(i,n) {
    ans = gcd(data[i],ans);
  }
  cout << ans << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define EB emplace_back

typedef long long ll;
typedef std::vector <int> vector;
const int N = 200054, mod = 1000000007, iv2 = (mod + 1) / 2;

int n;
int a[N], b[N], inv[N];
int cnt = 0, seg[N], col[N];
int f[N], g[N];
ll ans = 0;
vector U[N];

inline void add(int &x, const int y) {x += y - mod, x += x >> 31 & mod;}
inline void sub(int &x, const int y) {x -= y, x += x >> 31 & mod;}
ll PowerMod(ll a, int n, ll c = 1) {for (; n; n >>= 1, a = a * a % mod) if (n & 1) c = c * a % mod; return c;}

namespace BIT {
	#define lowbit(x) (x & -x)
	int n, ti, tag[N], x[N];
	inline void resize(int size) {n = size, ++ti;}
	inline void clear() {++ti;}
	inline int & recover(int id) {return tag[id] == ti ? x[id] : (tag[id] = ti, x[id] = 0);}
	int sum(int h) {int s = 0; for (; h > 0; h -= lowbit(h)) ::add(s, recover(h)); return s;}
	void add(int h, int v) {for (; h <= n; h += lowbit(h)) ::add(recover(h), v);}
}

int solve(int id) {
	int i, l = seg[id - 1], r = seg[id] - 1, ret = 0;
	BIT::resize(r - l + 1);
	for (f[l] = g[l] = 1, i = l; i <= r; ++i)
		f[i + 1] = f[i] * (b[i] - 1ll) % mod * inv[b[i]] % mod, g[i + 1] = PowerMod(f[i + 1], mod - 2);
	for (int x : U[id]) ret = (ret + (ll)g[x] * BIT::sum(r - x + 1)) % mod, BIT::add(r - x + 1, f[x]);
	BIT::clear();
	for (int x : U[id]) ret = (ret - (ll)f[x] * BIT::sum(x - l)) % mod, BIT::add(x - l + 1, g[x]);
	return ret + (ret >> 31 & mod);
}

void merge_sort(int L, int R) {
	if (L + 1 == R) return;
	int M = (L + R) / 2, i = L, j = M, c = L;
	static int fy[N];
	merge_sort(L, M), merge_sort(M, R), memcpy(fy + L, a + L, (R - L) << 2);
	for (; i < M && j < R; a[c++] = (fy[i] >= fy[j] ? fy[i++] : (ans += 2 * (M - i), fy[j++])));
	i < M ? memcpy(a + c, fy + i, (M - i) << 2) : memcpy(a + c, fy + j, (R - j) << 2);
}

int main() {
	int i, initial = 1;
	scanf("%d", &n);
	for (inv[1] = 1, i = 2; i <= n; ++i) inv[i] = ll(mod - mod / i) * inv[mod % i] % mod;
	for (i = 0; i < n; ++i) scanf("%d", a + i), a[i] = n - a[i], ++b[a[i]];
	for (i = 1; i < n; ++i) b[i] += b[i - 1] - 1;
	for (i = 0; i < n; ++i) initial = (ll)initial * b[i] % mod;
	if (!initial) return putchar(48), putchar(10), 0;
	seg[cnt++] = 0;
	for (i = 0; i < n; ++i) if (b[i] == 1) seg[cnt++] = i + 1;
	for (i = 1; i < cnt; ++i) std::fill(col + seg[i - 1], col + seg[i], i);
	for (i = 0; i < n; ++i) U[col[a[i]]].EB(a[i]);
	for (i = 1; i < cnt; ++i) ans += solve(i);
	merge_sort(0, n);
	ans = ans % mod * initial % mod * iv2 % mod;
	printf("%d\n", (int)ans);
	return 0;
}

Measured memory_bytes: 17408
#include <bits/stdc++.h>
using namespace std;
const long long int MOD = (1LL<<31) - 1;
const long long int base1 = 48271;
const long long int base2 = 69621;

bool contain(string a, string b, long long int BASE){// find a from b
    if(a.length() > b.length()) return false;

    long long int powB = 1;
    for(int i=0; i<a.length(); i++){
        powB *= BASE;
        powB %= MOD;
    }

    // Hash
    long long int hash_a = 0;// a[0] * BASE^(la-1) + ... + a[la-2] * BASE + a[la-1] 
    long long int hash_b = 0;
    for(int i=0; i<a.length(); i++){
        hash_a = hash_a * BASE + a[i];
        hash_b = hash_b * BASE + b[i];// hash of b.substr(0, a.length())

        hash_a %= MOD;
        hash_b %= MOD;
    }

    // Roll
    for(int i=0; i+a.length()<=b.length(); i++){
        if(hash_a == hash_b) return true;// b.substr(i,la) == a
        else if(i + a.length() < b.length()){
            hash_b = hash_b * BASE + b[i+a.length()] - b[i] * powB;
            hash_b = (hash_b % MOD + MOD) % MOD;
        }
    }
    return false;// i + a.length() == b.length() : coudln't find
}

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

    int upper = n, lower = 0, mid;
    while(upper - lower > 1){
        mid = (upper + lower) / 2;
        //cout << mid << endl;
        bool flag = false;
        for(int i=0; i+2*mid<=n; i++){
            string word = s.substr(i,mid);
            //cout << word << " " << s.substr(i+mid) << endl;
            if(contain(word, s.substr(i+mid), base1) == true
            && contain(word, s.substr(i+mid), base2) == true){
                flag = true;
                lower = mid;
                break;
            }
        }
        if(flag == false) upper = mid;
    }
    cout << lower << endl;
    return 0;
}

Measured memory_bytes: 384
N,x = map(int,input().split())
a = list(map(int,input().split()))

a.sort()

count = 0
total = 0
for i in range(N):
    total += a[i]
    if total <=x:
        count += 1
        
    else:
        break
if total < x:
    count = N-1
print(count)

Measured memory_bytes: 61616
combinations :: Int -> [a] -> [[a]]
combinations n xs = comb n (length xs) xs where
  comb 0 _ _ = [[]]
  comb r n a@(x:xs)
    | n == r    = [a]
    | otherwise = map (x:) (comb (r - 1) (n - 1) xs) ++ comb r (n - 1) xs

main = do
    input <- getLine
    if input == "0 0"
      then return ()
      else do let [n, s] = map (read :: String -> Int) $ words input
                  in putStrLn . show . length . filter (\x -> (sum x) == s) $ combinations n [0..9]
              main

Measured memory_bytes: 4072
#include <bits/stdc++.h>
using namespace std;
 
int main(int argc, char* argv[]) {
  int N, X, T;

  cin >> N >> X >> T;

  int a, b;

  a = N / X;
  b = N % X;
  if(b > 0) {
    cout << (a + 1)* T << endl;
  } else {
    cout << a*T << endl;
  }

  return 0;
}

Measured memory_bytes: 3632
let solve s =
  let len = String.length s in
  let rec aux i pre' pre =
    if i >= len then if pre' <> pre then (-1, -1) else (i - 1, i)
    else if pre' = s.[i] then (i - 1, i + 1)
    else if pre = s.[i] then (i, i + 2)
    else aux (i + 1) pre s.[i]
  in
  aux 2 s.[0] s.[1]

let () =
  let i, j = solve (read_line ()) in
  Printf.printf "%d %d\n" i j

Measured memory_bytes: 2688
#include <bits/stdc++.h>
using namespace std;
const int maxn=2e5+10;
int a[maxn];
int main(){
	long long n;
	cin>>n;
//	long long a=1,nn=n;
//	while(nn>0){
//		a=a*nn;
//		nn-=2;
//	} 
//	cout<<a<<endl;
	if(n%2==1) cout<<0;
	else{
		long long a=5,ans=0;
		while(a<=n){
			ans+=n/a/2;
			a=a*5;
		}
		cout<<ans;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
    string s, t;
    cin >> s >> t;
    int flag = 0;
    for (int i = 0; i < s.length(); i++)
    {
        if (s[i] == t[i])
            continue;
        else
            flag = 1;
    }
    if (flag == 0)
        if (t.length() != (s.length() + 1))
            flag = 1;
    if (flag)
    {
        cout << "No" << endl;
    }
    else
        cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 3572
#include <iostream>
#include <cmath>
using namespace std;
int main(){
    int n,m,max=0,sum=0;
    cin>>n>>m;
    for(int i=0;i<m;++i){
        int a,b;
        cin>>a>>b;
        if(a-b<0){
            sum+=n-a;
        }
        if(max<n-a){
            max=n-a;
        }
    }
    cout<<sum-max<<endl;
}



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

// #undef DEBUG  // Uncomment this line to forcefully disable debug print.
#if DEBUG
template <typename T>
void debug(T value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define dbg(...)                              \
  do {                                        \
    cerr << #__VA_ARGS__ << ": ";             \
    debug(__VA_ARGS__);                       \
    cerr << " (L" << __LINE__ << ")" << endl; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define in(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  std::cout << value << std::endl;
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  std::cout << value << ' ';
  write_to_cout(args...);
}
#define out(...) write_to_cout(__VA_ARGS__);

#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

using ll = long long;

using namespace std;

int main() {
  in(int, n);
  vector<int> d(n);
  rep(i, n) cin >> d[i];
  int sum = 0;
  for (int i = 0; i < n - 1; ++i) {
    for (int j = i + 1; j < n; ++j) {
      sum += d[i] * d[j];
    }
  }
  out(sum);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
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 (a>b) { a=b; return 1; } return 0; }
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};


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

    int n;
    cin >> n;
    vi h(n+1);
    vi s(n+1,0);
    rep(i,n){
        cin >> h[i];
    }
    h[n]=1000;
    int cnt = 0;
    bool ok = false;
    while(!ok){
    int ck = 0;
    rep(i,n){
        if(s[i]<h[i]){
            repk(j,i+1,n+1){
                if(s[j]>=h[j]){
                    break;
                }
                s[j]++;
            }
        s[i]++;
        cnt++;
        break;
        }
        ck++;
        if(ck==n)ok = true;
    }
    }
    cout << cnt << endl;
    return 0;
}
    


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
 
void Yes(){
	cout<<"Yes"<<endl;
	exit(0);
}
 
void No(){
	cout<<"No"<<endl;
	exit(0);
}
 
int main(){
  ll n;
  cin>>n;
  ll p[22];
  rep(i,n){
    cin>>p[i];
  }
  int count=0;
  rep(i,n-2){
    if(p[i]>p[i+1]&&p[i+1]>p[i+2]) count++;
    if(p[i]<p[i+1]&&p[i+1]<p[i+2]) count++;
  }
  cout<<count<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define fr first
#define sc second
#define r_0 return 0
#define TIME ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
    const ll N = 1e2 + 7;
    const ll mod = 1e9 + 7;
int n , x , cnt;
string s;
pair < string , int > p[N];
int main(){
    TIME
    cin >> n;
    for(int i = 1; i <= n ; i ++){
        cin >> s >> x;
        p[i] = {s , x};
    }
    cin >> s;
    int idx;
    for(int i = 1; i <= n ; i ++){
        if(p[i].fr == s){
            idx = i + 1;
            break;
        }
    }
    for(int i = idx ; i <= n ; i ++)
        cnt += p[i].sc;
    cout << cnt;
}
///...


Measured memory_bytes: 256
{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import           Control.Monad         (replicateM)
import qualified Data.ByteString.Char8 as BC
import           Data.Maybe            (fromJust)

main :: IO ()
main = do
  n <- readLn
  [d, x] <- getInts
  as <- replicateM n readLn
  print $ solve n d x as

solve :: Int -> Int -> Int -> [Int] -> Int
solve n d x as = x + sum (map (eat d) as)

eat :: Int -> Int -> Int
eat d a = (d + a - 1) `div` a

readInts :: BC.ByteString -> [Int]
readInts = map (fst . fromJust . BC.readInt) . BC.words

getInts :: IO [Int]
getInts = readInts <$> BC.getLine


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

int main(){
  int D;
  cin>>D;
  int C[26];
  map<int,int>mp;
  for(int i=0;i<26;i++){
    cin>>C[i];
    if(C[i]<10){
      mp[i]++;
    }   
  }
  int S[365][26];
  for(int i=0;i<365;i++){
    for(int j=0;j<26;j++){
      cin>>S[i][j];
    }
  }
  
  int flag=1;
  int temp=0;
  int now=0;
  int maxans=0;
  while(temp<365){
    maxans=0;
    now=0;
    
    if(temp>180 && temp<208){
      if(mp[temp%26]==1){
        cout<<temp%26+1<<endl;
        temp++;
        continue;
      }
    }
    
    for(int i=0;i<26;i++){
      if(S[temp][i]>maxans){
        now=i;
        maxans=S[temp][i];
      }
    }    
    
    if((temp/26)%2 ==1 &&  mp[temp%26]==0){
      cout<<temp%26+1<<endl;
      temp++;
      continue;
    }

    cout<<now+1<<endl;
    temp++;
  }
  return 0;
}



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

#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
// #define int long long
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) int(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using ul = unsigned long;

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; }

ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }
ll LCM(ll a, ll b) { return a / GCD(a, b)* b; }

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

inline bool inside(int y, int x, int H, int W) {
    return (y >= 0 && x >= 0 && y < H && x < W);
}

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  int n; cin>>n;
  vi p(n);
  vi m(n);
  int mi=INF;
  rep(i,n){
    cin>>p[i];
    chmin(mi,p[i]);
    m[i]=mi;
  }
  int ans=0;
  rep(i,n){
    if(m[i]==p[i])ans++;
  }
  cout<<ans<<endl;
}

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

int n,a[200005],b[200005];

int main()
{
    cin>>n;
    for(int i=1;i<=n;i++)
        cin>>a[i];
    for(int i=n;i>=1;i-=2)
        cout<<a[i]<<' ';
    if(n%2==0)
        for(int i=1;i<=n;i+=2)
            cout<<a[i]<<' ';
    else
        for(int i=2;i<=n;i+=2)
            cout<<a[i]<<' ';
}


Measured memory_bytes: 2944
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <cmath>
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;

int main(){
  int N;
  cin >> N;
  vector<int> syainn(N);
  vector<int> buka(N,0);
  syainn.at(0) = 0;
  for(int i =1;i < N;i++){
    cin >> syainn.at(i);
  }
  int count = 0;
  for(int i = 1;i < N;i++){
    buka.at(syainn.at(i)-1) += 1;
    }
    for(int i = 0;i < N;i++){
      cout << buka.at(i) <<endl;
    }
  }


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

#define left nadnlassad
#define right asdaslknd
#define y1 kjdajasjdsas
#define nxt accepted
#define prev why_would_you_call_when_you_are_high

#define pb push_back
#define mp make_pair
#define mt make_tuple

#define f first
#define s second

#define ll long long
#define ld long double
#define ull unsigned ll

#define _hash pair<ll, ull>
#define pii pair<int, int>
#define uint unsigned int
#define puu pair<uint, uint>

#define sqr(x) ((x) * 1LL * (x))

#define vec vector<int>
#define sz(v) int(v.size())
#define all(v) v.begin(), v.end()
#define endl "\n"
#define _bits(x) __builtin_popcountll(x)

using namespace std;

void rf() {
    #define fname "sparse"
    #ifdef SONY
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #else
        freopen(fname".in", "r", stdin);
        freopen(fname".out", "w", stdout);
    #endif //SONY
}

const int nx[8] = {2, -2, -2, 2, 1, 1, -1, -1};
const int ny[8] = {1, 1, -1, -1, 2, -2, -2, 2};
const int Nx[4] = {0, 0, -1, 1};
const int Ny[4] = {1, -1, 0, 0};

const ll LINF = (ll) 5e18;
const int INF = 1e9 + 7;

const int N = 6e5 + 1;
const int MAXN = 1e6 + 50;
const double EPS = 1e-9, PI = 3.14159265359;
int cnt[4];

int main() {
    srand(time(0));
    //ios_base::sync_with_stdio(0), cin.tie(0);
    //rf();
    string s;
    cin >> s;
    for (auto it : s) {
        if (it == 'N') cnt[0]++;
        if (it == 'S') cnt[1]++;
        if (it == 'W') cnt[2]++;
        if (it == 'E') cnt[3]++;
    }
    bool fail = 0;
    if (cnt[0] > cnt[1])
        swap(cnt[0], cnt[1]);
    if (cnt[2] > cnt[3])
        swap(cnt[2], cnt[3]);
    if (cnt[0] == 0 && cnt[1]) fail = 1;
    if (cnt[2] == 0 && cnt[3]) fail = 1; 
    if (fail)
        cout << "No";
    else
        cout << "Yes";
    return 0;
}

Measured memory_bytes: 256
import "dart:io";

void main() {
  String s = stdin.readLineSync();
  String mihon = "abcdefghijklmnopqrstuvwxyz";

  List sList = [];
  List mihonList = [];
  for (int i = 0; i < s.length; i++) {
    sList.add(s[i]);
  }
  for (int i = 0; i < mihon.length; i++) {
    mihonList.add(mihon[i]);
  }
  List sortS = sList..sort((a, b) => a.compareTo(b));

  List reducedS = sortS.toSet().toList();

  for (int i = 0; i < reducedS.length; i++) {
    if (reducedS[i] != mihonList[i]) {
      print(mihonList[i]);
      return;
    }
    if (i == reducedS.length - 1 && reducedS.length < mihon.length) {
      print(mihonList[reducedS.length]);
      return;
    }
  }

  print("None");
}

Measured memory_bytes: 15836