akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int l,ll,k,bit,c;
int main(){
    scanf("%d", &l);
    ll=l;
	while(ll){
		k++;
		ll/=2;
	}
    bit=__builtin_popcount(l) - 1;
    printf("%d %d\n",k,2*(k-1)+bit);
    c=1<<(k-1);
    for(int i=k-2;i>=0;i--){
        printf("%d %d %d\n",i+1,i+2,1<<i);
        printf("%d %d %d\n",i+1,i+2,0);
        if((1<<i)&l){
            printf("%d %d %d\n",i+1,k,c);
            c+=1<<i;
        }
    }
}

Measured memory_bytes: 3748
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#define MOD 1000000007
#define MAX(a,b) (a>b?a:b)
#define MAX3(a,b,c) MAX(a,MAX(b,c))
#define MIN(a,b) (a<b?a:b)
#define MIN3(a,b,c) MIN(a, MIN(b,c))
typedef long long lli;

int main()
{
    char s[10];
    int len, i, j, ans=0;
    scanf("%s",s);
    len = strlen(s);
    for(i=0; i<len; i++) {
        int temp = 0;
        for(j=i; j<len; j++) {
            int dif = strncmp(s+j, "A", 1);
            //printf("%c, %d\n",s[j],dif);
            if(dif==0 || dif==2 || dif==6 || dif==19) {
                temp++;
            } else {
                break;
            }
        }
        ans = MAX(ans, temp);
    }
    printf("%d",ans);
    return 0;
}


Measured memory_bytes: 256
#include<vector>
#include<map>
#include<algorithm>
#include<set>
#include<iostream>
#include<string>
#include<set>
#include<queue>
#include<random>

using namespace std;

#pragma GCC optimize("Ofast")
#pragma GCC optimize("fast-math")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")

#define pb push_back
#define int long long
#define ld long double
#define ll long long

mt19937 rnd(51);

int32_t main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin >> n;
	vector<int> v(n);
	map<int, int> cnt;
	int sum = 0;
	for (int i = 0; i < n; i++) {
		cin >> v[i];
		cnt[v[i]]++;
	}
	for (auto to : cnt) {
		sum += (to.second - 1) * to.second / 2;
	}
	for (int i = 0; i < n; i++) {
		sum -= cnt[v[i]] * (cnt[v[i]] - 1) / 2;
		sum += (cnt[v[i]] - 1) * (cnt[v[i]] - 2) / 2;
		cout << sum << endl;
		sum += cnt[v[i]] * (cnt[v[i]] - 1) / 2;
		sum -= (cnt[v[i]] - 1) * (cnt[v[i]] - 2) / 2;
	}
	return 0;
}


Measured memory_bytes: 11776
import sys
input=sys.stdin.readline
#from collections import defaultdict
#d = defaultdict(int)
#import fractions
#import math
#import collections
#from collections import deque
#from bisect import bisect_left
#N = int(input())
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = list(map(int,input().split()))
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
N = int(input())
A = list(map(int,input().split()))
if 0 in A:
    s = 0
    for i in A:
        s += abs(i)
    print(s)
c = 0
for i in range(N):
    if A[i] < 0:
        c += 1
        A[i] *= -1
Min = min(A)
s = 0
for i in A:
    s += i
if c % 2 == 1:
    s -= Min * 2
if 0 not in A:
    print(s)

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

int main(){
    string S;
    cin >> S;
    int N;
    N = S.size();
    int i;
    for(i=0;i<N/2;i++){
        if(S[i] != S[N-1-i]){
            cout << "No" << endl;
            return 0;
        }
    }
    for(i=0;i<(N-1)/4;i++){
        if(S[i] != S[(N-1)/2 -i-1]){
            cout << "No" << endl;
            return 0;
        }
    }
    for(i=0;i;i++){
        if(S[N-1-i] != S[(N+3)/2 -1+i]){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

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

int main() 
{ 
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL); 
    int i,n,c=0;
    cin>>n;int a[n],b[n];
    for(i=0;i<n;i++){
      cin>>a[i];
     b[i]=a[i];}
  sort(b,b+n);
   for(i=0;i<n;i++){
   if(a[i]!=b[i]) c++;
   }
  if(c<=2) cout<<"YES";
  else cout<<"NO";
    return 0; 
} 

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

using ll=long long;



void solve(){
    string s;
    cin>>s;
    int y=stoi(s.substr(0,4));
    int m=stoi(s.substr(5,2));
    int d=stoi(s.substr(8,2));
    if(y<2019){
        cout<<"Heisei"<<endl;
    }
    else if(m<4&&y==2019){
        cout<<"Heisei"<<endl;
    }
    else if(d<=30&&y==2019&&m==4){
        cout<<"Heisei"<<endl;
    }else{
        cout<<"TBD"<<endl;
    }
}

signed main(){
    //while(1)
    solve();
}


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

int main() {
  long long int A, B, C, D, c, d, LCM, GCD;
  long long int result;
  scanf ("%lld %lld %lld %lld", &A, &B, &C, &D);
  
  
  if (C<D) {
    c=D;
    d=C;
  }
  else {
    c=C;
    d=D;
  }
  
  GCD = c%d;
  while (GCD!=0) {
    c=d;
    d=GCD;
    GCD=c%d;
  }
  GCD=d;
  LCM=C*D/GCD;
  
  result = B-A+1;
  
  result -= B/C;
  result -= B/D;
  result += B/(LCM);
  result += (A-1)/C;
  result += (A-1)/D;
  result -= (A-1)/(LCM);
  
  printf("%lld", result);
  return 0;
}
 

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

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

  int x=A;
  int y=C;

  bool ans = true;
  for (int i = 0; i < 500; i++) {
    y=y-B;
    if (y<=0){
      ans=true;
      break;
    }
    x=x-D;
    if (x<=0){
      ans=false;
      break;
    }
  }

  if (ans) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }

   return 0;
 }

Measured memory_bytes: 3636
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Scanner;

class Main {
    static final int MOD = 1000000007;
    static final int INF = 1 << 30;

