akhauriyash/Code-Regression huggingface dataset:
A, B, C, D = map(int, input().split())
# 体力0以下になる攻撃回数
# 高橋
tcnt = C // B
if C % B != 0:
  tcnt += 1
acnt = A // D
if A % D != 0:
  acnt += 1
# print(tcnt, acnt)
if tcnt <= acnt:
  print('Yes')
else:
  print('No')


Measured memory_bytes: 60776
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define all(a) (a).begin(), (a).end()
typedef long long ll;
#define INF 1e9
typedef pair<int, int> P;

/* 　"assert"    assert(A：条件式)で　Aが真なら処理は続行、偽ならプログラムを終了する　*/

/*　　ラムダ式　　 auto a = [キャプチャ](パラメータ){ 処理 }  */

/* string型　メンバ関数　substr()    replace()  */
 
int main(){
    ll n, a ,b; cin >> n >> a >> b;
    ll ans = 0;
    ans += n/(a+b)*a;
    ans += min(n%(a+b), a);
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cstring>
#include <cmath>
#include <climits>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <array>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define io() ios_base::sync_with_stdio(false); cin.tie(nullptr)
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define fi first
#define se second
#define IN(i,l,r) (l<i&&i<r)
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define v(T) vector<T>
#define p(T, N) pair<T, N>
#define tp(A, B, C) tuple<A, B, C>
#define ii p(int, int)
#define vi v(int)
#define vii v(p(int, int))
#define vvi v(v(int))
#define vl v(long long)
#define vll v(p(long long, long long))
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define qsort(a) sort(all(a))
#define qsortd(a) sort(all(a), greater<>())
#define qsortf(a, f) sort(all(a), f)
#define qsortsi(v) sort(v.begin(), v.end(), [](pair<int, int> a, pair<int, int> b){return a.se < b.se;})
#define pb(n) push_back(n)
#define eb(n) emplace_back(n)
#define pp(a, b) emplace_back(make_pair(a, b))
#define pt(a, b, c) emplace_back(make_tuple(a, b, c))
#define elif else if
#define fori(i, n) for(ll i = 0; i < n; ++i)
#define foris(i, a, b) for(ll i = a; i < b; ++i)
#define forise(i, a, b) for(ll i = a; i <= b; ++i)
#define ford(i, n) for(ll i = n; i >= 0; --i)
#define fords(i, a, b) for(ll i = a; i >= b; --i)
#define fordse(i, a, b) for(ll i = a; i > b; --i)
#define fora(i, a) for (auto &i: a)
#define rev(a) reverse(a.begin(), a.end())
#define revf(a, b, c) (reverse(a.begin() + b, a.begin() + c))
#define digits(i) (int)((log(i)/(log(10))+1)
#define umap unordered_map
#define uset unordered_set
#define nl '\n'
#define fileio(in, out) freopen(in, "r", stdin); freopen(out, "w", stdout)
const int mod = 1000000007;

int N;
string S;

int main() {
  io();
  
  cin >> N >> S;
  
  string ret = "";
  fori(i, S.size()) {
    int a = (int)(S[i]);
    a += N;
    if(a > 90) a -= 26;
    ret += (char)(a);
  }
  cout << ret;
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
const int MAX=5100;
typedef long long ll ;
using namespace std;
int n,k;
ll p[MAX],c[MAX];
vector<ll>v;
int main() {
    cin>>n>>k;
    for(int i=1;i<=n;i++){
        cin>>p[i];
    }
    for(int i=1;i<=n;i++){
        cin>>c[i];
    }
    ll all_max=-INT_MAX;
    for(int i=1;i<=n;i++){
        v=vector<ll>();
        ll now_max=-INT_MAX;
        ll ans=0;
        ll now=-INT_MAX;
        for(int j=p[i];j!=i;j=p[j]){
            ans+=c[j];
            v.push_back(ans);
            now_max=max(now_max,ans);
        }
        ans+=c[i];
        now_max=max(now_max,ans);
        v.push_back(ans);
        int cnt=v.size();
        ll all=v[cnt-1];
        if(k<=cnt){
            for(int j=0;j<k;j++){
                now=max(now,v[j]);
            }
        }else{
            if(all<=0)
                now=now_max;
            else {
                int count=k;
                for (int j = 0; j < k % cnt; j++) {
                    now = max(now, v[j]);
                }
                if (all - now_max + now < 0) {
                    now = now_max;
                    count-=cnt;
                }
                now += count / cnt * all;
            }
        }
        all_max=max(all_max,now);
    }
    cout<<all_max;
    return 0;
}


Measured memory_bytes: 3688
// Template {{{
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
using namespace std;
typedef long long LL;

#ifdef LOCAL
#include "contest.h"
#else
#define error(args...) 
#endif

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
inline bool valid(int x, int w) { return 0 <= x && x < w; }

void iostream_init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.setf(ios::fixed);
    cout.precision(12);
}
//}}}

int main(){
    iostream_init();
    int N;
    cin >> N;
    vector<int> A(3*N);
    REP(i, 3*N) cin >> A[i];
    sort(A.begin(), A.end());
    LL ans = 0;
    for(int i = 0; i < N; i++) {
        int idx = 3*N-2-2*i;
        ans += A[idx];
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 1408
import java.io.*;
import java.util.*;
public class Main{
	public static void main(String[] args)throws Throwable {
		MyScanner sc=new MyScanner();
		PrintWriter pw=new PrintWriter(System.out);
		
		String s=sc.next();
		pw.println(s.equals(new StringBuilder(s).reverse().toString())? "Yes" : "No");
		
		pw.flush();
		pw.close();
	}
	
	static class MyScanner {
		BufferedReader br;
		StringTokenizer st;
		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		String next() {while (st == null || !st.hasMoreElements()) {
			try {st = new StringTokenizer(br.readLine());}
			catch (IOException e) {e.printStackTrace();}}
		return st.nextToken();}
		int nextInt() {return Integer.parseInt(next());}
		long nextLong() {return Long.parseLong(next());}
		double nextDouble() {return Double.parseDouble(next());}
		String nextLine(){String str = "";
		try {str = br.readLine();}
		catch (IOException e) {e.printStackTrace();}
		return str;}
	}
}

Measured memory_bytes: 21204
#include<bits/stdc++.h>
using namespace std;
                    
                    
int main(){
    string S, T, ans;
    cin >> S >> T;

    ans = "Yes";

    if(S != T.substr(0, S.size())){
        ans = "No";
    }

    cout << ans << endl;


    return 0;
}

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

struct Articulation_Points{
  int n,t;
  vector<int>h,f;
  vector<bool> mark,ans;
  vector<vector<int> >G;
  Articulation_Points(int sz):G(sz),n(sz),mark(sz),ans(sz),h(sz),f(sz){}
  void add(int a,int b){
    G[a].push_back(b);
    G[b].push_back(a);
  }
  void dfs(int v){
    mark[v]=true;
    f[v]=h[v];
    for(int i=0;i<G[v].size();i++){
      int u=G[v][i];
      if(!mark[u]){
        h[u]=h[v]+1;
        dfs(u);
        if(v==0) t++;
        if(v!=0 && f[u]>=h[v])
          ans[v]=true;
        f[v]=min(f[v],f[u]);
      }
      else if(h[u]<h[v]-1) f[v]=min(f[v],h[u]);
    }
  }
  void build(){
    fill(mark.begin(),mark.end(),0);
    fill(ans.begin(),ans.end(),0);
    fill(h.begin(),h.end(),0);
    fill(f.begin(),f.end(),0);
    t=0;
    dfs(0);
    if(t>1)ans[0]=true;
  }
  bool ANS(int x){
    return ans[x];
  }
};
 
int main(){
  int n,m;
  cin>>n>>m;
  Articulation_Points A(n);
  for(int i=0;i<m;i++){
    int v,u;
    cin>>v>>u;
    A.add(v,u);
  }
  A.build();
  for(int i=0;i<n;i++)
    if(A.ANS(i)) cout<<i<<endl;
}


Measured memory_bytes: 4340
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
#define dec(n) cout << fixed << setprecision(n);
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;

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

ll mod(ll a){
  return (a % 1000000007);
}

ll lcm(ll a,ll b){
  return (a*b)/gcd(a,b);
}


int main(){
  ll n,m; cin >> n >> m;
  

  if(n == 1 && m >= 2){
    cout << m-2 << endl;
  }
  else if(n >= 2 && m == 1){
    cout << n-2 << endl;
  }
  else{
    cout << (n-2)*(m-2) << endl;
  }
  
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <queue>

template<class T>
using vec = std::vector<T>;

using Graph = vec<vec<int>>;
using pii   = std::pair<int, int>;

constexpr int INF = 1e9;

vec<int> bfs(std::set<int> &s, Graph &G)
{
    vec<int> dist(G.size(), INF);
    std::queue<pii> que; 
    for (auto &x: s) {
        dist[x] = 0;
        que.push(pii(0, x));    
    }
        
    while (!que.empty()) {
        pii p = que.front(); que.pop();
        int v = p.second;
        
        for (int to : G[v]) {
            if (dist[v] + 1 < dist[to]) {
                dist[to] = dist[v] + 1;
                que.push(pii(dist[to], to));                
            }
        }
    }
    
    return dist;
}

int get_farthest_point(int v, Graph &G)
{
    std::set<int> st = {v};
    auto vec = bfs(st, G);
    int resv = -1, max = -1;
    for (int i = 0; i < (int)G.size(); i++) {
        if (max < vec[i]) {
            max = vec[i];
            resv = i;
        }
    }
    return resv;
}

std::set<int> res;

void dfs(int v, int prev, int target, std::set<int> &td, Graph &G)
{
    td.insert(v);
    if (v == target) {
        res = td;
        return;
    }
    
    for (int to : G[v]) {
        if (to == prev) continue;
        dfs(to, v, target, td, G);
    }
    
    td.erase(v);
}

void solve(Graph &G)
{
    int N = G.size();
    int v0 = 0;
    int v1 = get_farthest_point(v0, G);
    int v2 = get_farthest_point(v1, G);
    std::set<int> td, st1 = {v1}, st2 = {v2};
    dfs(v1, -1, v2, td, G);

    int cost = 0;
    for (int i = 0; i < N; i++) {
        if (!res.count(i)) {
            cost += 2;
        }
    }
    
    vec<int> d1 = bfs(st1, G), d2 = bfs(st2, G), d3 = bfs(res, G);
    for (int i = 0; i < N; i++) {
        printf("%d\n", d2[v1] + std::min(d1[i], d2[i]) + cost - 2 * d3[i]);
    }
}

int main()
{   
    int N, u, v;
    scanf("%d", &N);
    
    Graph G(N);
    for (int i = 0; i < N - 1; i++) {
        scanf("%d %d", &u, &v); u--; v--;
        G[u].emplace_back(v);
        G[v].emplace_back(u);
    }
    
    solve(G);
    return 0;
}

Measured memory_bytes: 28444
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#define ll long long
#define ull unsigned long long
#define ci const int&
#define cl const long long&
#define cul const unsigned long long&
#define io_f std::ios::sync_with_stdio(false)
using namespace std;

string a;

int main() {
    cin >> a;
    int le = a.size();
    for (int i = 0; i < le - 1; i++) {
        if (a[i] == a[i+1]) {
            cout << i+1 << ' ' << i+2 << endl;
            return 0;
        } else if (a[i] == a[i+2] && i != le - 2) {
            cout << i+1 << ' ' << i+3 << endl;
            return 0;
        }
    }
    cout << -1 << ' ' << -1 << endl;
    return 0;
}

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

int main(){
    int n,a;
    cin>>n;
    a=n%10;
    if(a==3){
        cout<<"bon"<<endl;
    }else if(a==0||a==1||a==6||a==8){
        cout<<"pon"<<endl;
    }else{
        cout<<"hon"<<endl;
    }

}

Measured memory_bytes: 3636
import numpy

tmp = [int(i) for i in list(input())]
tile = numpy.array(tmp,dtype = int)

length = tile.shape[0]

zero_st = numpy.zeros(length,dtype = int)
zero_st[1::2] = 1
one_st = numpy.zeros(length,dtype = int)
one_st[0::2] = 1

zeros = sum(tile == zero_st)
ones = sum(tile == one_st)

if zeros > ones:
    print(ones)
else:
    print(zeros)


Measured memory_bytes: 21676
#include <stdio.h>

int main(void) {
int a,b;
scanf("%5d",&a);
scanf("%5d",&b);
 if(a>b){
   printf("a > b\n",a,b);
 }
 if(a<b){
   printf("a < b\n",a,b);
 }
 if(a==b){
   printf("a == b\n",a,b);
 }
}


Measured memory_bytes: 2696
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 2e5 + 10;
int f[N];
ll dis[N];

void fail() {
  puts("No");
  exit(0);
}

int find(int k) {
  if(f[k] == k) return k;
  else {
    int fa = find(f[k]);
    dis[k] += dis[f[k]];
    return f[k] = fa;
  }
}

int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for(int i = 1; i <= n; ++i) f[i] = i;
  for(int i = 1, x, y, z; i <= m; ++i) {
    scanf("%d%d%d", &x, &y, &z);
    int fx = find(x), fy = find(y);
    if(fx == fy) {
      if(dis[y] - dis[x] != z) fail();
    } else {
      f[fy] = fx;
      dis[fy] = dis[x] - dis[y] + z;
    }
  }
  puts("Yes");
  return 0;
}

Measured memory_bytes: 1408
#include <stdio.h>
#include <iostream>
#include <fstream>

using std::cin;
using std::cout;
using std::endl;
using std::terminate;

template<class T> inline T gcd(T a, T b) {
  while (b > 0) {
    T r = a % b;
    a = b;
    b = r;
  }

  return a;
}

void solve() {
    int k; cin >> k;

    int y = 0;
    for (int a = 1; a <= k; ++a) {
        for (int b = 1; b <= k; ++b) {
            for (int c = 1; c <= k; ++c) {
                y += gcd(gcd(a, b), c);
            }
        }
    }

    cout << y << endl;
}

int main() {

#ifdef DEV
    std::ifstream in("AtCoder/ABC162/Sum of gcd of Tuples (Easy).input");
    cin.rdbuf(in.rdbuf());

    int t; cin >> t;
    for (int x = 1; x <= t; ++x) {
        solve();
    }
#else
    solve();
#endif

    return 0;
}


Measured memory_bytes: 3632
using System;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
          string input1 = Console.ReadLine();
          int var1= int.Parse(input1);
          string input2 = Console.ReadLine();
          string[] var2 = input2.Split(' ');

          int[] var3=new int[var1];
          string output;

            for (int i = 0; i < var2.Length; i++)
          {
             var3[i] =int.Parse(var2[i]);
          }
            Console.WriteLine(input2);
            string[] output1 = new string[var2.Length];

            for (int i = 1; i < var2.Length; i++)
            {
                int key = var3[i];
                int j = i - 1;
                while (j>=0&&var3[j]>key)
                {
                    var3[j + 1] = var3[j];
                    j--;
                    var3[j + 1] = key;
                }
                for (int k = 0; k < var2.Length; k++)
                {
                    output1[k] = var3[k].ToString();
                }
                output = string.Join(" ", output1);
                Console.WriteLine(output);
            }
            Console.ReadLine();
        }
    }
}

