akhauriyash/Code-Regression huggingface dataset:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Pradyumn Agrawal coderbond007  PLEASE!! PLEASE!! HACK MY SOLUTION!!
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            char[] s = in.nextString().toCharArray();
            int n = s.length;
            StringBuilder stringBuilder = new StringBuilder();
            for (int i = 0; i < n; i += 2) {
                stringBuilder.append(s[i]);
            }
            out.println(stringBuilder.toString());
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int pnumChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        private int pread() {
            if (pnumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= pnumChars) {
                curChar = 0;
                try {
                    pnumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (pnumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public String nextString() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = pread();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        private boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        private static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}



Measured memory_bytes: 21332
# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

x,y = map(int,read().split())

for i in range(0,x+1):
    j = x-i
    if i*4+j*2==y:
        print("Yes")
        break
else:
    print("No")

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

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

Measured memory_bytes: 3624
from heapq import heappush, heappop
import collections
import math
import heapq
from collections import defaultdict
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
inf = float("inf")


def main():
    n, m = map(int, input().split())
    e = [[]for i in range(n)]
    for i in range(m):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        e[a].append(b)

    dp = [-1 for i in range(n)]
    def f(i):
        if dp[i] != -1:
            return dp[i]
        ret = 0
        for v in e[i]:
            ret = max(ret, f(v) + 1)
        dp[i] = ret
        return dp[i]

    ans = 0
    for i in range(n):
        ans = max(f(i), ans)
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 67716
#include<cstdio>
#include<cstring>
using namespace std;
int N,M;
int dist[105][105];
int Map[105][105];
bool vis[105][105];
const int inf=0x3f3f3f3f;
int main()
{
    while(scanf("%d%d",&N,&M)!=EOF)
    {
        memset(vis,0,sizeof(vis));
        memset(dist,inf,sizeof(dist));
        memset(Map,0,sizeof(Map));
        int u,v,w;
        for(int i=0;i<M;i++)
        {
            scanf("%d%d%d",&u,&v,&w);
            Map[u][v]+=w;
            dist[u][v]=dist[v][u]=0;
            dist[u][v]+=w;
            dist[v][u]+=w;
        }
        for(int i=1;i<=N;i++)
        {
            dist[i][i]=0;
        }
        for(int k=1;k<=N;k++)
        {
            for(int i=1;i<=N;i++)
            {
                for(int j=1;j<=N;j++)
                {
                    if(dist[i][j]>dist[i][k]+dist[k][j])
                    {
                        dist[i][j]=dist[i][k]+dist[k][j];
                        vis[i][j]=1;
                    }
                }
            }
        }
        int ans=0;
        for(int i=1;i<=N;i++)
        {
            for(int j=1;j<=N;j++)
            {
                //cout<<Map[i][j];
                if(Map[i][j])
                {
                    //cout<<'A'<<endl;
                    if((Map[i][j]>dist[i][j])&&vis[i][j])
                    {
                        ans++;
                    }
                }
            }
            //cout<<endl;
        }
        printf("%d\n",ans);
    }
}


Measured memory_bytes: 632
from collections import deque
#H...高さ、W...幅
H, W = map(int, input().split())

#G...迷路データ　H行連続取得
G = [list(input()) for i in range(H)]

#方向を準備 0...右、1...下、2...左、3...上
directions = [[0, 1], [1, 0], [0, -1], [-1, 0]]

ans = 0
for sh in range(H):
    for sw in range(W):
        #通れないマスはスタートになりえない
        if G[sh][sw] == '#':
            #continue...次のswに進める
            continue
        
        #BFS
        #H行W列の-1を準備
        dist = [[-1] * W for i in range(H)]
        #今いる場所を0とする
        dist[sh][sw] = 0
        #要素がsh, swの2つのキュー型変数を用意する
        que = deque([[sh, sw]])
        
        #queの中にデータが有ればtrue, なければfalseが返る
        #つまり、中にデータが有る限りwhileが回る。
        while que:
            #popは右から取り出す
            nh, nw = que.pop()
            
            
            for dh, dw in directions:
                #迷路からはみ出す = not 中にいる. 中にいる= 現在地＋移動量が、0以上、H-1,W-1以下
                if not ((0 <= nh + dh < H) and (0 <= nw + dw < W)):
                    continue
                    
                #移動先が通れないマス=#
                if G[nh + dh][nw + dw] == '#':
                    continue
                    
                #探索済み
                if dist[nh + dh][nw + dw] != -1:
                    continue
                
                #移動先の数字を出発地＋１にする
                dist[nh + dh][nw + dw] = dist[nh][nw] + 1
                #queの左側に「移動先」を追加
                que.appendleft([nh + dh, nw + dw])
                
                                
        ans = max(ans, max([max(d) for d in dist]))
print(ans)

Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;

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

int main(){
  int N;
  int X;
  cin >> N >> X;
  int x[N+1],diff[N-1];
  for(int i = 0; i < N; i++)  cin >> x[i];
  x[N] = X;
  sort(x, x+N+1);

  int minmum = MOD;
  for(int i = 0; i < N; i++){
    diff[i] = x[i+1] - x[i];
    minmum = min(diff[i], minmum);
  }

  vector<ll> div = divisor(minmum);
  ll size = div.size();
  int ans = 1;
  for(int i = size - 1; i >= 0; i--){
    ans = div[i];

    bool itIsAnswer = true;
    for(int j = 0; j < N; j++){
      if(diff[j]%ans != 0)
        itIsAnswer = false;
    }
    if(itIsAnswer)  break;
  }

  cout << ans << "\n";
  return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <algorithm>
 
using namespace std;
 
int main(){
 	string added_symbol[] = {"dream","dreamer","erase","eraser" };
  	string s;
   	cin >> s;
  	
	reverse(s.begin(), s.end());
  	for(int i=0; i<4; i++) reverse(added_symbol[i].begin(), added_symbol[i].end());
  	bool judge;
  	for(int i=0; i<s.length();){
      	judge = false;
  		for(int j=0; j<4; j++){
          string temp = added_symbol[j];
          s.substr(i, temp.size());
          if(s.substr(i, temp.size()) ==  temp ){
            i+=added_symbol[j].length();
            judge = true;
          }
        }
      
      	if(judge == false) break;
    }
  
  	if(judge){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
}

Measured memory_bytes: 512
### 解説AC ###
def root(x):
    if r[x] < 0:
        return x
    else:
        r[x] = root(r[x])
        return r[x]

def unite(x, y):
    x = root(x)
    y = root(y)
    if x != y:
        if r[x] > r[y]:
            x,y = y,x
        r[x] += r[y]
        r[y] = x

def size(x):
    return -r[root(x)]
 
n,m = map(int,input().split())
r = [-1] * n 
for i in range(m):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    unite(a,b)
ans = 0
for i in range(n):
    ans = max(ans,size(i))
print(ans)

Measured memory_bytes: 14700
#include <iostream>
using namespace std;
int main() {
    int N,max=0,sum=0;
    cin >> N;
    int L[N];
    for (int i=0; i<N; i++) {
        cin >> L[i];
        if (max < L[i]) max = L[i];
    }
    bool flg = true;
    for (int i=0; i<N; i++) {
        if (max == L[i] && flg == true) {
            flg = false;
        } else {
            sum += L[i];
        }
    }
    if (max < sum)
        cout << "Yes" << endl;
    else
        cout << "No"  << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define CFS           \
    cin.tie(nullptr); \
    ios::sync_with_stdio(false);
#define CST(x) cout << fixed << setprecision(x);
using namespace std;
const int IINF = 1 << 30;
const long LINF = 1LL << 60;
const int MOD = (int)1e9 + 7;
// const int MOD = 998244353;

int main()
{
    int n, x, y;
    cin >> n >> x >> y;
    x--;
    y--;
    vector<int> ans(n - 1, 0);
    for (int i = 0; i < n - 1; i++) {
        for (int j = i + 1; j < n; j++) {
            int d = min(j - i, abs(x - i) + abs(y - j) + 1);
            ans[d - 1]++;
        }
    }
    for (const auto x : ans) {
        cout << x << "\n";
    }
}

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

#define rep(i,n) for (int i = 0; i< (n); ++i)
#define vvec(m,n) vector<vector<int>> (int(m), vector<int>(n))
#define ALL(a) (a).begin(), (a).end()

using ll = long long;

int main(){
    int a, b;
    cin >> a >> b;
    int ans = 0;
    if(a == 1){
        if(b == 2){
            ans = 3;
        }else{
            ans = 2;
        }
    }else if(a == 2){
        if(b == 1){
            ans = 3;
        }else{
            ans = 1;
        }
    }else{
        if(b == 1){
            ans = 2;
        }else{
            ans = 1;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
lis = list(input())
cou = 0
ans = 0
for i in range(len(lis)):
	if lis[i] == "g":
		if cou > 0:
			cou -= 1
			ans += 1
		else:
			cou += 1
	else:
		if cou > 0:
			cou -= 1
		else:
			cou += 1
			ans -= 1
print(max(0,ans))


Measured memory_bytes: 3956
import Text.Printf

solve :: [Double] -> String
solve [a,b,c,d,e,f] = printf "%.3f %.3f" (s $ (c*e-b*f)/(a*e-b*d)) (s $ (a*f-c*d)/(a*e-b*d))
  where s :: Double -> Double
        s = (/ 1000) . fromIntegral . round . (* 1000)

main = getContents >>= mapM_ putStrLn . map solve . map (map read . words) . lines

Measured memory_bytes: 4488
a = []
a[0] = gets.to_i
a[1] = gets.to_i
a[2] = gets.to_i
a[3] = gets.to_i
a[4] = gets.to_i
k = gets.to_i

flag = true
5.times { |i|
  5.times { |j|
    if a[i] > a[j]
      if a[i] - a[j] > k
        flag = false
      end
    end
  }
}

if flag
  puts "Yay!"
else
  puts ":("
end

Measured memory_bytes: 1788
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<functional>
#include<math.h>
#include<random>
#include <bitset>
#include <deque>
using namespace std;
//#define N (1000000000+7)
#define N 998244353
#define INF 1e16
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> Q;
typedef vector<ll> vec;
typedef vector<vec> mat;
const int inf = (int)1e9; 
 
ll gcd(ll a, ll b) {
	if (b > a) {
		ll tmp = b;
		b = a;
		a = tmp;
	}
	if (a%b == 0)return b;
	else return gcd(b, a%b);
}


int main(void){
	ll n,x,m;
	cin>>n>>x>>m;
	if(x==0){
		cout<<0<<endl;
		return 0;
	}
	if(x==1){
		cout<<n<<endl;
		return 0;
	}
	set<ll>s1;
	vector<ll>s;
	ll t = x;
	while(true){
		if(s1.count(t)==0){
			s1.insert(t);
			s.push_back(t);
		}
		else break;
		t = (t*t)%m;
		//cout<<t<<endl;
	}
	if(t==0){
		ll ans = 0;
		ll num = 0;
		for(auto y:s){
			ans+=y;
			num++;
			if(num==n){
				cout<<ans<<endl;
				return 0;
			}
		}
		cout<<ans<<endl;
		return 0;
	}
	vector<ll>seq;
	bool flag = false;
	ll ans = 0;
	ll num = 0;
	for(int i=0;i<s.size();i++){
		int y = s[i];
		if(flag){
			seq.push_back(y);
		}
		else{
			if(y==t){
				seq.push_back(y);
				flag = true;
			}
			else{
				ans+=y;
				num++;
				if(num==n){
					cout<<ans<<endl;
					return 0;
				}
			}
		}
	}
	vector<ll>sum(seq.size()+1);
	for(ll i=0;i<seq.size();i++){
		sum[i+1] = sum[i]+seq[i];
	}
	n-=num;
	ll R = seq.size();
	ll ti = n/R;
	ll q = n%R;
	cout<<ans+sum[R]*ti+sum[q]<<endl;
	return 0;
}


Measured memory_bytes: 6712
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define N 500000
#define DUMMY 2000000001

struct Node{
  int key;
  struct Node *left,*right;
};

struct Node *make_node(int x){
  struct Node *node = malloc(sizeof(struct Node));
  if(node != NULL){
    node->key = x;
    node->left = NULL;
    node->right = NULL;
  }
  return node;
}

struct Node *root;

struct Node *insert(int,struct Node*);
void insort(struct Node*);
void presort(struct Node*);

int main(void){
  int m,n=0;
  int i;
  int k;
  char order[7];

  root = NULL;

  scanf("%d",&m);

  for(i=0;i<m;i++){
    scanf("%s",order);
    if(strcmp(order,"insert") == 0){
      scanf("%d",&k);
      root = insert(k,root);
    }else if(strcmp(order,"print") == 0){
      insort(root);
      printf("\n");
      presort(root);
      printf("\n");
    }
  }
}

struct Node *insert(int key,struct Node *node){
  if (node == NULL)
    return make_node(key);
  else if (key < node->key)
    node->left = insert(key, node->left);
  else if (key > node->key)
    node->right = insert(key, node->right);
  return node;
}

void insort(struct Node *node){

  if(node == NULL) return;

  insort(node->left);

  printf(" %d",node->key);

  insort(node->right);
}

void presort(struct Node *node){

  if(node == NULL) return;

  printf(" %d",node->key);
  
  presort(node->left);
  presort(node->right);
}


Measured memory_bytes: 17336
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define mp  make_pair
#define pb  push_back
void c_p_c(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
void solve(){
    int n;
    cin>>n;
    if(n%1000==0){
    cout<<n%1000<<endl;
    return;
    }
    int r=1000-(n%1000);
    cout<<r<<endl;
    return;
}
int32_t main(){
    c_p_c();
    int t;
    t=1;
    //cin>>t;
    while(t--){
       solve(); 
    }
	return 0;
}


Measured memory_bytes: 3604
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		
		String ans = "NO";
		for (int i = a; i < a * b; i += a) {
			if (i % b == c) {
				ans = "YES";
				break;
			}
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 23124
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
#include <cmath>
#include <complex>
#include <map>
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-10
#define F first
#define S second

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<double,double> P;
static const int INF=1<<24;

int main(){
	int n;
    double x[4],y[4];
    cin>>n;
    for(;n--;){
        for(int i=0;i<4;i++){
            cin>>x[i];
            cin>>y[i];
        }
        if(abs((x[0]-x[1])*(y[2]-y[3])-(x[2]-x[3])*(y[0]-y[1]))<=EPS){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}
	

Measured memory_bytes: 1224
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <utility>
#include <set>
#include <map>
#include <tuple> 
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <list>
using namespace  std;
typedef pair<long long , long long> P;
typedef long long ll;
typedef long long lint;
#define REP(i, n) for(long long (i)=0; (i)<(n); ++i)
#define FOR(i, a, b) for(long long (i)=(a); (i)<(b); ++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
const long long MOD = static_cast<long long>(1e9) + 7LL;
const long long INF = 1234567891234567890LL;
signed main(){
    string s;
    cin>>s;
    int N = s.size();
    vector<vector<int>> dp(N+1, vector<int>(13));
    if(s[0]=='?'){
        REP(i, 10) dp[0][i] = 1;
    }
    else dp[0][s[0]-'0'] = 1;
    for(int i=1; i<N; i++){
        if(s[i]!='?'){
            int x = s[i]-'0';
            REP(j, 13) {
                int y = (j*10+x)%13;
                dp[i][y] = (dp[i][y] + dp[i-1][j])%MOD;
            }
        }
        else{
            REP(x, 10){
                REP(j, 13){
                    int y = (j*10+x) % 13;
                    dp[i][y] = (dp[i][y] + dp[i-1][j])%MOD;
                }
            }
        }
    }
    cout << dp[N-1][5] << endl;
    return 0;
}

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

using namespace std;

const long long MOD = 1000000007;
const long long MAX = 2000000;
long long gcd(long long a, long long b) {
    return b != 0 ? gcd(b, a % b) : a;
}
long long lcm(long long a, long long b) {
    return a * b / gcd(a, b);
}
// a x + b y = gcd(a, b)
long long extgcd(long long a, long long b, long long &x, long long &y) {
    long long g = a; x = 1; y = 0;
    if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x;
    return g;
}

int main() {
   long long N;
   cin>>N;
   long long a[N];
   for(int i=0;i<N;i++) {
       cin >> a[i];
   }
   int now=1;
   int sum=0;
   for(int i=0;i<N;i++){
       if(a[i]==now){
           now++;
       }
   }
   if(now==1){
       cout<<-1<<endl;
   }else{
       cout<<N-(now-1)<<endl;
   }








}


Measured memory_bytes: 1792
#include <cstdio>
#include <algorithm>
#include <vector>
#include <tuple>

using namespace std;

using ll = long long;
vector<tuple<ll, ll>> sushis;
ll dp_cw[100000] = {0};
ll dp_ccw[100000] = {0};

int main()
{
  int n;
  ll c;
  scanf("%d %lld", &n, &c);
  for (int i = 0; i < n; i++) {
    ll x;
    ll v;
    scanf("%lld %lld", &x, &v);
    sushis.push_back(make_tuple(x, v));
  }
  ll energy;
  ll max_possible;
  energy = 0;
  max_possible = 0;
  for (int i = 0; i < n; i++) {
    energy += get<1>(sushis[i]);
    max_possible = max(max_possible, energy - get<0>(sushis[i]));
    dp_cw[i] = max_possible;
    // printf("dp_cw[%d] = %d;\n", i, dp_cw[i]);
  }
  energy = 0;
  max_possible = 0;
  for (int i = n-1; 0 <= i; i--) {
    energy += get<1>(sushis[i]);
    max_possible = max(max_possible, energy - (c - get<0>(sushis[i])));
    dp_ccw[i] = max_possible;
    // printf("dp_ccw[%d] = %d;\n", i, dp_ccw[i]);
  }
  ll max_energy = 0;
  for (int i = 0; i < n; i++) {
    max_energy = max(max_energy, dp_cw[i]);
    if (i+1 < n)
      max_energy = max(max_energy, dp_cw[i]-get<0>(sushis[i])+dp_ccw[i+1]);
    max_energy = max(max_energy, dp_ccw[i]);
    if (0 <= i-1)
      max_energy = max(max_energy, dp_ccw[i]-(c-get<0>(sushis[i]))+dp_cw[i-1]);
  }
  printf("%lld\n", max_energy);
  return 0;
}


Measured memory_bytes: 3440
a = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
b = [int(input()) for i in range(N)]
for k in range(N):
    for i in range(3):
        for j in range(3):
            if a[i][j] == b[k]:
                a[i][j] = 0

ans = 'Yes'
for i in range(3):
    cnt = 0
    for j in range(3):
        if a[i][j] != 0:
            break
        else:
            cnt += 1
    if cnt == 3:
        break
        
if cnt == 3:
    print(ans)
    exit()

for i in range(3):
    cnt = 0
    for j in range(3):
        if a[j][i] != 0:
            break
        else:
            cnt += 1
    if cnt == 3:
        break

if cnt == 3:
    print(ans)
    exit()

if a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0:
    print('Yes')
    exit()

if a[0][2] == 0 and a[1][1] == 0 and a[2][0] == 0:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3064
#pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma") 
 
#include<bits/stdc++.h>
 
#define CFOR(i, str) for(int i = 0; (str)[i]!='\0'; (i)++)
#define FOR(i, s, r) for(int i = (s); i < (r); i++)
#define INF 1e9
#define NINF -1e9
#define SUM(a) accumulate(a.begin(), a.end(), 0)
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v) sort(v.rbegin(), v.rend())
#define vmax(v) *max_element(v.begin(), v.end())
#define vmin(v) *min_element(v.begin(), v.end())
#define cnt(v, n) count(v.begin(), v.end(), (n))
#define vi vector<int>
#define vvi vector<vi>
#define vvvi vector<vvi>
#define vpii vector<pair<int, int>>
#define vpic vector<pair<int, char>>
#define mp make_pair
#define rot(s, k) rotate(s.begin(), s.begin()+ s.size()-(k%s.size()), s.end()); //+ve = right, -ve = left
#define lld long long int
#define ulld unsigned long long int
typedef long long ll;
using namespace std;
 
ll binpow(ll a, ll b) { 
ll res = 1; while (b > 0) { if (b & 1) res = res * a; a = a * a; b >>= 1; } return res;
}
 
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
 
bool isPrime(ll n) { 
    if (n <= 1) return false; 
    if (n <= 3) return true; 
    if (n % 2 == 0 || n % 3 == 0) return false; 
    for (ll i = 5; i * i <= n; i = i + 6) if (n % i == 0 || n % (i + 2) == 0) return false; 
    return true; 
}
void solve(){
      int n;
	  cin>>n;
	  int arr[n],arr1[n];
	  int min1=INT_MAX;
	  for(int i=0;i<n;i++)
	  {
		  cin>>arr[i];
		  min1=min(arr[i],min1);
		  arr1[i]=min1;
	  }
	  int count=0;
	  for(int i=0;i<n;i++)
	  {
        if(arr[i]==arr1[i])
		count++;
	  }
	  cout<<count<<"\n";
}
int main(){
   ios::sync_with_stdio(0);
   cin.tie(0);
   ll t;
   t=1;
   while(t--)
   { 
   solve();
   }
   return 0;
}

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

int main(){
	ll n, W;
	cin>>n>>W;
	vector<ll> w(n);
	vector<ll> v(n);
	ll i;
	for(i=0;i<n;i++)
		cin>>w[i]>>v[i];
	vector<vector<ll>> dp(n+1, vector<ll>(W+1));
	for(i=0;i<=n;i++){
		for(ll j=0;j<=W;j++){
			if(i==0 || j==0)
				dp[i][j] = 0;
			else if(w[i-1]<=j){
				dp[i][j] = max(v[i-1]+dp[i-1][j-w[i-1]], dp[i-1][j]);
			}
			else
				dp[i][j] = dp[i-1][j];
		}
	}
	cout<<dp[n][W]<<"\n";
	return 0;
}

Measured memory_bytes: 83148
def main():
    nums = list(map(int, input().split()))

    # res = 0

    # while len(set(nums)) != 1:
    #     maxIdx = nums.index(max(nums))
    #     minIdx = nums.index(min(nums))

    #     if nums[maxIdx] - nums[minIdx] >= 2:
    #         nums[minIdx] += 2
    #         res += 1
    #     else:
    #         nums[minIdx] += 1
    #         nums[nums.index(min(nums))] += 1

    #         res += 1
    
    # print(res)
    M = max(nums)
    diff = 3 * M - sum(nums)

    print((diff) // 2) if diff%2 == 0 else print((3*M+3-sum(nums))//2)


if __name__ == '__main__':
    main()

Measured memory_bytes: 9052
#include <cassert>
#include <algorithm>
#include <array>
#include <bitset>
#include <cctype>
#include <cstdint>
#include <cmath>
#include <complex>
#include <chrono>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#include <random>
#include <memory>
#include <utility>
#include <limits>
 
#define rep(i, a, b) for (long long i = (a); (i) < (b); (i)++)
#define all(i) i.begin(), i.end()
#define debug(...) std::cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

void debug_out(){std::cerr<<std::endl;}

template<typename Head,typename... Tail>
void debug_out(Head h,Tail... t){
  std::cerr<<" "<<h;
  debug_out(t...);
}
 
template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, std::pair<T1, T2> pa) {
  return os << pa.first << " " << pa.second;
}
 
template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
  for (int i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  return os;
}
 
template<typename T1,typename T2>
inline bool chmax(T1& a,T2 b){return a<b && (a=b,true);}
 
template<typename T1,typename T2>
inline bool chmin(T1& a,T2 b){return a>b && (a=b,true);}
 
long long pow_mod(long long a, long long b, long long mod=-1) {
  if(b==0)return 1;
  if ((a == 0)||(mod!=-1&&(a+mod)%mod==0))return 0;
  long long x = 1;
  while (b > 0) {
    if (b & 1)x = (mod!=-1)?(x * a) % mod:x*a;
    a = (mod!=-1)?(a * a) % mod:a*a;
    b >>= 1;
  }
  return x;
}

// const long long MOD = 998244353;
const long long MOD = 1e9 + 7;

using ll = long long;
using P=std::pair<long long,long long>;

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

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

  ll a,b,c,d;
  std::cin>>a>>b>>c>>d;

  ll lcm=c/gcd(c,d)*d;

  a--;

  std::cout<<b-a-b/c+a/c-b/d+a/d+b/lcm-a/lcm<<"\n";


  return 0;
}



Measured memory_bytes: 256
#include<stdio.h>

int main(void){
	double r, f1, f2;
	scanf("%lf", &r);
	f2 = 2 * 3.141592653589 * r;
	f1 = 3.141592653589 * r * r;
	printf("%f %f\n", f1, f2);
	return 0;
}


Measured memory_bytes: 2100
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define REP3(i,x,n) for(int i=x; i>(n); i--)
#define zero_pad(num) setfill('0') << std::right << setw(num)
#define space_pad(num) setfill(' ') << std::right << setw(num)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main(){
    string S;
    cin >> S;
    deque<char>q;
    for(char c:S)q.push_back(c);
    bool flip = false; //逆転動作がされているか
    int Q;
    cin >> Q;
    REP(qi,Q){
        int ty;
        cin >> ty;
        if(ty == 1){
            flip = !flip;
        }else{
            int f;
            char c;
            cin >> f >> c;
            if(flip) f = 3-f;
            if(f == 1){
                q.push_front(c);
            }else{
                q.push_back(c);
            }
        }
    }
    if(flip) reverse(ALL(q));
    string ans;
    for(char c:q) ans += c;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1368
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

#define N 200000

int upchar(const void* left, const void* right){
  return strcmp( (char*)left, (char*)right );
}

void main(){
  int n, cnt=1;
  char s[N][11];
  scanf("%d",&n);
  for(int i=0; i<n; i++)
    scanf("%s",&s[i]);

  qsort(s, n, sizeof(char)*11, upchar);
  
  for(int i=1; i<n; i++){
    if(strcmp( s[i-1], s[i] ) != 0)
      cnt++;
  }
  
  printf("%d",cnt);
}

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

#define MOD 1000000007
typedef unsigned long long ull;

int A = 0;
int B = 0;
string S = "";
string T = "";
string U = "";


int main() {
  cin >> S >> T >> A >> B >> U;

  if (S == U) {
      A--;
  } else {
      B--;
  }

  cout << A << " " << B;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define LL long long
#define maxn 100005

using namespace std;

int main()
{
    int l,r,d;
    cin>>l>>r>>d;
    int a1=(l-1)/d;
    int a2=(r)/d;
    cout<<a2-a1<<endl;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n,x) for(int i=(n);i<(x);++i)
#define SORT(x) sort(x.begin(),x.end())
using ll = long long;

int main() {
	vector<int> num(3); rep(i, 0, 3) cin >> num[i];

	int ans = 0;
	SORT(num);
	int dif = num[2] - num[1];
	if (dif) {
		num[0] += dif; num[1] += dif;
		ans += dif;
	}
	dif = num[1] - num[0];
	while (dif > 0) {
		num[0] += 2;
		dif -= 2; ans++;
	}

	if (num[0] == num[1] && num[1] == num[2]) cout << ans << endl;
	else cout << ans + 1 << endl;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<sstream>
#include<vector>
#include<algorithm>
#include<string>
#include<stdexcept>
#include<stdio.h>
#include<queue>
using namespace std;
int main(){
  int s; cin >> s;
  int a[1000009]; int ans=0;
  a[0]=s; bool w=false;
  
  for(int i=0;i<10e8;i++){
   if(a[i]%2==0) a[i+1]=a[i]/2;
   if(a[i]%2==1) a[i+1]=3*a[i]+1;
   ans++;
    for(int j=0;j<i-1;j++){
      if(a[i]==a[j]) w=true;
    }
    if(w) break;
  }
  cout << ans <<endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
const int N=100010;
int a[N],d1[N],d2[N],n;
int main() {
    cin>>n ; for(int i=1;i<=n;++i) cin>>a[i] ;
    int len1=1,len2=1;      
    d1[1]=a[1];   
    d2[1]=a[1];  
    for(int i=2; i<=n; i++) {  
        if(d1[len1]>=a[i])d1[++len1]=a[i]; 
        else {     
            int p1=upper_bound(d1+1,d1+1+len1,a[i],greater<int>())-d1;
            d1[p1]=a[i]; 
        }
        if(d2[len2]<a[i])d2[++len2]=a[i];    
        else {
            int p2=upper_bound(d2+1,d2+1+len2,a[i])-d2;
            d2[p2]=a[i];
        }
        //cout<<"# ";
        //for(int i=1;i<=len1;++i) cout<<d1[i]<<" ";
        //cout<<endl ;
    }
    cout<<len1<<endl ;    
    return 0;   
}

Measured memory_bytes: 1024
#include<cstdio>
const int N=1e5+10;
char s[N];
int n,ans=1;
int main()
{
	scanf("%d%s",&n,s);
	for(int i=1;i<n;i++)
		if(s[i]!=s[i-1])ans++;
	printf("%d",ans);
	return 0;
}

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

using namespace std;

const long long MAX = 1e9 + 10;

int a[200];

int main()
{	
	int n; cin>>n;
	for(int i=0;i<n;i++) cin>>a[i];
	long long ans=MAX;	
	for(int i=-100;i<=100;i++) {
		long long tans=0;
		for(int j=0;j<n;j++) {
			tans += (i-a[j])*(i-a[j]);
		}
		ans = min(ans,tans);
	}
	cout<<ans;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[500],b[500],c[500],day[500],d,n,ans[500][500],fans;

int main(){
    cin >> d >> n;
    for(int i=0;i<d;i++)cin >> day[i];
    for(int i=0;i<n;i++)cin >> a[i] >> b[i] >> c[i];

    for(int i=1;i<d;i++){
        for(int j=0;j<n;j++){
            if(a[j]<=day[i]&&day[i]<=b[j]){
                for(int k=0;k<n;k++){
                if(a[k]<=day[i-1]&&day[i-1]<=b[k])ans[i][j]=max(ans[i][j],ans[i-1][k]+max(c[j],c[k])-min(c[j],c[k]) );
                }
            }
        }
    }

    for(int i=0;i<n;i++)fans=max(fans,ans[d-1][i]);

    cout << fans << endl;

return 0;
}

Measured memory_bytes: 1560
#include"bits/stdc++.h"

using namespace std; 

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef pair<LL, LL> PLL;
typedef vector<PLL> VPLL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_ASC;
typedef priority_queue<PII> PQ_DESC_PII;
typedef priority_queue<PII, vector<PII>, greater<PII>> PQ_ASC_PII;

#define ALL(c) (c).begin(),(c).end()
#define PB push_back
#define MP make_pair
#define SORT_ASC(c) sort(ALL(c))
//#define SORT_DESC(c) sort(ALL(c), greater<typeof(*((c).begin()))>())
#define SORT_DESC(c) sort((c).rbegin(),(c).rend())
#define REV(c) reverse((c).begin(), (c).end())
#define SIZE(a) int((a).size())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ROF(i,a,b) for(int i=(b-1);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define PER(i,n) ROF(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int LARGE_INT = 1e9+100;
const int INF = 2e9+100;
const LL INF_LL = (LL)INF * 300 * 300;
const int MOD = 1e9+7;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

LL modpow(LL a, LL n) {
    LL res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

void Main()
{
    LL a,b,c,k;cin>>a>>b>>c>>k;

    LL result = 0;
    result += min(a,k);
    k-=a;
    k-=b;
    if(k>0){
        result -= min(c,k);
    }
    cout<<result<<endl;
	return;
}

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

Measured memory_bytes: 3652
#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<memory.h>
#include<set>
#include<sstream>
#include<map>
using namespace std ;
#define ll long long 
#define all(x) x.begin() , x.end()
#define pb push_back
const int N = 1e5+19;
int n ;
ll v[N] , cnt , e , o ;
string ans ; 
int main(){
  // freopen("input.txt","r",stdin);
     scanf("%d",&n);
     for (int i = 0; i < n ; ++i)
     {
     	scanf("%lld",v+i);
        if(v[i]%4==0)++cnt;
        if(v[i]%2!=0)++o;
     }
   if(o+cnt==n)
   {
   	++cnt;
   	if(o<=cnt)puts("Yes");
   	else puts("No");
   	return 0;
    }
    if(o<=cnt)puts("Yes");
    else puts("No");
}


Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const double pi = acos(-1);

struct Edge {
    ll to, cost;
    Edge(ll to, ll cost): to(to), cost(cost) {}
};

struct Data {
    ll v, i, x;  // いまいる頂点v, 進んだ距離を3で割った余りi, 進んだ距離x
    Data(ll v, ll i, ll x): v(v), i(i), x(x) {}
    bool operator<(const Data& hoge) const {
        return x > hoge.x;
    }
};

int main() {
    ll n, m;
    cin >> n >> m;    
    
    vector<vector<Edge>> G(n);
    rep(i, m) {
        ll a, b;
        cin >> a >> b;
        a--;  b--;
        G[a].emplace_back(b, 1);
    }

    ll sv, gv;
    cin >> sv >> gv;
    sv--;  gv--;

    vvl dp(n, vl(3, INF));  // dp[v][i] : 頂点vまでの3で割った余りがiとなる距離の最小値
    priority_queue<Data> Q;
    auto push = [&](ll v, ll i, ll x) {
        if(dp[v][i] <= x) {
            return;
        }
        dp[v][i] = x;
        Q.emplace(v, i, x);
    };
    
    // 拡張ダイクストラ法。計算量はO((V+E)*log(V))
    push(sv, 0, 0);
    while(!Q.empty()) {
        Data hoge = Q.top();  Q.pop();
        ll v = hoge.v, i = hoge.i, x = hoge.x;
        if(dp[v][i] != x) {
            continue;
        }
        for(Edge e : G[v]) {
            push(e.to, (i + e.cost)%3, x + e.cost);
        }
    }

    if(dp[gv][0] == INF) {
        out(-1);
    }
    else {
        out(dp[gv][0]/3);
    }

    re0;
}

Measured memory_bytes: 14348
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int i,j,n,a[300000],b[300000],c[300000];
void qt(int l,int r)
{
    int i,j,m,p;
    i=l; j=r;
    m=a[(l+r)/2];
    while (i<=j)
    {
        while (a[i]<m) i++;
        while (a[j]>m) j--;
        if (i<=j)
        {
            p=a[i];a[i]=a[j]; a[j]=p;
            p=b[i]; b[i]=b[j]; b[j]=p;
            i++; j--;
        }
    }
if (i<r) qt(i,r);
if (l<j) qt(l,j);
}

int main()
{
    scanf("%d",&n);
    for (i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        b[i]=i;
    }
    qt(1,n);
    for (i=1;i<=n;i++)
        c[b[i]]=i;
    for (i=1;i<=n;i++)
    {
        if (c[i]<=(n/2)) printf("%d\n",a[(1+n)/2+1]); else printf("%d\n",a[(1+n)/2]);
    }
    return(0);
}


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

int main(){
	int n;
	cin>>n;
	
	if(n<10)
	{
		cout<<n;
		return 0;
	}
	else if(n>=10 && n<=99)
	{
		cout<<9;
		return 0;
	}
	else if(n>=100 && n<=999)
	{
		cout<<9+n-100+1;
		return 0;
	}
	else if(n>=1000 && n<=9999)
	{
		cout<<909<<endl;
		return 0;
	}
	else if(n>=10000 && n<=99999)
	{
		cout<<909+n-10000+1;
		return 0;
	}
	else if(n==100000)
	{
		cout<<90909<<endl;
		return 0;
	}
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<n;i++)
#define ALL(a) (a).begin(),(a).end()

bool compare_pair(pair<int, int> a, pair<int, int> b){
    if(a.first == b.first){
        return a.first > b.first;
    }else{
        return a.second < b.second;
    }
}

int main(){
    int n, t;
    cin >> n >> t;
    vector<pair<int, int>> c(n);
    rep(i, n)cin >> c[i].first >> c[i].second;

    sort(ALL(c), compare_pair);

    int ans = 10000;
    int no = 0;
    while(c[no].second <= t  && no < n)ans = min(ans, c[no++].first);
    if(ans == 10000)cout << "TLE";
    else cout << ans;
}


Measured memory_bytes: 256
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>

#define rep(i, a, b) for(int (i)=(a); (i)<(b); (i)++)
#define irep(i, a, b) for(int (i)=(a);(i)<=(b);(i)++)
#define rrep(i, a, b) for(int (i)=(a);(i)>=(b);(i)--)

using namespace std;

const int MOD = 1e9 + 7;

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, 0, n)
        cin >> a[i];

    sort(a.begin(), a.end(), greater<int>());
    
    vector<long long> ans;
    rep(i, 0, n - 1) {
        if (ans.size() == 2)
            break;
        if (a[i] == a[i + 1]) {
            ans.push_back(a[i]);
            i++;
        }
    }
    cout << (ans.size() == 2 ? ans[0] * ans[1] : 0) << endl;
    return 0;

}

Measured memory_bytes: 640
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };


int main() {
	int N;
	scanf("%d", &N);

	printf("%d", 3 * N*N);




}

/*         提出前の確認事項

・デバッグ用の関数は＜＜コメント化＞＞しているか？
・すべての＜＜入力例＞＞は試したか？
・＜＜限界値分析＞＞はしたか？
・＜＜出力の改行＞＞の有無は確認したか？
　　　　　　　　↓
	 ＜＜提出先＞＞に注意して提出！！
*/

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

public class Main {

	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(
				System.in));
		StringBuilder builder = new StringBuilder();
		String line;

		while ((line = reader.readLine()) != null) {
			if (line.isEmpty())
				break;
			StringTokenizer tokenizer = new StringTokenizer(line);
			int a = Integer.parseInt(tokenizer.nextToken());
			int b = Integer.parseInt(tokenizer.nextToken());
			int c = Integer.parseInt(tokenizer.nextToken());

			int count = 0;
			for (int i = 1; i < 11; i++) {
				if (i != a && i != b && i != c) {
					if (a + b + i < 21) {
						count++;
					}
				}
			}
			System.out.println(count > 3 ? "YES" : "NO");
		}
	}
}

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

int main() {
  int N;
  cin >> N;
  
  if (N < 105)
    cout << 0 << endl;
  else if (N < 135)
    cout << 1 << endl;
  else if (N < 165)
    cout << 2 << endl;
  else if (N < 189)
    cout << 3 << endl;
  else if (N < 195)
    cout << 4 << endl;
  else
    cout << 5 << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
#define abs(x) (x >= 0 ? x : -(x))
#define ceil(a, b) a / b + !!(a % b)
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }
ll pow(ll a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }


int main() {
    
    int n, m;
    cin >> n >> m;
    
    int table[100001] = {0}; // key = id, val = gate
    rep(i, m) {
        int l, r;
        cin >> l >> r;
        table[l]++;
        table[r + 1]--;
    }
    rep3(i, 1, n + 1) table[i] += table[i - 1];
    
    int c = 0;
    rep(i, n + 1) if (table[i] == m) c++;
    cout << c << '\n';
}


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

#define rep(i, j) for (int i = 0; i < j; i++)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<pii> vpii;


int n, x, y, z, l, ng;
ll dp[41][1 << 16], ans;
const int mod = 1e9 + 7;

int main() {

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;

    int n, k;
    cin >> n >> k;
    vi d(k);
    rep(i, k) cin >> d[i];

    for(int i=n; ; i++) {
        string s = to_string(i);
        bool ok = true;
        rep(i, s.size()) if (find(all(d), s[i] - '0') != d.end()) {
            ok = false;
            break;
        }
        if (ok) {
            cout << i << endl;
            return 0;
        }
    }

    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
const ll INF=1e16;
const int MAX=1e7+5;
bool isprime[MAX];
 
void sieve(){
	for(int i=3; i<MAX; i+=2){
		isprime[i]=1;
	}
	isprime[2]=1;
	for(int i=3; i<MAX; i++){
		if(isprime[i]){
			for(int j=2*i; j<MAX; j+=i){
				isprime[j]=0;
			}
		}
	}
	return;
}

struct edge {int to; long long int cap; int rev;} ;
 
vector<edge> G[202];
int level[202];
int iter[202];
 
void add_edge(int from, int to, long long int cap){
	edge e;
	e.to=to, e.cap=cap, e.rev=G[to].size();
	G[from].push_back(e);
	e.to=from, e.cap=0, e.rev=G[from].size()-1;
	G[to].push_back(e);
}
 
void bfs(int s){
	memset(level, -1, sizeof(level));
	queue<int> que;
	level[s]=0;
	que.push(s);
	while(!que.empty()){
		int v=que.front();
		que.pop();
		for(int i=0; i<G[v].size(); i++){
			edge e=G[v][i];
			if(e.cap>0 && level[e.to]<0){
				level[e.to]=level[v]+1;
				que.push(e.to);
			}
		}
	}
}
 
long long int dfs(int v, int t, long long int f){
	if(v==t) return f;
	for(int &i=iter[v]; i<G[v].size(); i++){
		edge &e=G[v][i];
		if(e.cap>0 && level[v]<level[e.to]){
			long long int d=dfs(e.to, t, min(f, e.cap));
			if(d>0){
				e.cap-=d;
				G[e.to][e.rev].cap+=d;
				return d;
			}
		}
	}
	return 0;
}
 
long long int max_flow(int s, int t){
	long long int flow=0;
	while(1){
		bfs(s);
		if(level[t]<0) return flow;
		memset(iter, 0, sizeof(iter));
		long long int f;
		while((f=dfs(s, t, INF))>0){
			flow+=f;
		}
	}
}

int main()
{
	sieve();
  int n; cin>>n;
  set<int> x[2];
  for(int i=0; i<n; i++){
    int x0;
    cin>>x0;
    auto itr1=x[x0%2].find(x0);
    if(itr1!=x[x0%2].end()){
      x[x0%2].erase(itr1);
    }else{
      x[x0%2].insert(x0);
    }
    x0++;
    auto itr2=x[x0%2].find(x0);
    if(itr2!=x[x0%2].end()){
      x[x0%2].erase(itr2);
    }else{
      x[x0%2].insert(x0);
    }
  }
  vector<int> v[2];
  for(int i=0; i<2; i++){
    for(auto x0:x[i]){
      v[i].push_back(x0);
    }
  }
  int c[2];
  c[0]=v[0].size(); c[1]=v[1].size();
  int V=c[0]+c[1]+2;
  for(int i=0; i<c[0]; i++){
    add_edge(V-2, i, 1ll);
  }
  for(int i=0; i<c[1]; i++){
    add_edge(i+c[0], V-1, 1ll);
  }
  for(int i=0; i<c[0]; i++){
    for(int j=0; j<c[1]; j++){
      if(isprime[abs(v[0][i]-v[1][j])]){
        add_edge(i, c[0]+j, 1ll);
      }
    }
  }
  int m=(int)max_flow(V-2, V-1);
  if((c[0]-m)%2==0){
    cout<<c[0]-m+c[1]<<endl;
  }else{
    cout<<c[0]-m+c[1]+1<<endl;
  }
	return 0;
}

Measured memory_bytes: 10368
IDENTIFICATION                   DIVISION.
PROGRAM-ID.                      ABC_085_A.
ENVIRONMENT                      DIVISION.
DATA                             DIVISION.
WORKING-STORAGE                  SECTION.
    01 INP    PIC X(10).
PROCEDURE                        DIVISION.
MAIN.
    ACCEPT INP.

    INSPECT INP REPLACING FIRST "17/" BY "18/".

    DISPLAY INP.
    STOP RUN.


Measured memory_bytes: 636
N = int(input())
N_l = [int(i) for i in input().split()]

ans = 0

for i in range(N-2):
  if N_l[i] < N_l[i+1] and N_l[i+1] < N_l[i+2]:
    ans += 1
  elif N_l[i+2] < N_l[i+1] and N_l[i+1] < N_l[i]:
    ans += 1

print(ans)

Measured memory_bytes: 3060