    Main() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int[] a = new int[N];
        for (int i = 0; i < M; i++) {
            int num = sc.nextInt();
            a[i] = num;
        }
        int l = 0;
        int r = 0;
        for(int i=0;i<M;i++){
            if(a[i]<X)l++;
            else r++;
        }
                System.out.println(Math.min(l,r));
    }

    public static void main(String[] args) {
        new Main();
    }
}


Measured memory_bytes: 21840
/*
csc -debug A.cs && mono --debug A.exe <<< "3"
*/

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Reflection;

public class HelloWorld {
    public static void SolveCodeForces() {
        var S = cin.NextUlong();
        var A = (ulong)Math.Floor(Math.Sqrt(S));

        while (A * A < S) A++;
        var B = A * A - S;

        var ans = new ulong[] {
            0, 0,
            1, A,
            A, B
        };

        System.Console.WriteLine(ans.Join());
    }

    static Scanner cin = new Scanner();
    static StringBuilder cout = new StringBuilder();

    static public void Main () {
        SolveCodeForces();
        // IncreaseStack(SolveCodeForces);
        // System.Console.Write(cout.ToString());
    }

    public static void IncreaseStack(ThreadStart action, int stackSize = 128000000)
    {
        var thread = new Thread(action, stackSize);
        thread.Start();
        thread.Join();
    }
}

public static class Helpers {
    public static string Join<T>(this IEnumerable<T> arr) {
        return string.Join(" ", arr);
    }

    public static void Swap<T>(ref T a, ref T b) {
        var tmp = a;
        a = b;
        b = tmp;
    }

    public static T[] CreateArray<T>(int length, Func<int, T> itemCreate) {
        var result = new T[length];
        for (var i = 0; i < result.Length; i++)
            result[i] = itemCreate(i);
        return result;
    }
}

public class Scanner
{
    private string[] line = new string[0];
    private int index = 0;

    public string Next() {
        if (line.Length <= index) {
            line = Console.ReadLine().Split(' ');
            index = 0;
        }
        var res = line[index];
        index++;
        return res;
    }

    public int NextInt() {
        return int.Parse(Next());
    }

    public long NextLong() {
        return long.Parse(Next());
    }

    public ulong NextUlong() {
        return ulong.Parse(Next());
    }

    public string[] Array() {
        line = Console.ReadLine().Split(' ');
        index = line.Length;
        return line;
    }

    public int[] IntArray(int emptyPrefixLen = 0) {
        var array = Array();
        var result = new int[emptyPrefixLen + array.Length];
        for (int i = 0; i < array.Length; i++)
            result[emptyPrefixLen + i] = int.Parse(array[i]);
        return result;
    }

    public long[] LongArray() {
        var array = Array();
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
            result[i] = long.Parse(array[i]);
        return result;
    }

    public ulong[] UlongArray() {
        var array = Array();
        var result = new ulong[array.Length];
        for (int i = 0; i < array.Length; i++)
            result[i] = ulong.Parse(array[i]);
        return result;
    }
}

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

int main(){
while(1){
	int a,b,c,n;
	int x[1002],y[1002],z[1002],r[1002];
	int ans[1002]; for(int i=0;i<1002;i++)ans[i]=2;

	scanf("%d%d%d",&a,&b,&c); if(a==0)break;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d%d%d%d",&x[i],&y[i],&z[i],&r[i]);
		if(r[i]==1){
			ans[x[i]]=1;
			ans[y[i]]=1;
			ans[z[i]]=1;
		}
	}

	for(int i=0;i<n;i++){
		if(r[i]==0){
			if(ans[x[i]]==1&&ans[y[i]]==1)ans[z[i]]=0;
			if(ans[y[i]]==1&&ans[z[i]]==1)ans[x[i]]=0;
			if(ans[z[i]]==1&&ans[x[i]]==1)ans[y[i]]=0;
		}
	}

	for(int i=1;i<=a+b+c;i++){
		printf("%d\n",ans[i]);
	}
}
}

Measured memory_bytes: 1192
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#define EPS 1e-10
using namespace std;

double add(double a,double b){
	if(fabs(a+b)<EPS*(fabs(a)+fabs(b)))return 0;
	return a+b;
}

struct P{
	double x,y;
	P(){}
	P(double xx,double yy){
		x=xx;
		y=yy;
	}
	P operator +(P p){
		return P(add(x,p.x),add(y,p.y));
	}
	P operator -(P p){
		return P(add(x,-p.x),add(y,-p.y));
	}
	P operator *(double d){
		return P(x*d,y*d);
	}
	P operator /(double d){
		return P(x/d,y/d);
	}
	double dot(P p){
		return add(x*p.x,y*p.y);
	}
	double det(P p){
		return add(x*p.y,-y*p.x);
	}
};

int n;
double r,ang;
P p[21];
struct edge{
	int t;
	double c;
	edge(){}
	edge(int tt,double cc){
		t=tt;
		c=cc;
	}
};
vector<edge> G[21][21];

double dist(int a,int b){
	return sqrt(pow(p[a].x-p[b].x,2)+pow(p[a].y-p[b].y,2));
}

struct data{
	int v,p,cnt;
	double c;
	data(){}
	data(int vv,int pp,int cntt,double cc){
		v=vv;
		p=pp;
		cnt=cntt;
		c=cc;
	}
	bool operator<(const data& d1)const{
		return c>d1.c;
	}
};

double cost[21][21][10001];
int dijk(){
	for(int i=0;i<=n;i++){
		for(int j=0;j<=n;j++){
			for(int k=0;k<=10000;k++){
				cost[i][j][k]=r+1.0;
			}
		}
	}
	priority_queue<data> que;
	que.push(data(1,0,0,0.0));
	cost[1][0][0]=0.0;
	int res=0;
	while(que.size()){
		data q=que.top();
		que.pop();
		if(cost[q.v][q.p][q.cnt]<q.c)continue;
		res=max(res,q.cnt);
		for(int i=0;i<G[q.v][q.p].size();i++){
			edge e=G[q.v][q.p][i];
			if(cost[e.t][q.v][q.cnt+1]>cost[q.v][q.p][q.cnt]+e.c){
				cost[e.t][q.v][q.cnt+1]=cost[q.v][q.p][q.cnt]+e.c;
				que.push(data(e.t,q.v,q.cnt+1,cost[e.t][q.v][q.cnt+1]));
			}
		}
	}
	return res;
}