Measured memory_bytes: 5700
// E.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>

using namespace std;

class BIT {
	std::vector<int> bit;
	int size;
public:
	BIT() { }
	BIT(int sz) { init(sz); }
	void init(int sz) {
		bit = std::vector<int>((size = sz) + 1);
	}
	int sum(int i) {
		int s = 0;
		while (i > 0) {
			s += bit[i];
			i -= i & -i;
		}
		return s;
	}
	void add(int i, int x) {
		while (i <= size) {
			bit[i] += x;
			i += i & -i;
		}
	}
};

int main(int argc, char* argv[]) {
#ifdef _MSC_VER
	while (true)
#endif
	{
		int n = -1, q, t, l, r;
		cin >> n;
		if (n < 0) return 0;
		string s;
		cin >> s;
		cin >> q;
		BIT bits[26];
		for (int i = 0; i < 26; ++i) {
			bits[i].init(n + 2);
		}
		for (int i = 0; i < n; ++i) {
			int c = s[i] - 'a';
			bits[c].add(i + 1, 1);
		}
		for (int i = 0; i < q; ++i) {
			cin >> t >> l;
			char c;
			if (t == 1) {
				cin >> c;
				bits[s[l - 1] - 'a'].add(l, -1);
				s[l - 1] = c;
				bits[s[l - 1] - 'a'].add(l, 1);
			} else {
				cin >> r;
				int cnt = 0;
				for (int x = 0; x < 26; ++x) {
					cnt += (bits[x].sum(r) - bits[x].sum(l - 1)) > 0;
				}
				cout << cnt << endl;
			}
		}
	}
	return 0;
}


Measured memory_bytes: 53764
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
    int n;
    cin >> n;
    double pi = 3.14159265358979;
    cout <<fixed << setprecision(10) <<  n*2*pi << endl;
}

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

using namespace std;

int main()
{
    long n, d;
    cin >> n >> d;
    long x, y;
    long thresh = d * d;
    int count = 0;
    while (n > 0)
    {
        cin >> x >> y;
        if ((x * x + y * y) <= thresh)
            count++;
        n--;
    }

    cout << count << endl;

    return 0;
}


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

using namespace std;

int main(){
  int n;
  cin>>n;
  int a[n][3],d[n][3];
  for(int i=0;i<n;i++){
    for(int j=0;j<3;j++){
      scanf("%d",&a[i][j]);
      d[i][j]=0;
    }
  }
  for(int j=0;j<3;j++){
    d[0][j]=a[0][j];
  }
  for(int i=0; i<n-1;i++){
    for(int j=0;j<3;j++){
      for(int k:{j+1,j+2}){
        d[i+1][k%3] = max(d[i+1][k%3],d[i][j]+a[i+1][k%3]);
      }
    }
  }
  // for(int i=0;i<n;i++){
  //   for(int j=0; j<3;j++){
  //     cout<<d[i][j]<<" ";
  //   }
  //   cout<<"\n";
  // }
  cout<<max(max(d[n-1][0],d[n-1][1]),d[n-1][2])<<"\n";
}

Measured memory_bytes: 2560
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define speed ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long 
#define ull unsigned long long
#define db double
#define vi vector<ll>
#define vvi vector<vector<int> >
#define vvii vector<vector<pii> >
#define rep(i,a,b) for(int i=a;i<b;i++)
#define endl "\n"
#define pii pair<ll,ll>
#define piii pair<ll,pair<ll,ll> >
#define mem(a,b) memset(a , b , sizeof a ) ; 
#define pb push_back
#define pf push_front
#define F first 
#define S second 
#define mp make_pair
#define all(v) v.begin(),v.end()

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}