int main(void){
	scanf("%d",&n);
	scanf("%lf %lf",&r,&ang);
	for(int i=1;i<=n;i++){
		scanf("%lf %lf",&p[i].x,&p[i].y);
	}
	for(int i=0;i<=n;i++){
		for(int j=1;j<=n;j++){
			for(int k=1;k<=n;k++){
				if(j==k)continue;
				if(i==0){
					G[j][i].push_back(edge(k,dist(j,k)));
				}else{
					double aa=(p[j]-p[i]).dot(p[k]-p[j])/(dist(j,i)*dist(j,k));
					if(aa>=cos(ang*M_PI/180.0)){
						G[j][i].push_back(edge(k,dist(j,k)));	
					}
				}
			}
		}
	}
	/*
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			printf("%d%d ",j,i);
			for(int k=0;k<G[j][i].size();k++){
				printf("%d ",G[j][i][k].t);
			}
			printf("\n");
		}
	}
	*/
	printf("%d\n",dijk());
	return 0;
}

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

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

/// find_by_order()
/// order_of_key()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline int randll(int l = INT_MIN, int r = INT_MAX) {
    return uniform_int_distribution<int>(l, r)(rng);
}
main()
{
    ios::sync_with_stdio(0);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    string s;
    cin >> s;
    if (s == "RRR") cout << 3;
    else if (s == "RRS" || s == "SRR") cout << 2;
    else if (s == "SSS") cout << 0;
    else cout << 1;
}


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

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	int n; cin >> n;
	int a[n], b[n];
	for (int i = 0; i < n; ++i)
	{
		cin >> a[i];
		b[i] = a[i];
	}
	sort(b, b + n);
	int ans = 0;
	for (int i = 0; i < n; ++i)
	{
		if (a[i] != b[i])
		{
			ans++;
		}
		if (ans > 2)
		{
			cout << "NO" << endl;
			return 0;
		}
	}
	if (ans == 0 || ans == 2)
	{
		cout << "YES" << endl;
	}
	else
	{
		cout << "NO" << endl;
	}
	return 0;
}

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

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

  vector<int> a(n + 1);

  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }

  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (i == a[a[i]]) ans++;
  }

  cout << ans / 2 << endl;
}


Measured memory_bytes: 640
Scanf.scanf "%s" @@ fun s ->
  let n1 = String.sub s 0 2 |> int_of_string in
  let n2 = String.sub s 2 2 |> int_of_string in
  print_endline @@ if n1 > 12 || n1 = 0 then
      if n2 > 12 || n2 = 0 then
        "NA"
      else
        "YYMM"
    else
      if n2 > 12 || n2 = 0 then
        "MMYY"
      else
        "AMBIGUOUS"

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

#define ll                   long long int
#define MOD                  1000000007
#define fast()               ios_base::sync_with_stdio(false);  cin.tie(NULL);
#define loop(i,a,b)          for(ll i=(ll)a;i<(ll)b;i++)
#define pool(i,a,b)          for(ll i=(ll)a;i>=(ll)b;i--)
#define pb                   push_back
#define vi                   vector<ll>
#define test()               ll t; cin>>t; while(t--)
#define endl                 "\n"
#define param                greater<ll>()
#define ff                   first
#define ss                   second
#define all(v)               v.begin(),v.end()
#define keep_unique(v) sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end());
#define sor(vec) sort(vec.begin(),vec.end());

using namespace std;

const int N = 1e5+10;
#define MAX  10000000000;
// const int MOD = 998244353;

ll fast_exp(ll x,ll n){ll ans=1;while(n){if(n&1)ans*=x;n=n>>1;x=x*x;}return ans;}
ll mod_exp(ll x, ll y,ll p){ll res = 1;x = x % p;while(y>0){if(y&1)res = (res*x) % p;y = y>>1;x=(x*x)%p;}return res;}


//  vector < ll > vec(N);

// ll fib[N];

ll dp[N];


int main()
{
    
    fast()
    
    
    ll t;
    // cin>>t;
    t=1;
    
    while(t--)
    {
        ll a,b,c,i,n,k,p,j,d,m;
        
        string s;
        
        cin>>n;
        
       ll dp[n][3];
        
        memset(dp,0,sizeof(dp));
        
        for(i=0;i<n;i++)
        {
          for(j=0;j<3;j++)
          cin>>dp[i][j];
          
          a=dp[i][0];
          b=dp[i][1];
          c=dp[i][2];
          
          ll temp;
          
          if(i>0)
          {
              for(j=0;j<3;j++)
              {
                  if(j==0)temp=a;
                  if(j==1)temp=b;
                  if(j==2)temp=c;
                  
                 for(k=0;k<3;k++)
                 {
                     if(j!=k)
                     {
                         dp[i][j]= max(temp+dp[i-1][k],dp[i][j]); 
                     }
                 }
              }
          }
          
          
        }
        
        
        cout<<max({dp[n-1][0],dp[n-1][1],dp[n-1][2]});
        
        
        // string ans=vec[0];
      
    }
   
   
   
   
    return 0;
}


Measured memory_bytes: 2560
n,k,q = map(int,input().split())
a = []
for i in range(q):
    A = int(input())
    a.append(A)
ans = [0] * n
for i in range(q):
    ans[a[i] - 1] += 1
for i in range(n):
    if q - k + 1 <= ans[i]:
        print("Yes")
    else:
        print("No")

Measured memory_bytes: 13664
#pragma comment (linker, "/STACK:256000000")
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;
typedef string::const_iterator State;
const long double Ma_PI = 3.1415926535897932384626433832795028841971L;
#define eps 1e-7
#define LONG_INF 2000000000000000000LL
#define GOLD 1.61803398874989484820458
//#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL

#define MOD 998244353LL
#define seg_size 262144*2
#define pb push_back
#define mp make_pair
typedef long long ll;
#define REP(a,b) for(long long a = 0;a < b;++a)
#define ALL(x) (x).begin(),(x).end()
void init() {
    iostream::sync_with_stdio(false);
    cout << fixed << setprecision(20);
}
unsigned long xor128() {
    static unsigned long x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    unsigned long t = (x ^ (x << 11));
    x = y; y = z; z = w;
    return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}
#define int ll
int calc(vector<int> a) {
    vector<int> now;
    REP(i, a.size()) {
        now.push_back(i + 1);
    }
    int ans = 0;
    do {
        ans++;
        if (now == a) break;
    } while (next_permutation(ALL(now)));
    return ans;
}
void solve(){
    int n;
    cin >> n;
    vector<int> a, b;
    REP(i, n) {
        int c;
        cin >> c;
        a.pb(c);
    }
    REP(i, n) {
        int c;
        cin >> c;
        b.pb(c);
    }
    cout << llabs(calc(a) - calc(b)) << endl;
}
#undef int
int main() {
    init();
    solve();
}

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

#define int long long
#define pb emplace_back
#define mp make_pair
#define f(i,a,n) for(int i=a ; i<n ; i++)
#define F first
#define S second
#define fast ios:: sync_with_stdio(false),cin.tie(0);

int32_t main(){
	fast;
	int n;
	cin >> n;
	vector<pair<int,int>>v;
	f(i,0,n)
	{
		int x;
		cin >> x;
		v.pb(mp(x,i+1));
	}
	sort(v.begin(),v.end());
	for(auto x : v) cout << x.S << " ";
}







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

using namespace std;

#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef unsigned long long ull;

// 46786 - 106

vector<vector<int>> ed(56);
vector<int> tin(56, -1);
vector<int> tup(56, -1);
int timer = 0;
int b = 0;

void dfs(int node, int p = -1) {
    tin[node] = timer;
    tup[node] = timer;
    ++timer;
    for (auto out : ed[node]) {
        if (out == p) {
            continue;
        }
        if (tin[out] != -1) {
            tup[node] = min(tup[node], tup[out]);
        } else {
            dfs(out, node);
            tup[node] = min(tup[node], tup[out]);
            if (tup[out] > tin[node]) {
                ++b;
            }
        }
    }
}


void oneCase() {
   int n, m;
   cin >> n >> m;
   for (int i = 0; i < m; ++i) {
       int a, b;
       cin >> a >> b;
       --a;
       --b;
       ed[a].pb(b);
       ed[b].pb(a);
   }
   dfs(0);
   cout << b << "\n";


}


int main() {
    int t = 1;
//    cin >> t;
    while (t--) {
       oneCase();
    }

    return 0;
}


Measured memory_bytes: 256
#include <vector>
#include <iostream>
#include <queue>
#define oo 0x3f3f3f3f

using namespace std;

void detcmin(int st, vector<vector<int>> &cmin, vector<vector<int>> &adj) {

  queue<int> q;
  q.push(st);
  cmin[st][st] = 0;
  while(!q.empty()) {
    int crt = q.front();
    q.pop();
    for (int i = 0; i <= 9; ++i) {
      if (cmin[st][crt] + adj[crt][i] < cmin[st][i] && adj[crt][i] != 0 && i != crt) {
        cmin[st][i] = cmin[st][crt] + adj[crt][i];
        q.push(i);
      }
    }
  }
}

int main() {

  vector<vector<int>> adj = vector<vector<int>> (10, vector<int>(10, -1));

  int n, m;
  int cost;
  cin >> n >> m;

  for (int i = 0; i <= 9; ++i) {
    for (int j = 0; j <= 9; ++j) {
      cin >> cost;
      adj[i][j] = cost;
    }
  }

  vector<vector<int>> cmin = vector<vector<int>>(10, vector<int>(10, oo));
  for (int i = 0; i <= 9; ++i) {
    detcmin(i, cmin, adj);
  }

  int sol = 0, nr;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> nr;
      if (nr != -1)
        sol += cmin[nr][1];
    }
  }
  cout << sol << "\n";
  return 0;
}


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

using namespace std;

typedef long long ll;
typedef pair< ll, ll > pll;
typedef pair< int, int > pii;

const double pi = 3.14159265358979323846;

#define MOD 1000000007LL
#define PS(p) cout << setprecision(15) << fixed << p << endl;
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
#define ALL(c) c.begin(), c.end()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define TG0 get< 0 >
#define TG1 get< 1 >
#define TG2 get< 2 >
#define F first
#define S second
#define VL vector< ll >

// to_string(123)
// atoi("123"); atoi(s.c_str());
// "abc".size()
// s.find('+') == string::npos
// 1e18

#define INDEX_A 0
#define INDEX_B 1
#define INDEX_C 2

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

  // input
  ll N;
  cin >> N;

  ll a[N], b[N], c[N];
  for (ll i = 0; i < N; i++) {
    cin >> a[i] >> b[i] >> c[i];
  }

  // init
  ll dp[N][3];
  for (ll i = 0; i < N; i++) {
    for (ll j = 0; j < 3; j++) {
      dp[i][j] = 0;
    }
  }

  // dp
  dp[0][INDEX_A] = a[0];
  dp[0][INDEX_B] = b[0];
  dp[0][INDEX_C] = c[0];

  for (ll i = 1; i < N; i++) {
    ll before = i - 1;
    // a
    dp[i][INDEX_A] = max(dp[before][INDEX_B], dp[before][INDEX_C]) + a[i];

    // b
    dp[i][INDEX_B] = max(dp[before][INDEX_A], dp[before][INDEX_C]) + b[i];

    // c
    dp[i][INDEX_C] = max(dp[before][INDEX_A], dp[before][INDEX_B]) + c[i];
  }

  ll m = max(dp[N - 1][INDEX_A], dp[N - 1][INDEX_B]);
  m = max(m, dp[N - 1][INDEX_C]);

  cout << m << endl;

  return 0;
}