#define deb1(a) cout<<#a<<"=*"<<a<<endl;
#define deb2(a) cout<<#a<<"=@"<<a<<endl;
#define deb3(a) cout<<#a<<"=#"<<a<<endl;
#define deb4(a,b) cout<<#a<<"="<<a<<" and "<<#b<<"="<<b<<endl;
#define deb5(a,b) cout<<#a<<"="<<a<<" and "<<#b<<"="<<b<<endl;


typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;


ll mod=1000000007;
ll vis[212345]={0};
vvi v(212345);
ll d[212345]={0};


ll pow(ll a, ll b, ll m)
{
	ll ans=1;
	while(b)
	{
		if(b&1)
			ans=(ans*a)%m;
		b/=2;
		a=(a*a)%m;
	}
	return ans;
}


//extended euclidean algorithm( x is inverse of a wrt b onlt if gcd!=1)
ll gcd(ll a,ll b,ll &x,ll &y)
{
	if(b==0)
	{
		x=1;
		y=0;
		return a;
	}
	ll x1,y1;
	ll d=gcd(b,a%b,x1,y1);
	x=y1;
	y=x1-y1*(a/b);
	return d;

}


int main()
{
speed
ll d,t,s;
cin>>d>>t>>s;
db k=(db)d/s;
db z=(db)t-k;
if(s>1) t-=(d+1)/s;
else t-=d;

if(z>=0) cout<<"Yes\n";
else cout<<"No\n";
}



Measured memory_bytes: 8124
{-# LANGUAGE BangPatterns #-}
import Control.Monad
import Data.Maybe
import Debug.Trace
import Data.List
import qualified Data.Map.Strict as Map
import qualified Data.IntMap.Strict as IntMap
import qualified Data.Set as Set
import qualified Data.IntSet as IntSet
import Data.Functor
import Data.Array
-- import Data.Array.Unboxed
import Control.Monad.ST
import Data.Array.ST

main :: IO ()
main = do
  a <- readLn :: IO Int
  b <- readLn :: IO Int
  print $ solve a b

solve a b = 6 - a - b



Measured memory_bytes: 508
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n)for(int i=0;i<(int)(n);i++)
 
int main() {
	int n;
	cin >> n;
	vector<int> a(n);
	int i, j;

	for (i = 0; i < n; i++)
	{
		cin >> a.at(i);
	}
	sort(a.begin(), a.end());
	reverse(a.begin(), a.end());

	int tmp=a.at(0), cnt = 1;
	for (i = 1; i < n; i++)
	{
		if (tmp > a.at(i))
		{
			tmp=a.at(i);
			cnt++;
		}
	}
	cout << cnt << endl;

}



/**/
/*#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

#define PI 3.141592653589793

int main(void) {
	return 0;
}
*/

Measured memory_bytes: 3656
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		int arr[][] = new int[300][2];
		int i = 0, j = 0, count = 0;
		for (i = 0; i < 300; i++) {
			arr[i][0] = stdin.nextInt();
			arr[i][1] = stdin.nextInt();
			if (arr[i][0] == 0 && arr[i][1] == 0) {
				count = i;
				break;
			}
		}
		for (int k = 0; k < count; k++) {
			int row = arr[k][0];
			int col = arr[k][1];
			for (i = 0; i < row; i++) {
				for (j = 0; j < col; j++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}

	}
}

Measured memory_bytes: 37140
#include<bits/stdc++.h>
using namespace std;
main(){
  vector<string>ss(256);
  cin>>ss['a']>>ss['b']>>ss['c'];
  char turn='a';
  while(true){
    const int size=ss[turn].size();
    if(size==0)break;
    char tmp=ss[turn][0];
    ss[turn]=ss[turn].substr(1,size-1);
    turn=tmp;
  }
  cout<<(char)toupper(turn)<<endl;
}


Measured memory_bytes: 256
import sys

N = int(sys.stdin.readline().rstrip("\n"))
S = sys.stdin.readline().rstrip("\n")
count = 0
for i in range(len(S)-2):
    if (S[i] == 'A') and (S[i+1] == 'B') and (S[i+2] == 'C'):
        count += 1
print(count)



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


char mp[1002][1002]={0};
char fl[2][2];

int main(){
	
	memset(mp,'#',sizeof(mp));
	
	int h,w;
	cin>>h>>w;
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			cin>>mp[j][i];
		}
	}
	for(int i=0;i<2;i++){
		for(int j=0;j<2;j++){
			cin>>fl[j][i];
		}
	}
	int as=0;
	for(int i=1;i<h;i++){
		for(int j=1;j<w;j++){
			int f=1;
			for(int k=0;k<2;k++){
				for(int l=0;l<2;l++){
					if(mp[j+l][i+k]!=fl[l][k]){
						f=0;
					}
				}
			}
			if(f)as++;
		}
	}
	
	int as2=0;
	
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			
			int fs=0;
			for(int k=i-1;k<=i;k++){
				for(int l=j-1;l<=j;l++){
					int f=1;
					for(int m=0;m<2;m++){
						for(int n=0;n<2;n++){
							if(mp[l+n][k+m]!=fl[n][m])f=0;
						}
					}
					if(f)fs++;
				}
			}
			char t=mp[j][i];
			for(int c=0;c<3;c++){
				mp[j][i]=(c==0?'J':(c==1?'O':'I'));
				int tmp=0;
				
				for(int k=i-1;k<=i;k++){
					for(int l=j-1;l<=j;l++){
						int f=1;
						for(int m=0;m<2;m++){
							for(int n=0;n<2;n++){
								if(mp[l+n][k+m]!=fl[n][m])f=0;
							}
						}
						if(f)tmp++;
					}
				}
				as2=max(as2,tmp-fs);
			}
			mp[j][i]=t;
			
		}
	}
	
	cout<<as+as2<<endl;
	
	return 0;
}


Measured memory_bytes: 2152
#include <cstdio>
#include <vector>
#include <map>
#include <unordered_map>
#include <string>
#include <utility>
#include <algorithm>
#include <iostream>

using namespace std;

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

	int wmax = 0;
	int bmax = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == '.') wmax++;
		if (s[i] == '#') bmax++;
	}

	if (wmax == 0 || bmax ==0) {
		cout << "0" << endl;
		return 0;
	}

	int ans = min(wmax, bmax);

	int bcnt = 0;
	int wcnt = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == '.') wcnt++;
		if (s[i] == '#') bcnt++;

		ans = min(bcnt + wmax - wcnt, ans);
	}

	cout << ans << endl;
}

Measured memory_bytes: 640
#include<stdio.h>
#define N 1000

int main(){
	int cnt=0;
	int n,q,i;
	int x,y,z;
	int a[N];
	
	scanf("%d",&n);
	
	for(i=0;i<n;i++)scanf("%d",&a[i]);
	
	scanf("%d",&q);
	
	for(i=0;i<q;i++){
		scanf("%d %d %d",&x,&y,&z);
		cnt=0;
		for(int j=x;j<y;j++)if(a[j]==z)cnt++;
		printf("%d\n",cnt);
	}
	
	return 0;
	
}
		


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

#define CK(N,A,B) (A<=N&&N<B)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define RREP(i,a,b) for(int i=(b-1);a<=i;i--)
#define F first
#define S second
#define ll long long;

const int INF = 1e9;
const long long  LLINF = 1e15;

using namespace std;

string S, SP;
int N;

int main() {
  cin>>N;
  cin>>S;
  int l = 0, r = S.size();
  int cnt = 0, sz = S.size();
  REP(i,0,sz){
    if(S[i] == '('){
      //l = i;
      cnt++;
      //cout<<"l pos : "<<l<<endl;
    }else{
      cnt--;
    }

    if(cnt < 0){
      S = S.substr(0,l) + "(" + S.substr(l,(sz-l));
      sz++;
      i++;
      cnt = 0;
    }
  }

  if(cnt > 0){
    REP(i,0,cnt) S += ")";
  }

  cout<<S<<endl;

  return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


K = int(input())
G = [[0]*K for i in range(K)]
x=0
for i in range(K):
    for j in range(K):
        g1=gcd(i+1,j+1)
        G[i][j]=g1

for i in range(K):
    for j in range(K):
        for k in range(K):
            g1=G[i][j]
#            print("{}".format(g1))
            x=x+G[g1-1][k]
#        for k in range(K):
#            g2=gcd(g1,k+1)
#            x=x+g2
            

print("{}".format(x))

Measured memory_bytes: 9376
from collections import deque
while True:
    n = int(input())
    if n == 0:break
    a = [int(input()) for _ in range(n)]
    b = deque([0] * n)
    j = 0
    for i in range(n):
        if a[i] * b[j] >= 0:b[j] += a[i]
        else:j += 1;b[j] += a[i]
    if b[0] < 0 and len(b) > 1:b.popleft()
    while b[-1] <= 0 and len(b) > 1:b.pop()
    if len(b) == 1 and b[0] <= 0:print(max(a))
    else:
        m = len(b) // 2 + 1
        v = [[0] * m for _ in range(m)]
        v[0][0] = b[0]
        for i in range(1, m):
            v[0][i] = v[0][i - 1] + b[2 * i] + b[2 * i - 1]
        for i in range(1, m):
            for j in range(i, m):
                v[i][j] = v[i - 1][j] - b[2 * i - 2] - b[2 * i - 1]
        print(max([max(i) for i in v]))


Measured memory_bytes: 20012
s=list(input())
a=int(s[0]+s[1])
b=int(s[2]+s[3])

def which(n):
    if 1 <= n <=12:
        return 'MM'
    else:
        return 'YY'

if which(a)== 'MM' and which(b)== 'MM':
    print('AMBIGUOUS')
elif which(a)=='YY' and which(b)=='YY':
    print('NA')
else:
    print(which(a) + which(b))


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

int main(){
  int N;
  cin >> N;
  int ctr = 0;
  int N_i = N;
  for(int i = 2; i >=0; i--){
    N_i = N_i/pow(10,i);
    if (N_i == 7){
      cout << "Yes";
      ctr = 1;
      break;
    }
    N_i = N - N_i*pow(10,i);
    N = N_i;
  }
  if(ctr == 0){
    cout << "No";
  }
  cout << endl;
}


Measured memory_bytes: 3808
// {{{ by shik
#include <bits/stdc++.h>
#include <unistd.h>
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x),end(x)
#define REP(i,n) for ( int i=0; i<int(n); i++ )
#define REP1(i,a,b) for ( int i=(a); i<=int(b); i++ )
#define FOR(it,c) for ( auto it=(c).begin(); it!=(c).end(); it++ )
#define MP make_pair
#define PB push_back
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
typedef vector<int> VI;

#ifdef SHIK
template<typename T>
void _dump( const char* s, T&& head ) { cerr<<s<<"="<<head<<endl; }

template<typename T, typename... Args>
void _dump( const char* s, T&& head, Args&&... tail ) {
    int c=0;
    while ( *s!=',' || c!=0 ) {
        if ( *s=='(' || *s=='[' || *s=='{' ) c++;
        if ( *s==')' || *s==']' || *s=='}' ) c--;
        cerr<<*s++;
    }
    cerr<<"="<<head<<", ";
    _dump(s+1,tail...);
}

#define dump(...) do { \
    fprintf(stderr, "%s:%d - ", __PRETTY_FUNCTION__, __LINE__); \
    _dump(#__VA_ARGS__, __VA_ARGS__); \
} while (0)

template<typename Iter>
ostream& _out( ostream &s, Iter b, Iter e ) {
    s<<"[";
    for ( auto it=b; it!=e; it++ ) s<<(it==b?"":" ")<<*it;
    s<<"]";
    return s;
}

template<typename A, typename B>
ostream& operator <<( ostream &s, const pair<A,B> &p ) { return s<<"("<<p.first<<","<<p.second<<")"; }
template<typename T>
ostream& operator <<( ostream &s, const vector<T> &c ) { return _out(s,ALL(c)); }
template<typename T, size_t N>
ostream& operator <<( ostream &s, const array<T,N> &c ) { return _out(s,ALL(c)); }
template<typename T>
ostream& operator <<( ostream &s, const set<T> &c ) { return _out(s,ALL(c)); }
template<typename A, typename B>
ostream& operator <<( ostream &s, const map<A,B> &c ) { return _out(s,ALL(c)); }
#else
#define dump(...)
#endif

template<typename T>
void _R( T &x ) { cin>>x; }
void _R( int &x ) { scanf("%d",&x); }
void _R( long long &x ) { scanf("%" PRId64,&x); }
void _R( double &x ) { scanf("%lf",&x); }
void _R( char &x ) { scanf(" %c",&x); }
void _R( char *x ) { scanf("%s",x); }

void R() {}
template<typename T, typename... U>
void R( T& head, U&... tail ) {
    _R(head);
    R(tail...);
}