Measured memory_bytes: 4992
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include<bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for(ll i = (ll)(s); i < (ll)(t); i++)
#define rrep(i,s,t) for(ll i = (ll)(s-1);(ll)(t) <= i; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
constexpr ll INF = numeric_limits<ll>::max()/4;
constexpr ll n_max = 2e5+10;
#define int ll

template <typename A, typename B>
string to_string(pair<A, B> p);
string to_string(const string &s) {return '"' + s + '"';}
string to_string(const char *c) {return to_string((string) c);}
string to_string(bool b) {return (b ? "true" : "false");}
template <size_t N>
string to_string(bitset<N> v){
    string res = "";
    for(size_t i = 0; i < N; i++) res += static_cast<char>('0' + v[i]);
    return res;
}
template <typename A>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for(const auto &x : v) {
        if(!first) res += ", ";
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p){return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}

void debug_out() {cerr << endl;}
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

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

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n; cin >> n;
    vector<ll> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];
    vector<vector<ll>> graph(n);
    
    for(int i = 0; i < n-1; i++) {
        ll a,b;cin >> a >> b;
        a--;b--;
        graph[a].emplace_back(b);
        graph[b].emplace_back(a);
    }
    if(n == 2){
        cout << (a[0] == a[1] ? "YES" : "NO") << endl;
        return 0;
    }
    bool ok = true;
    auto dfs = [&](auto self, ll now, ll pre = -1) -> ll{
        ll ma = -1, sum = 0, cnt = 0;
        ll t;
        for(auto &to : graph[now]){
            if(to == pre)continue;
            t = self(self, to, now);
            debug(now, to, t);
            sum += t;
            chmax(ma, t);
            cnt++;
        }
        if(cnt == 0){
            return a[now];
        }
        if(a[now] > sum) ok = false;
        if(a[now] < (sum + 1) / 2) ok = false;
        ll res = 2 * a[now] - sum;
        ll m = 2 * ma - sum;
        if(m <= res)return res;
        ok = false;
        return -1;
    };
    ll root = 0;
    rep(i,0,n){
        if(graph[i].size() > 1){
            root = i;
            break;
        }
    }
    ok &= dfs(dfs, root) == 0;

    cout << (ok ? "YES" : "NO") << endl;
}

Measured memory_bytes: 18696
//#pragma comment(linker, "/stack:100000000")
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#define PI acos(-1.0)
#define pb push_back
#define F first
#define S second
#define debug puts
#define setp cout << fixed << setprecision(15)
#define fst ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
const int N=2e5+5;
typedef long long ll;
int a[N],sum[N],t[N];
int main(void){
//    fst;
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)  scanf("%d",&a[i]);
    for(int i=1;i<=n;i++){
        sum[i]=sum[i-1]+a[i];
        t[i]=t[i-1]^a[i];
    }

    int l=1,r=1;
    ll ans=0;
    for(l;l<=n;l++){
//        r=l;
        while( sum[r]-sum[l-1] == (t[r]^t[l-1]) && r<=n ){
            r++;
        }
        r--;
        ans+=r-l+1;
    }
    printf("%lld\n",ans);
    return 0;
}
void bef0re_submit(){
    debug("Make sure the algorithm is right!");
    debug("LONG LONG!!!");
    debug("n==0?1?2?3?");
    debug("Make sure output format is right/// Yes??YES  (%.20LF)???");
    debug("if all meet,run with special situation!!!");
    debug("I confirm that I have done all above");

    debug("If u know brute,consider fast,binary(log) or tree?");
}


/*********
20 4
7
*********/


Measured memory_bytes: 2560
import java.util.*;

class Main{
	public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
      int N = sc.nextInt();
      int[] L=new int[N];
	  for(int i=0;i<N;i++){
      L[i]+=sc.nextInt();
      }	
      Arrays.sort(L);
      int Ls=0;
      for(int i=0;i<N-1;i++){
      Ls+=L[i];
      }
      if(Ls>L[N-1]){
      System.out.println("Yes");
      }else{
      System.out.println("No");
      }
      
    }
}

Measured memory_bytes: 23124
n = gets.chomp.to_i
a = []
a = gets.split("")
b = []
c = []
cnt = []
t = 0
alp = ('a'..'z').to_a
for i in 0..n-1
t = 0
b = []
c = []
  for j in 0..i
  b.push(a[j])
  end
  for j in i+1..n-1
  c.push(a[j])
  end
 b.uniq!
 c.uniq!
  #puts b.join("")
  #puts c.join("")
  for j in 0..25
  #puts j
  #puts t
  #puts alp[j]
    if b.include?(alp[j])
        if c.include?(alp[j])
      t = t + 1
        end
    end
  end
  #puts t
  cnt.push(t)
end
 
#puts cnt.join (" ")
puts cnt.max

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

using namespace std;
using ll = long long;
int dp[1003][5000];
int n,m;
vector<int>c[1003];
int cost[1003];
int solve(int i, int mask){
    //cout<<mask<<" mask\n";
    if(i == m){
        if(n == __builtin_popcount(mask)){
            return 0;
        }else{
            return 1e9+5;
        }
    }
    if(dp[i][mask] != -1)return dp[i][mask];
    int c1 = solve(i+1,mask);
    int mask2 = mask;
    for(int j = 0; j < c[i].size(); j++){
        mask |= (1<<c[i][j]);
    }
    int c2 = cost[i] + solve(i+1,mask);
    return dp[i][mask2] = min(c2,c1);

}

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    cin>>n>>m;
    for (int i = 0; i < 1003; i ++) {
        for (int j = 0; j < 5000; j++)
            dp[i][j] = -1;
    }
    for(int i = 0; i < m; i++){
        int s;
        cin>>cost[i]>>s;
        c[i].resize(s);
        for(int j = 0; j < s; j++){
            cin>>c[i][j];
            c[i][j]--;
        }
    }
    int z = solve(0, 0);
    if(z < 1e9)
        cout << z;
    else cout<<-1;
    return 0;
}


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