template<typename T>
void _W( const T &x ) { cout<<x; }
void _W( const int &x ) { printf("%d",x); }
template<typename T>
void _W( const vector<T> &x ) {
    for ( auto i=x.cbegin(); i!=x.cend(); i++ ) {
        if ( i!=x.cbegin() ) putchar(' ');
        _W(*i);
    }
}

void W() {}
template<typename T, typename... U>
void W( const T& head, const U&... tail ) {
    _W(head);
    putchar(sizeof...(tail)?' ':'\n');
    W(tail...);
}

#ifdef SHIK
#define FILEIO(...)
#else
#define FILEIO(name) do {\
    freopen(name ".in","r",stdin); \
    freopen(name ".out","w",stdout); \
} while (0)
#endif

// }}}

const int N=1010;
int n;
char s[N];
const char *t="NWSE";
int main() {
    R(s);
    n=strlen(s);
    bool b[4]={};
    REP(i,n) b[strchr(t,s[i])-t]=1;
    if ( (b[0]^b[2]) || (b[1]^b[3]) ) W("No");
    else W("Yes");
    return 0;
}


Measured memory_bytes: 764
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <queue>
#define MOD (1000000007l)
#define rep(i, n) for(long i = 0; i < n; i++)

using namespace std;

long N, Z, W;
vector<long> a;

map<vector<long>, bool> memo_exist;
map<vector<long>, long> memo;

// Xの手札, Yの手札, 次のスタート地点, ターン(0: X, 1: Y)
long rec(vector<long> state) {
  if (state[2] == N) {
    long score = abs(state[0] - state[1]);
    return score;
  }

  vector<long> query = state;
  if (query[3] == 0) query[0] = 0;
  else query[1] = 0;

  if (memo_exist[query]) {
    return memo[query];
  }

  long max = -1, min = -1;

  for (long i = state[2]; i < N; i++) {
    vector<long> tmp_state = state;
    if (tmp_state[3] == 0) tmp_state[0] = a[i];
    else tmp_state[1] = a[i];
    tmp_state[2] = i + 1;
    tmp_state[3] = tmp_state[3] == 0 ? 1 : 0;
    long tmp = rec(tmp_state);
    if (max == -1 or max < tmp) max = tmp;
    if (min == -1 or min > tmp) min = tmp;
  }

  long result = state[3] == 0 ? max : min;

  memo_exist[query] = true;
  memo[query] = result;

  return result;
}

int main(void) {
  cin >> N >> Z >> W;
  rep (i, N) {
    long tmp;
    cin >> tmp;
    a.push_back(tmp);
  }

  vector<long> initial_state = { Z, W, 0, 0 };
  long result = rec(initial_state);

  cout << result << endl;

  return 0;
}


Measured memory_bytes: 1664
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#define REP(i,n) for (int i=0;i<(n);++i)
using namespace std;
using ll = long long;
constexpr ll INF = 1LL << 60;
constexpr ll MOD = 1000000007;

ll n, k, c, all[3], cnt[3];
string s;

int main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> n >> s;
  for (char c: s) ++all[c%3];
  // B R G
  //
  ll ans = 0;
  for (int i = 0; i < n; ++i) {
    ++cnt[s[i] % 3];
    ans += cnt[(s[i]+1)%3] * (all[(s[i]+2)%3]-cnt[(s[i]+2)%3]);
    ans += cnt[(s[i]+2)%3] * (all[(s[i]+1)%3]-cnt[(s[i]+1)%3]);
    for (int j = 0; 0 <= i - j && i + j < n; ++j) {
      if (s[i - j] != s[i] && s[i] != s[i + j] && s[i - j] != s[i + j]) --ans;
    }
  }
  cout << ans;
  return 0;
}



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

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q>
ostream& operator << (ostream& os, pair<P, Q> p)
{
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

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

  int n;
  while (cin >> n) {
    vector<int> p(n);
    each (i, p) cin >> i;
    each (i, p) --i;

    const int N = 1e5 + 5;
    int dp[N][2];
    const int inf = 1 << 29;
    fill(&dp[0][0], &dp[N - 1][2 - 1] + 1, inf);

    dp[0][p[0] == 0] = 0;

    for (int i = 0; i + 1 < n; ++i) {
      if (dp[i][0] < inf) {
        int& x = dp[i + 1][p[i + 1] == i + 1];
        x = min(x, dp[i][0]);
      }
      if (dp[i][1] < inf) {
        int& x = dp[i + 1][0];
        x = min(x, dp[i][1] + 1);
      }
    }

    // cout << endl;
    // for (int i = 0; i < n; ++i) {
    //   if (dp[i][0] == inf) cout << "- ";
    //   else cout << dp[i][0] << ' ';
    // }
    // cout << endl;
    // for (int i = 0; i < n; ++i) {
    //   if (dp[i][1] == inf) cout << "- ";
    //   else cout << dp[i][1] << ' ';
    // }
    // cout << endl;


    cout << min(dp[n - 1][0], dp[n - 1][1] + 1) << endl;

  }

  return 0;
}


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

using namespace std;

template <class T> inline bool chmin(T &a, T b) { /* {{{ */
  if (a > b) {
    a = b;
    return true;
  }
  return false;
} /* }}} */

int main() {
  int N, M, S;
  cin >> N >> M >> S;
  vector<int> U(M), V(M), A(M), B(M);
  for (int i = 0; i < M; i++) {
    cin >> U[i] >> V[i] >> A[i] >> B[i];
    U[i]--;
    V[i]--;
  }
  vector<int> C(N), D(N);
  for (int i = 0; i < N; i++) {
    cin >> C[i] >> D[i];
  }

  const long long inf = 1e18 + 10;
  const int max_s = 5000;
  vector<vector<long long>> dp(N + 5, vector<long long>(max_s + 1, inf));
  dp[0][min(max_s, S)] = 0;
  for (int i = 0; i < M; i++) {
    for (int j = 0; j < M; j++) {
      int u = U[j], v = V[j];
      for (int k = 0; k <= max_s; k++) {
        if (dp[u][k] == inf) continue;
        chmin(dp[u][min(max_s, k + C[u])], dp[u][k] + D[u]);
      }
      for (int k = 0; k <= max_s; k++) {
        if (dp[u][k] == inf) continue;
        if (k - A[j] >= 0) {
          chmin(dp[v][k - A[j]], dp[u][k] + B[j]);
        }
      }
      for (int k = 0; k <= max_s; k++) {
        if (dp[v][k] == inf) continue;
        chmin(dp[v][min(max_s, k + C[v])], dp[v][k] + D[v]);
      }
      for (int k = 0; k <= max_s; k++) {
        if (dp[v][k] == inf) continue;
        if (k - A[j] >= 0) {
          chmin(dp[u][k - A[j]], dp[v][k] + B[j]);
        }
      }
    }
  }
  for (int i = 1; i < N; i++) {
    long long ans = inf;
    for (int j = 0; j <= max_s; j++) {
      chmin(ans, dp[i][j]);
    }
    cout << ans << endl;
  }

  return 0;
}
/* vim:set fdm=marker: */


Measured memory_bytes: 5304
#include<stdio.h>
int gcd(int n,int m)
{
  int r;
  if(n>m){
    int t=m;
    m=n;
    n=t;
  }
  while ((r=m%n)!=0){
    m=n;
    n=r;
  }
  return n;
}
int main(void)
{
  int K,a,b,c,num,sum=0;
  scanf("%d",&K);
  for(a=1;a<=K;a++){
    for(b=1;b<=K;b++){
      for(c=1;c<=K;c++){
        num=gcd(gcd(a,b),c);
        sum+=num;
      }
    }
  }
  printf("%d",sum);
  return 0;
}

Measured memory_bytes: 1732
n, m = map(int, input().split())
ac = [0] * n
wa = [0] * n

for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if s == 'AC':
        ac[p] = 1
    if not ac[p] and s == 'WA':
        wa[p] += 1

c = 0
for i in range(n):
    c += wa[i] * ac[i]
print(sum(ac), c)


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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repi(i, a, b) for (int i = (a); i < int(b); i++)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ull << (b))

using namespace std;
using i32 = int;
using i64 = long long;
using f64 = double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf64 = vector<f64>;
using vstr = vector<string>;

template<typename T, typename S> void amax(T &x, S y) { if (x < y) x = y; }
template<typename T, typename S> void amin(T &x, S y) { if (y < x) x = y; }

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(16);
  int a, b, q;
  cin >> a >> b >> q;
  vi64 s(a), t(b);
  rep(i, a) cin >> s[i];
  rep(i, b) cin >> t[i];
  rep(_, q) {
    i64 x;
    cin >> x;
    int sl = -1, sr = a, tl = -1, tr = b;
    while (sr - sl > 1) {
      int md = (sl + sr) / 2;
      if (s[md] > x) sr = md;
      else sl = md;
    }
    while (tr - tl > 1) {
      int md = (tl + tr) / 2;
      if (t[md] > x) tr = md;
      else tl = md;
    }
    i64 ans = 1e18;
    if (sl >= 0 && tl >= 0)
      amin(ans, max(x - t[tl], x - s[sl]));
    if (sr < a && tr < b)
      amin(ans, max(t[tr] - x, s[sr] - x));
    if (sl >= 0 && tr < b) {
      amin(ans, (x - s[sl]) * 2 + t[tr] - x);
      amin(ans, (t[tr] - x) * 2 + x - s[sl]);
    }
    if (sr < a && tl >= 0) {
      amin(ans, (x - t[tl]) * 2 + s[sr] - x);
      amin(ans, (s[sr] - x) * 2 + x - t[tl]);
    }
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 2944
program main
  implicit none
  integer :: a(5), i, res
  res = 0
  do i = 1, 5
    read (*, *) a(i)
    res = res + roundup(a(i))
  end do

  print "(i0)", res - (10 - minlast(a))

  contains

  pure function minlast(a)
    integer, intent(in) :: a(5)
    integer :: minlast
    minlast = minval(mod(a - 1, 10) + 1)
  end function minlast

  pure function roundup(x)
    integer, intent(in) :: x
    integer :: roundup
    roundup = int(ceiling(x * 0.1)) * 10
  end function roundup
end program main


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL MOD = 1000000007;
#define lcm(x, y) ((x) * (y) / __gcd((x), (y)))
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define debug(x) cout << #x << " : " << x << endl
#define part cout << "----------------------------------\n";
#include <iostream>

#define fastinput                     \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);

LL POW(LL x, LL y)
{
    LL ans = 1;
    LL base = x;
    while (y)
    {
        if (y & 1)
        {
            ans *= base;
        }
        base = base * base;
        y = y >> 1;
    }
    return ans;
}

int main()
{
    fastinput;
    LL n,i,j,k,t,temp,tc;
    cin>>n;
    LL final=0;
    vector<LL> v;
    for(i=0;i<n;i++)
    {
        cin>>j;
        v.pb(j);
        final^=j;
    }

    for(i=0;i<n;i++)
    {
        LL ans=final^v[i];
        cout<<ans<<" ";
    }

    return 0;
}



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

using namespace std;

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

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main()
{
  int N;
  cin >> N;
  vector<int> t(N), x(N), y(N);
  REP(i, N)
  cin >> t[i] >> x[i] >> y[i];
  bool ok = true;
  REP(i, N)
  {
    if ((abs(x[i]) + abs(y[i])) % 2 != t[i] % 2)
      ok = false;
    if (t[i] < (abs(x[i]) + abs(y[i])))
      ok = false;
  }
  cout << (ok ? "Yes" : "No") << endl;
  return 0;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s, t;
    cin >> s >> t;
    sort(s.begin(), s.end());
    
    sort(t.begin(), t.end());
    reverse(t.begin(), t.end());
    
    if (s < t) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <queue>
#include <string>
#include <utility>

using namespace std;

int main() {
    size_t n;
    int qtime;
    scanf("%zu %d", &n, &qtime);

    queue<pair<string, int>> q;
    for (size_t i=0; i<n; ++i) {
        char buf[1<<4];
        int time;
        scanf("%s %d", buf, &time);
        string name(buf);
        q.push(make_pair(name, time));
    }

    for (int t=0; !q.empty();) {
        pair<string, int> p=q.front(); q.pop();
        if (p.second > qtime) {
            p.second -= qtime;
            t += qtime;
            q.push(p);
        } else {
            t += p.second;
            printf("%s %d\n", p.first.c_str(), t);
        }
    }
    return 0;
}

Measured memory_bytes: 5812
#include <bits/stdc++.h>
using namespace std;
#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 all(a) (a).begin(),(a).end()
#define lb(s,x) lower_bound(all(s),x)-s.begin()
#define ub(s,x) upper_bound(all(s),x)-s.begin()
#define uniq(a) a.erase(unique(all(a)),a.end())
#define debug(x) cout<<#x<<": "<<x<<endl
template<class T,class U>
ostream& operator<<(ostream& o, const pair<T,U> &p){
    o<<"("<<p.first<<", "<<p.second<<")";
    return o;
}
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
typedef long long ll;
const int INF = 1e9;
 
 
int main(void){
    string s;
    cin>>s;
    int n = s.size();
    if(s[0] == '0' || s[n-1] == '1'){
        cout<<-1<<endl;
        return 0;
    }
    
    rep(i,n/2){
        if(s[i] != s[n-2-i]){
            cout<<-1<<endl;
            return 0;
        }
    }
 
    int master = 1;
    rep(i,n-1){
        cout<<master<<" "<<i+2<<endl;
        if(s[i] == '1')master = i+2;
    }
    return 0;
}

Measured memory_bytes: 1664
c=int(input())
ii=input()
i=[]

iii=ii.split(" ")
count=0

#print(iii)
for z in iii:
  i.append(int(z))
#print(i)
  


while True:
  
  for j in i:
    if j%2==1:
      print(str(count))
      exit()
    else:
      continue
  for k in range(0,c):
    i[k]=i[k]/2
  #print(i)
  count=count+1


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

using namespace std;

typedef long long ll;

const int N = 1e5 + 500;

int a[N], n, k;
ll pref1[N], pref2[N];

ll get1(int l,int r){
    if(r < l) return 0;
    return pref1[r] - (l ? pref1[l - 1] : 0);
}

ll get2(int l,int r){
    if(r < l) return 0;
    return pref2[r] - (l ? pref2[l - 1] : 0);
}

int main(){
    scanf("%d%d", &n, &k);
    for(int i = 0;i<n;i++){
        scanf("%d", a + i);
        pref1[i] = (ll)a[i] + (i ? pref1[i - 1] : 0);
        pref2[i] = (ll)max(a[i], 0) + (i ? pref2[i - 1] : 0);
    }
    ll ans = 0;
    for(int i = 0;i<n - k + 1;i++){
        ans = max(max(0LL, get1(i, i + k - 1)) + get2(0, i - 1) + get2(i + k, n - 1), ans);
    }
    printf("%lld\n", ans);
}


Measured memory_bytes: 2176
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools

#幅優先探索（別ver）
def bfs(sx, sy):
  que = deque([[sy,sx]])
  D =  [(0,1), (1,0), (0,-1), (-1,0)]
  while que:
    y,x = que.popleft()
    for i,j in D:
      if(x+i<0 or y+j<0 or x+i>W-1 or y+j>H-1):
        continue
      dist = G[y+j][x+i]
      if(G[y+j][x+i] != "#"):
        if(type(G[y+j][x+i]) is str):
          G[y+j][x+i] = G[y][x]+1
          que.append([y+j,x+i])
        elif(dist>G[y][x]+1):
          G[y+j][x+i] = G[y][x]+1
          que.append([y+j,x+i])
  return


#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]

H,W = map(int,input().split())
G = [list(map(str, input())) for i in range(H)]
ans = 0
n = 0

#print(S)

for i in range(H):
    for j in range(W):
        if(G[i][j]=="."):
            n += 1
#print(n)
G[0][0] = 0
bfs(0,0)
#print(S)

if(type(G[H-1][W-1]) is str):
    ans = -1
else:
    ans = n - G[H-1][W-1]-1


print(ans)


Measured memory_bytes: 41836
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
#include<ctime>
#define up(i,x,y) for(int i = x;i <= y;i ++)
#define down(i,x,y) for(int i = x;i >= y;i --)
#define mem(a,b) memset((a),(b),sizeof(a))
#define mod(x) ((x)%MOD)
#define lson p<<1
#define rson p<<1|1
using namespace std;
typedef long long ll;
const int SIZE = 500010;
const int INF = 2147483640;
const double eps = 1e-8;

inline void RD(int &x)
{
    x = 0;  char c; c = getchar();
    bool flag = 0;
    if(c == '-')    flag = 1;
    while(c < '0' || c > '9')   {if(c == '-')   {flag = 1;} c = getchar();}
    while(c >= '0' && c <= '9') x = (x << 1) + (x << 3) + c - '0',c = getchar();
}
ll t;
ll a,b,c,d;
ll gcd(ll a,ll b){return b == 0 ? a : gcd(b,a%b);}
bool pd(ll a,ll b,ll c,ll d)
{
	if(a < b)	return false;
	ll r = a/b+2;
	ll l = 0;
	ll mid;
	while(l <= r)
	{
		mid = (l + r) / 2;
		if((a - mid*b) <= c)	r = mid - 1;
		else	l = mid + 1;
	}
	ll num = a - b * l;
	ll gc;
	gc = gcd(b,d);
	if(num < 0)	return false;
	if(b > d)	return false;
	if(c + gc < b)	return false;
	return true;
}

int main(int argc, char const *argv[])
{
	cin>>t;
	while(t--)
	{
		cin>>a>>b>>c>>d;
		if(pd(a,b,c,d))	cout<<"Yes"<<endl;
		else	cout<<"No"<<endl;
	}
	return 0;
}

/*
1
9 7 5 9

1
9 7 1 9
*/

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<queue>

using namespace std;

typedef long long ll;

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

struct edge {ll to,cost;};

typedef pair<ll,ll> P;

#define MAX_V 100000
#define INF (1e18)

ll V;
vector<edge> G[MAX_V];
ll d[MAX_V];

void dijkstra(ll s) {
    priority_queue<P,vector<P>,greater<P> > que;

    fill(d,d+V,INF);

    d[s] = 0;
    que.push(P(0,s));

    while(!que.empty()) {
        P p = que.top(); que.pop();
        ll v = p.second;

        if(d[v] < p.first)continue;

        for(auto e : G[v]) {
            if(d[e.to] > d[v] + e.cost) {
                d[e.to] = d[v] + e.cost;
                que.push(P(d[e.to],e.to));
            }
        }
    }
}

ll E,r;

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

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


Measured memory_bytes: 19484
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main(){
    string s;cin >> s;
    rep(i,s.size()-1){
        if(s[i]==s[i+1]){
            cout << i+1 <<" " <<i+2 <<endl;
            return 0;
        }
    }
    rep(i,s.size()-2){
        if(s[i]==s[i+2]){
            cout << i+1 <<" " <<i+3 <<endl;
            return 0;
        }
    }
    cout << -1 <<" " <<-1 <<endl;
}

Measured memory_bytes: 512