#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long hoge = 0; (hoge) < (n); ++ (hoge)) cerr << #x << "[" << hoge << "]: " << x[hoge] << '\n'
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;
const ll INF = LLONG_MAX/2;
const ll MOD = 1e9+7;
const double EPS=1e-12;

double lmin=INF,lmax=-INF,rmin=INF,rmax=-INF,umin=INF,umax=-INF,dmin=INF,dmax=-INF,xcmin=INF,xcmax=-INF,ycmin=INF,ycmax=-INF;

double xlength(double t){
  return max({rmax+t,lmax-t,xcmax})-min({rmin+t,lmin-t,xcmin});
}
double ylength(double t){
  return max({umax+t,dmax-t,ycmax})-min({umin+t,dmin-t,ycmin});
}
double box(double t){
  return xlength(t)*ylength(t);
}
double golden_search(double a, double b, double f(double)) {
  const double r = 2 / (3 + sqrt(5));
  double c = a + r * (b - a), d = b - r * (b - a);
  double fc = f(c), fd = f(d);
  while (d - c > EPS) {
    if (fc > fd) { // '<': maximum, '>': minimum
      a = c; c = d; d = b - r * (b - a);
      fc = fd; fd = f(d);
    } else {
      b = d; d = c; c = a + r * (b - a);
      fd = fc; fc = f(c);
    }
  }
  return c;
}

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N;cin>>N;
  for(ll i=0;i<N;i++){
    double x,y;char d;cin>>x>>y>>d;
    if(d=='R'){
      rmin=min(rmin,x);
      rmax=max(rmax,x);
      ycmin=min(ycmin,y);
      ycmax=max(ycmax,y);
    }else if(d=='L'){
      lmin=min(lmin,x);
      lmax=max(lmax,x);
      ycmin=min(ycmin,y);
      ycmax=max(ycmax,y);
    }else if(d=='U'){
      umin=min(umin,y);
      umax=max(umax,y);
      xcmin=min(xcmin,x);
      xcmax=max(xcmax,x);
    }else{
      dmin=min(dmin,y);
      dmax=max(dmax,y);
      xcmin=min(xcmin,x);
      xcmax=max(xcmax,x);
    }
  }
  double ans = box(0);
  for(ll i=1;i<=1000;i++){
    ans = min(ans,box(golden_search(0,1e9/i,box)));
  }
  printf("%.10lf\n",ans);
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
  int n,m;
  scanf("%d %d",&n,&m);
  long double a[n];
  int h=0;
  double s=0;
  int i;
  for(i=0;i<n;i++){
    scanf("%Lf",&a[i]);
    s=s+a[i];
  }

  for(i=0;i<n;i++){
    if(a[i]>=s/(4*m)){
      h++;
    }
  }
  if(h>=m){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
  }

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

int main(){
    while(1){
        int n, l, r; cin >> n >> l >> r;
        if(!n) break;
        vector<int> a(n);
        for(int i = 0; i < n; i++) cin >> a[i];

        int ans = 0;
        for(int x = l; x <= r; x++){
            int i;
            for(i = 1; i <= n; i++){
                if(x % a[i - 1] == 0){
                    break;
                }
            }

            ans += (i % 2 == 1);

        }

        cout << ans << endl;
    }

    return 0;
}


Measured memory_bytes: 3060
package main

import "fmt"

func main(){
  var a, b, c, d int
  fmt.Scan(&a, &b, &c, &d)
  for{
    c -= b
    if c<=0{
      fmt.Println("Yes")
      break
    }
    a -= d
    if a<=0 {
      fmt.Println("No")
      break
    }
  }
}

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

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

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

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

int main() {
	cout << fixed << setprecision(15);
	int n;
	cin >> n;
	priority_queue<double, vector<double>, greater<double>> que;
	rep(i, n) {
		double v;
		cin >> v;
		que.push(v);
	}
	rep(i, n - 1) {
		double v1, v2;
		v1 = que.top();
		que.pop();
		v2 = que.top();
		que.pop();
		que.push((v1 + v2) / 2.0);
	}
	cout << que.top() << endl;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#pragma warning(disable:4996)
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <list>
#include <set>
#include <map>
#include <iomanip> 
#include <ctime>
#include <numeric>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

const double PI = 3.14159265358979323846;
const int MAX = 1e10;
const int MOD = 1e9+7;

const ll INF = 1e9;


int main(int argc, char *args[]) {
	string s; cin >> s;
	int t = s.size();
	string ans = "";
	for (int i = 0; i < t; i++) ans += 'x';
	cout << ans << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt"



int l = 0;
int r;
vector<int>nums;
string st;
string nspace() {
	string ans;
	for (auto c : st) {
		if (c != ' ')ans.push_back(c);
	}
	return ans;
}
int a = 0;
long long int getnum() {
	long long int num = 0;
	while (a!=st.size()&&isdigit(st[a])) {
		num = num * 10 + st[a] - '0';
		a++;
	}
	return num;
}
long long int getexpr(bool need,const int ba) {
	long long int num;
	while (a != st.size()) {
		if (st[a] == 'S') {
			a++;
			assert(st[a] == '<');
			a++;
			num = getexpr(true, nums[a - 1]);
			num = num*num % 1000000007;
			a++;
		}
		else if (st[a] == '>') {
			if (a == ba) {
				return num;
			}
			else if (nums[a] == -1) {
				if (need) {

					a++;
					assert(st[a] == '>');
					a++;
					const int eva = int(min(31ll, getexpr(false, nums[a - 1])));
					num = num >> eva;
				}
				else {
					return num;
				}
			}
			else {
				if (!need) {
					return num;
				}
				assert(false);
			}
		}
		else if (isdigit(st[a])) {
			num = getnum();
			if (!need)return num;
		}
		else {
			assert(false);
		}
	}
	return num;

}
int main() {
	while (1) {

		getline(cin, st);
		if (st == "#")break;
		st = nspace();
		l = 0;
		r = st.size() - 1;
		nums.resize(st.size());
		fill(nums.begin(), nums.end(), -1);

		int count = 0;
		vector<bool>rels(st.size(),true);
		for (int i = 3; i < st.size(); ++i) {
			if (st[i] == 'S' || isdigit(st[i])) {
				if (st[i - 1] == '>'&&st[i - 2] == '>') {
					rels[i - 1] = false;
					rels[i - 2] = false;
				}
			}
		}
		stack<int>sta;
		for (int i = 0; i < st.size(); ++i) {
			if (st[i] == '<') {
				if (rels[i]) {
					sta.push(i);
				}
			}
			else if (st[i] == '>') {
				if (rels[i]) {
					int f = sta.top();
					nums[f] = i;
					nums[i] = f;
					sta.pop();
				}
			}
		}
		a = 0;
		long long int ans=getexpr(true,-1);
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 5632
#include<bits/stdc++.h>
#define maxn 505
#define inf 1000000007
using namespace std;
typedef long long ll;
ll read()
{
    ll x=0,f=1;
    char ch=getchar();
    while(ch-'0'<0||ch-'0'>9){if(ch=='-') f=-1;ch=getchar();}
    while(ch-'0'>=0&&ch-'0'<=9){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int n,m,s,t;
struct P{
    int x,y;
    ll v;
}p[85];
struct X{
    char d;
    int a,b;
}co[325];
int Lx[85],Rx[85],Ly[85],Ry[85];
int head[325],nxt[140010],to[140010],c[140010],tot;
ll v[140010];
void add(int x,int y,int z,ll u)
{
    tot++;
    nxt[tot]=head[x];
    head[x]=tot;
    to[tot]=y;
    c[tot]=z;
    v[tot]=u;
}
void addx(int x,int y,int z,ll u)
{
    add(x,y,z,u);
    add(y,x,0,-u);
}
ll ans,res,dis[325];
int vis[325],pre[325],pre_num[325];
queue<int>q;
int spfa()
{
    for(int i=1;i<=t;i++)  dis[i]=-1e18;
    dis[s]=0;q.push(s);vis[s]=1;
    while(q.size())
    {
        int now=q.front();q.pop();vis[now]=0;
        for(int i=head[now];i;i=nxt[i])
        {
            if(dis[to[i]]<dis[now]+v[i]&&c[i])
            {
                dis[to[i]]=dis[now]+v[i];
                pre[to[i]]=now;
                pre_num[to[i]]=i;
                if(!vis[to[i]])  q.push(to[i]),vis[to[i]]=1;
            }
        }
    }
    if(dis[t]==-1e18)  return 0;
    int di=inf;
    for(int i=t;i!=s;i=pre[i])  di=min(di,c[pre_num[i]]);
    for(int i=t;i!=s;i=pre[i])  c[pre_num[i]]-=di,c[pre_num[i]^1]+=di;
    ans+=dis[t]*di;
    return di;
}
int main()
{
    n=read();
    for(int i=1;i<=n;i++)  p[i].x=read(),p[i].y=read(),p[i].v=read();
    m=read();
    for(int i=1;i<=m;i++)  co[i].d=getchar(),co[i].a=read(),co[i].b=read();
    for(int k=1;k<=n;k++)
    {
        tot=1;memset(head,0,sizeof(head));
        s=2*k+2*n+1;t=s+1;
        for(int i=1;i<=k;i++)  addx(s,i,1,0);
        for(int i=k+2*n+1;i<=2*n+2*k;i++)  addx(i,t,1,0);
        for(int i=k+1;i<=k+n;i++)  addx(i,i+n,1,p[i-k].v);
        for(int i=1;i<=k;i++)  Lx[i]=Ly[i]=0,Rx[i]=Ry[i]=inf;
        for(int i=1;i<=m;i++)
        {
            if(co[i].d=='U')
            {
                for(int j=1;j<=k-co[i].b;j++)  Ry[j]=min(Ry[j],co[i].a-1);
            }
            if(co[i].d=='D')
            {
                for(int j=co[i].b+1;j<=k;j++)  Ly[j]=max(Ly[j],co[i].a+1);
            }
            if(co[i].d=='L')
            {
                for(int j=co[i].b+1;j<=k;j++)  Lx[j]=max(Lx[j],co[i].a+1);
            }
            if(co[i].d=='R')
            {
                for(int j=1;j<=k-co[i].b;j++)  Rx[j]=min(Rx[j],co[i].a-1);
            }
        }
        for(int i=1;i<=k;i++)
          for(int j=1;j<=n;j++)
            if(Lx[i]<=p[j].x&&p[j].x<=Rx[i])  addx(i,k+j,1,0);
        for(int i=1;i<=k;i++)
          for(int j=1;j<=n;j++)
            if(Ly[i]<=p[j].y&&p[j].y<=Ry[i])  addx(k+n+j,k+2*n+i,1,0);
        ans=0;
        while(spfa()){};
        res=max(res,ans);   
    }
    cout<<res<<endl;
    return 0;
}


Measured memory_bytes: 640
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int[] data = new int[101];
		int count = 0;
		while(stdIn.hasNext()){
			int k = stdIn.nextInt();
			data[k]++;
			if(count<data[k]){
				count = data[k];
			}
		}
		for(int i=1;i<101;i++){
			if(data[i]==count){
				System.out.println(i);
			}
		}
	}
}

Measured memory_bytes: 18136
#include <iostream>
#include<math.h>
using namespace std;

int count_keta(int n){
    return log10(n) + 1;
}
int main()
{
    int N;
    cin >> N;

    int count = 0;
    for (int n = 1; n <= N; n++)
    {
        if(count_keta(n)%2 != 0){
            count += 1;
        }
    }

    cout << count << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define BIT(x) (1<<(x))

using namespace std;

int v[100010];
pair<int, int> d[100010][25];

int main()
{
    //freopen("in.in", "r", stdin);
    int n, l;
    cin >> n;
    for(int i = 0; i < n; i++)
        cin >> v[i];
    cin >> l;

    for(int i = 0; i < n; i++)
    {
        int st = i, dr = n - 1, mij, r = i;
        while(st <= dr)
        {
            mij = (st + dr) / 2;
            int diff = v[mij] - v[i];
            if(diff <= l)
            {
                st = mij + 1;
                r = mij;
            }
            else dr = mij - 1;
        }
        d[i][0].first = r;
        if(mij != i)
            d[i][0].second = 1;
        else d[i][0].second = 0;
    }
    int i;
    for(i = 1; BIT(i) <= n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            int inter = d[j][i - 1].first;
            int dest = d[inter][i - 1].first;
            d[j][i].first = dest;
            d[j][i].second = d[j][i - 1].second + d[inter][i - 1].second;
        }
    }
    int lgo = i - 1;
    int q;
    cin >> q;
    while(q--)
    {
        int a, b, lg = lgo;
        cin >> a >> b;
        if(a > b)
            swap(a, b);
        a--; b--;
        int rez = 0;
        while(a < b && lg >= 0)
        {
            if(d[a][lg].first > b)
            {
                lg--;
            }
            else
            {
                rez += d[a][lg].second;
                a = d[a][lg].first;
            }
        }
        if(a != b)
            rez++;
        cout << rez << '\n';
    }
    return 0;
}


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

int main() {

    int n, m, x, a;
    scanf("%d %d %d", &n, &m, &x);

    int temp1 = 0;
    int temp2 = 0;

    for (int i = 0; i < m; i++) {
        scanf("%d", &a);
        if (a < x) {
            temp1++;
        } else {
            temp2++;
        }

    }

    printf("%d", (temp1 <= temp2 ? temp1 : temp2));


    return 0;
}


Measured memory_bytes: 1728
package main

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

var (
	scanner = bufio.NewScanner(os.Stdin)
	w       = bufio.NewWriter(os.Stdout)
)

func readInt() (read int) {
	scanner.Scan()
	read, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic(err)
	}
	return
}

func main() {
	scanner.Split(bufio.ScanWords)
	defer w.Flush()

	n := readInt()
	k := readInt()

	okasi := make([]int, n)

	for i := 0; i < k; i++ {
		d := readInt()
		for j := 0; j < d; j++ {
			a := readInt()
			okasi[a-1] = 1
		}
	}
	sum := 0
	for _, i := range okasi {
		sum += i
	}

	fmt.Fprintln(w, n-sum)
}

Measured memory_bytes: 1776
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <deque>
using namespace std;

#define next '\n'
#define sp " "
#define print(x) cout << (x)
#define println(x) cout << (x) << next
#define stop return(0)
#define rep(i, n) for(int (i) = (0); (i) < (n); (++i))
#define FOR(i, start, end) for(int (i) = (start); (i) < (end); (++i))
#define foreach(e, elem) for(auto& (e) : (elem))
#define FAST ios::sync_with_stdio(false); cin.tie(nullptr)
#define size(s) (s).size()
#define all(vec) (vec).begin(), (vec).end()
#define pb(e) push_back(e);
using ll = long long;
using ull = unsigned long long;

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

    int ans = 180 * (n - 2);
    println(ans);
}


Measured memory_bytes: 256
#include <algorithm>
#include <vector>
#include <cmath>
#include <tuple>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <queue>
#include <numeric>
#include <iostream>
#include <set>

using namespace std;

bool allTheDigitsEqual(int N) {

    int targetDigit = N % 10;
    N = N / 10;

    bool ok = true;

    while (N != 0) {
        int digit = N % 10;
        if (digit != targetDigit) {
            ok = false;
            break;
        }
        N = N / 10;
    }

    return ok;

}

int main() {


    int N;
    cin >> N;
    for (int i = N; i <= 999; i++) {

        if (allTheDigitsEqual(i)) {
            cout << i << "\n";
            break;
        }

    }

    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<cstring>
#define RG register
using namespace std;
const int N=1e5+10;
struct dabt{ int next,to; }e[N];
int n,m,head[N],k,fa[N],ans;
inline void add(int from,int to){e[++k]=(dabt){head[from],to}; head[from]=k;}
template<typename I> inline void read(I &ot){
	I ch=getchar(), x=0, f=1;
	while(ch<'0' || ch>'9'){if(ch=='-') f=-1; ch=getchar();	}
	while(ch>='0' && ch<='9'){x=x*10+ch-'0'; ch=getchar();	}
	ot=x*f;}
template<typename I, typename... U> inline void read(I &x,U&... y){read(x); read(y...);}
template<typename I>inline I mx(const I&a,const I&b){return a>b ? a : b;}
int dfs(int st,int dep)
{
	int tt=dep;
	for(RG int i=head[st];i;i=e[i].next) tt=mx(tt,dfs(e[i].to,dep+1));
	if(tt-dep+1==m && fa[st]!=1) { ans++; return 0; }
	return tt;
}
int main()
{
//	freopen("Teleporter.in","r",stdin);
	read(n,m);
	for(RG int i=1;i<=n;i++) read(fa[i]);
	for(RG int i=2;i<=n;i++) add(fa[i],i);
	if(fa[1]!=1) ans++;
	fa[1]=1;
	dfs(1,0);
	printf("%d\n",ans);
	return 0;
}

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

using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

ll GCD(int A, int B){
  if (A < B) swap(A, B);
  while (A % B != 0){
    A %= B;
    swap(A, B);
  }
  return B;
}

int main(){
  int K; cin >> K;
  ll ans = 0;
  for (int i = 1; i <= K; i++){
    for (int j = 1; j <= K; j++){
      for (int k = 1; k <= K; k++){
        ans += GCD(i, GCD(j, k));
      }
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3628
n = int(input())
p = list(map(int,input().split()))
count = 0
for i in range(n-2):
  if p[i]<=p[i+1]<p[i+2]:
    count = count + 1
  elif p[i]>p[i+1]>=p[i+2]:
    count = count + 1
else:
  print(count)

Measured memory_bytes: 3060