akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

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

typedef long long ll;
typedef long double R;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

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

// Problem Specific Parameter:

int main() {
  int n; cin >> n;
  string s; cin >> s;
  int cnt = 0;
  int ans = 0;
  for(int i = 1; i < n; i++) {
    cnt=0;
    for(char c='a'; c<='z'; c++) {
      bool left = false, right = false;
      for(int j = 0; j < i; j++) {
        if(s[j] == c) left = true;
      }
      for(int j = i; j < n; j++) {
        if(s[j] == c) right = true;
      }
      if(left && right) cnt++;
    }
    if(ans < cnt) ans = cnt;
  }
  cout << ans << endl;

  return 0;
}




Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <vector>
#include <iostream>
#include <set>
#define maxn 200009
using namespace std;
int n;
vector<pair<int,int> >G;
int rk[maxn];
multiset<int>X, Y;

bool cmp(int x, int y){
	return G[x].second > G[y].second;
}

long long getans(){
	auto it = X.begin();
	long long x1 = *it;
	it = X.end();
	--it;
	long long x2 = *it;
	it = Y.begin();
	long long y1 = *it;
 	it = Y.end();
 	--it;
 	long long y2 = *it;
 	return (x2 - x1) * (y2 - y1);
}

int main(){
	cin >> n;
	for(int i = 1; i <= n; i++){
		int x, y;
		scanf("%d%d", &x, &y);
		G.push_back(make_pair(min(x, y), max(x, y)));
	}
	
	sort(G.begin(), G.end());
	for(int i =0 ;i < n; i++)
		rk[i] = i;
	
	sort(rk, rk + n, cmp);
	
	for(int i = 0; i < n; i++){
		X.insert(G[i].first);
		Y.insert(G[i].second);
	}
	
	long long ans = getans();

	
	for(int i = 0; i < n; i++){
		if(rk[i] == 0)
			continue;
		auto it = Y.find(G[rk[i]].second);
		Y.erase(it);
		it = X.find(G[rk[i]].first);
		X.erase(it);
		Y.insert(G[rk[i]].first);
		X.insert(G[rk[i]].second);
		ans = min(ans, getans());
	}
	cout << ans << endl;
	return 0;
	
}

Measured memory_bytes: 21360
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<list>
using namespace std;
#define i64  long long
//  #define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807
#define MOD 1000000007


void solve()
{

  int T;
  cin>>T;
  vector<int> vec_T(T,0);
  for (int i = 0; i < T; i++)
  {
    cin>>vec_T[i];
  }
  
  int S;
  cin>>S;
  vector<int> vec_S(S,0);
  for (int i = 0; i < S; i++)
  {
    cin>>vec_S[i];
  }
  int counter = 0;
  for (int i = 0; i < S; i++)
  {
    for (int j = 0; j < T; j++)
    {
      if(vec_T[j]==vec_S[i])
      {
        counter++;
        break;
      }
    }
  }

  cout<<counter<<endl;
  
  
  
  
  return;
}

int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  solve();
 
  return 0;
}


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

int n;
int m;

long long int dist(pair<long long int, long long int> a, pair<long long int, long long int> b){
	return abs(a.first - b.first) + abs(a.second - b.second);
}

vector<pair<long long int,long long int> > v;
vector<pair<long long int, long long int> > vv;
int main(){
	cin >> n >> m;
	for (int i = 0; i < n; i++){
		long long int a, b;
		scanf("%lld%lld", &a, &b);
		v.push_back(make_pair(a, b));
	}
	for (int i = 0; i < m; i++){
		long long int a, b;
		scanf("%lld%lld", &a, &b);
		vv.push_back(make_pair(a, b));
	}
	for (int i = 0; i < v.size(); i++){
		int id = 0;
		long long int D = LLONG_MAX;
		for (int j = 0; j < vv.size(); j++){
			if (D>dist(v[i], vv[j])){
				D = dist(v[i], vv[j]);
				id = j;
			}
		}
		printf("%d\n", id + 1);
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep0(i, n) for (long long i = 0; i < (long long)(n); i++)
#define rep1(i,n) for(long long i=1;i<=(long long)(n);i++)
#define all(v) v.begin(),v.end()
#define Sort(v) sort(all(v))
#define Reverse(v) reverse(all(v))
#define Rsort(v) sort(all(v),greater)
#define pub(v) push_back(v)
#define pob(v) pop_back(v)
typedef long long ll;
typedef vector<ll> vel;
typedef vector<vector<ll>> vel2d;
typedef string str;
typedef pair<ll,ll> pal;
typedef vector<str> ves;
typedef vector<char> vech;

int main(){
    ll A,B,K;cin>>A>>B>>K;
    set<ll> S;
    rep0(i,K){
       if(A<=A+i&&A+i<=B){S.insert(A+i);}
    }
    for(ll i=K-1;i>=0;i--){
        if(A<=B-i&&B-i<=B){S.insert(B-i);}
    }
    for(auto value:S){
        cout<<value<<endl;
    }
}
      

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <climits>
#include <numeric>
#include <iomanip>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>
 
#define barsik ios::sync_with_stdio(false)
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
 
typedef long long ll;
typedef std::vector<int> vi;
typedef std::pair <int, int> pii;
typedef std::unordered_set <int> u_si;
 
using namespace std;
int n;
int a[200500];
void solve(){
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    map <int, int> dp;
    int ans = 0;
    bool ok = false;
    for(int i = 0; i < n; i++){
        int x = a[i];
        if(x == 1) ok = true;
        if(dp[x - 1] == 0 && x != 1) continue;
        dp[x] = dp[x - 1] + 1;
        ans = max(dp[x], ans);
    }
    if(!ok) cout << -1;
    else cout << n - ans;
}

 
int main(){
    barsik;
    int q = 1;
//    freopen("file.txt", "w", stdout);
    //cin >> q;
 
    for(double i = 1; i <= q; i++){
        //cout << "Case " << i << ": ";
        solve();
    }
}


Measured memory_bytes: 10368
#include <bits/stdc++.h>
#define f first
#define s second
#define N 1001
#define INF (1e9)
using namespace std;
typedef complex<double> P; //Point
typedef pair<P,P> L; //Line, Segment
const double EPS = 1e-8;
const double PI = 6.0 * asin(0.5);

double dot(P a, P b){ return real(conj(a)*b); }
double cross(P a, P b){ return imag(conj(a)*b); }
int ccw(P a, P b, P c){
  b -= a;
  c -= a;
  if(cross(b,c) > EPS) return 1;   // ????????????(b-a)????????´???????????????(c-a)????????¨?????????
  if(cross(b,c) < -EPS) return -1; // ????????????(b-a)????????´???????????????(c-a)????????¨?????????
  if(dot(b,c) < -EPS) return 2;
  if(norm(b) < norm(c)) return -2;
  return 0;
}

bool isIntersect(L s1, L s2){
  return ( ccw(s1.f,s1.s,s2.f) * ccw(s1.f,s1.s,s2.s) <= 0 &&
           ccw(s2.f,s2.s,s1.f) * ccw(s2.f,s2.s,s1.s) <= 0 );
}

typedef pair<double,int> Pi;
double dijkstra(vector<P>A,vector<P>B){
  vector<double>D(N,INF);
  priority_queue<Pi,vector<Pi>,greater<Pi> >Q;
  Q.push(Pi(0,0));
  D[0]=0;
  while(!Q.empty()){
    Pi t=Q.top();Q.pop();
    int pos=t.s;
    double cost=t.f;
    if(D[pos]<cost)continue;
    if(pos==1)return cost+abs(A[0]-A[1]);    

    for(int i=0;i<B.size();i++){
      double ncost=cost+abs(B[pos]-B[i]);
      if(isIntersect(L(A[0],A[1]),L(B[pos],B[i]))||D[i]<=ncost)continue;
      D[i]=ncost;
      Q.push(Pi(ncost,i));
    }
  }
  return INF;
}

int main(){
  int n,m;
  cin>>n>>m;
  vector<P> A(n),B(m); 
  for(int i=0,x,y;i<n;i++)cin>>x>>y,A[i]=P(x,y);
  for(int i=0,x,y;i<m;i++)cin>>x>>y,B[i]=P(x,y);
  double ans=min(dijkstra(A,B),dijkstra(B,A));
  printf("%.10f\n",ans<INF? ans:-1);
  return 0;
}

Measured memory_bytes: 3360
import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        int n=sc.nextInt();
        int a=n%10;
        int b=(n/10)%10;
        int c=n/100;
        if(a==7||b==7||c==7){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }

        
    }
}

Measured memory_bytes: 35784
#include<iostream>
#include<list>
#include<vector>

using namespace std;

void search(int n , int p, vector<int> &S, vector<list<int>> &V) {

	S[n] = S[n] + S[p];

	for (auto itr = V[n].begin(); itr != V[n].end(); itr++) {
		if (*itr == p) continue;

		search(*itr, n, S, V);
	}

	return;
}

int main() {
	
	int N, Q;
	cin >> N >> Q;

	vector<list<int>> V(N + 1);
	int a, b;

	for (int i = 1; i < N; i++) {
		cin >> a >> b;
		V[a].push_back(b);
		V[b].push_back(a);
	}

	vector<int> S(N + 1, 0);
	for (int i = 0; i < Q; i++) {
		cin >> a >> b;

		S[a] = S[a] + b;
	}
	
	search(1, 0, S, V);

	for (int i = 0; i < N; i++) {
		cout << S[i + 1] << " ";
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 31360
#include <bits/stdc++.h>
using namespace std;
int main(){
  int k,n;	cin >> k >> n;
  vector<int>	A(n);
  for(int i=0;i<n;i++){
    cin >> A.at(i);
  }
  
  int dis=0;
  for(int i=0;i<n-1;i++){
    dis=max(dis,A.at(i+1)-A.at(i));
  }
  dis=max(dis,A.at(0)+k-A.at(n-1));
  cout << k-dis;
}

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

int main()
{
	int N,i,j,total = 0;
	int d[100];
	
	do{
		cin >> N;
	}while(N < 2 || 50 < N);
	
	for(i=0;i < N;i++){
		do{
			cin >> d[i];
		}while(d[i] < 0 || 100 < d[i]);
	}
	
	for(i=0;i < N-1;i++){
		for(j=i+1;j < N;j++){
			total += d[i]*d[j];
		}
	}
	
	cout << total;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n;
		int a[];
		int b[];
		int d;

		while (true) {
			n = sc.nextInt();
			if (n == 0) {
				break;
			}

			a = new int[n + 1];
			b = new int[n];
			for (int i = 0; i < n + 1; i++) {
				a[i] = sc.nextInt();
			}
			for (int i = 0; i < n + 1; i++) {
				int id = 0;
				for (int j = 0; j < n; j++) {
					if (id == i) {
						id++;
					}
					b[j] = a[id++];
				}
				boolean f = true;
				d = b[1] - b[0];
				for (int j = 1; j < n; j++) {
					if (b[j] - b[j - 1] != d) {
						f = false;
					}
				}
				if (f) {
					System.out.println(a[i]);
					break;
				}
			}
		}
	}
}

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

#define LL long long
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(x) (x).begin(),(x).end()
const int IINF = 1e9;
const LL LINF = 1e18;
const LL mod = 1e9+7;

int main() {
    int N;
    cin >> N;
    vector<int> A(N), B(N), C(N);
    REP(i, N) {
        cin >> A[i];
        A[i]--;
    }
    REP(i, N) {
        cin >> B[i];
    }
    REP(i, N - 1) {
        cin >> C[i];
    }
    int last = -334;
    int res = 0;
    REP(i, N) {
        res += B[A[i]];
        if(last + 1 == A[i]) {
            res += C[last];
        }
        last = A[i];
    }
    cout << res << endl;
    return 0;
}



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

int main()
{
	int a, b, sum;
	
	while (scanf("%d %d", &a, &b) != EOF){
		int ans = 0;
		sum = a + b;
		while (sum > 0){
			sum /= 10;
			ans++;
		}
		printf("%d\n", ans);
	}
	return (0);
}

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

#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define ALL(v) (v).begin(), (v).end()
#define INF 1e9

using namespace std;
typedef pair<int, int> pii;

int main(){
  int n;
  while(cin >> n and n){
    vector<pii> place;
    place.push_back(make_pair(200, 200));
    int lb, db, rb, ub;
    lb = db = rb = ub = 200;
    REP(i, n-1){
      int t, dir;
      cin >> t >> dir;
      if(dir == 0){
        place.push_back(make_pair(place[t].first-1, place[t].second));
        lb = min(lb, place[t].first-1);
      }
      if(dir == 1){
        place.push_back(make_pair(place[t].first, place[t].second-1));
        db = min(db, place[t].second-1);
      }
      if(dir == 2){
        place.push_back(make_pair(place[t].first+1, place[t].second));
        rb = max(rb, place[t].first+1);
      }
      if(dir == 3){
        place.push_back(make_pair(place[t].first, place[t].second+1));
        ub = max(ub, place[t].second+1);
      }
    }
    cout << rb - lb + 1 << " " << ub - db + 1 << endl;
  }
  return 0;
}

Measured memory_bytes: 3100
#9_2
def shuffle(letter,num):
    for i in range(num):
        memory=''
        h=int(input())
        bellow=letter[0:h]
        above=letter[h:len(letter)]
        memory=above+bellow
        letter=memory
    return letter

##main##
while(True):
    letter=input()
    if(letter in "-"):
        break
    else:
        num=int(input())
        letter=shuffle(letter,num)
        print(letter)


Measured memory_bytes: 5600
#include <iostream>
#include <algorithm>

using namespace std;

int
main(void){
  long long int n, m;
  cin>>n>>m;
  
  if(n == 1 && m == 1){cout << 1 << endl;}
  else if(n == 1 && m > 1){cout << m-2 << endl;}
  else if(m == 1 && n > 1){cout << n-2 << endl;}
  else{    
    cout << (m-2)*(n-2) << endl;
  }
  return 0;
}

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

int main(){
	int n,c=0,i=0;
	cin>>n;
	while(n!=c){
		c=0;
		i++;
		for(int j=1; j<=i;j++){
			if(i%j==0) c++;
		}
	}
	cout<<i<<endl;
	return 0;
}


Measured memory_bytes: 3092
#include <iostream>
#include <algorithm>
using namespace std;
 
int board[10][10];
 
int main(){
    int H, W;
    cin >> H >> W;
    for(int i = 0; i < 10; i++){
        for(int j = 0; j < 10; j++){
            cin >> board[i][j];
        }
    }
    int necessary_cost[10];
    bool if_finished[10];
    for(int i = 0; i < 10; i++){
        necessary_cost[i] = 1e9;
        if_finished[i] = false;
    }
    necessary_cost[1] = 0;
    while(true){
        int min_cost = 1e9;
        int min_cost_number = -1;
        for(int i = 0; i < 10; i++){
            if(min_cost > necessary_cost[i] && !if_finished[i]){
                min_cost = necessary_cost[i];
                min_cost_number = i;
            }
        }
        if(min_cost_number == -1){
            break;
        }
        for(int i = 0; i < 10; i++){
            if(min_cost_number != i){
                necessary_cost[i] = min(necessary_cost[i], min_cost + board[i][min_cost_number]);
            }
        }
        if_finished[min_cost_number] = true;
    }
    int ans = 0;
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            int input;
            cin >> input;
            if(input != -1){
                ans += necessary_cost[input];
            }
        }
    }
    cout << ans << endl;
}

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

int main() {
   int r,g,b,n,a,t,x;
  cin>>r>>g>>b>>n;
  
  int ans=0;
  
  for(a=0;a <= n/r;a++){
    for(t=0;t <= n-a*r;t++){
      if((n-r*a-g*t)%b == 0 && n-r*a-g*t >= 0){
        
        ans++;}
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<math.h>
using namespace std;
int main() {
   int a,b;
   cin >> a >> b;
   int i = a + b;
   int j = a * b;
   int k = a - b;
   int ans = max(i,max(j,k)); 
   cout << ans << endl;
   return 0;
}

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

bool check(vector<int> nodes, vector<vector<int>> edges){
  bool ans = true;
  
  for(int i = 0; i < nodes.size()-1; i++){
    auto v = edges.at(nodes[i]); 
    auto itr = find(v.begin(), v.end(), nodes[i+1]);
    if(itr == v.end()){
      ans = false;
      break;
    }
  }
  return ans;
}

int main(){
  int N, M;
  cin >> N >> M;
  long ans = 0;
  
  vector<vector<int>> v(N);
  for(int i = 0; i < M; i++){
    int tmp1, tmp2;
    cin >> tmp1 >> tmp2;
    v.at(tmp1-1).push_back(tmp2-1);
    v.at(tmp2-1).push_back(tmp1-1);
  }
  
  vector<int> nodes;
  nodes.push_back(0);
  for(int i = 1; i < N; i++){
    nodes.push_back(i);
  }
  
  cerr << v.size() << " " << nodes.size() << endl;
   
  do {
    if(check(nodes, v)){
      ans += 1;
    }
  } while (next_permutation(nodes.begin()+1, nodes.end()));
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(){
	string s1;
	cin >> s1;
	bool flag=0;
	for(int i=0;i<s1.size();i+=2){
		if(s1[i]!='R'&&s1[i]!='U'&&s1[i]!='D')flag=1;
	}
	bool f=0;
	for(int i=1;i<s1.size();i+=2){
		if(s1[i]!='L'&&s1[i]!='U'&&s1[i]!='D')f=1;
	}
	if(flag||f)cout << "No" << endl;
	else cout << "Yes" << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;



public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int y = sc.nextInt();
		int a = 0;
		int b = 0;

		if (x == 2) {
			a = 2;
		} else if (x == 4 || x == 6 || x== 9 || x == 11) {
			a = 1;
		}

		if (y == 2) {
			b = 2;
		} else if (y == 4 || y == 6 || y== 9 || y == 11) {
			b = 1;
		}


		if ( a == b) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

}


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

int main() {
    int n;
    cin >> n;
    int a = n/10, b = n%10;
    if (a == 9 or b == 9) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main () {
  string S;
  cin >> S;
  int N = (int)S.size();
  for (int i = 0; i < N - 1; i ++) {
    if (S[i] == S[i + 1]) {
      cout << i + 1 << ' ' << i + 2 << endl;
      return 0;
    }
    if (i + 2 < N && S[i] == S[i + 2]) {
      cout << i + 1 << ' ' << i + 3 << endl;
      return 0;
    }
  }
  cout << "-1 -1" << endl;
}

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

int main() {
  int K, A, B;
  cin >> K >> A >> B;
  for (int i = K; i < 10000; i += K) {
    if (A <= i && i <= B) return cout << "OK" << "\n", 0;
  }
  cout << "NG" << "\n";
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
    using namespace std;
    #define INF 2000000000
    typedef long long int ll;
    typedef pair<ll,ll> ii;
    typedef pair<ii,ll> iii;
    typedef vector<ll> vi;
    typedef vector<ii> vii;
    #define getbit(n,i) (((n)&(1<<(i)))!=0)
    #define setbit0(n,i) ((n)&(~(1<<(i))))
    #define setbit1(n,i) ((n)|(1<<(i)))
    #define togglebit(n,i) ((n)^(1<<(i)))
    #define lastone(n) ((n)&(-(n)))
    #define read freopen("debug\\in.txt","r",stdin)
    #define write freopen("debug\\out.txt","w",stdout)
    #define fi first
    #define se second
    #define getI(a) scanf("%d",&a)
    #define getII(a,b) scanf("%d%d",&a,&b)
    #define PI (acos(-1))
    #define fastread ios_base::sync_with_stdio(false);cin.tie(NULL)
    #define mod (1000000007)
    #define asz 500005
    #define pb push_back
    #define ppf pop_front
    #define ppb pop_back
    #define pf push_front
    ll a[20][20];
    int main()
    {
        fastread;
        ll n,i,j,k,l,m;
        cin>>n;
        for(i=1;i<=n;i++){
        	ll temp=i;
        	ll temp1=i;
        	ll lastdis=temp%10;
        	ll fisdis;
        	while(temp!=0){
        		fisdis=temp%10;
        		temp/=10;
			}
			a[fisdis][lastdis]++;
		}
		ll sum=0;
		for(i=1;i<=9;i++){
			for(j=i;j<=9;j++){
				if(i!=j)
				sum+=(2*(a[i][j]*a[j][i]));
	            else
	            sum+=(a[i][j]*a[j][i]);
			}
		}
		cout<<sum;
    	return 0;
    }

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

int main() {
    string S;
    int count=0;
    int ans =0;
    cin >>S;
    if(S[0] != 'A'){
        cout <<"WA"<<endl;
        return 0;
    }
    for(int i=3;i<=S.size()-1;i++){
        if(S.at(i-1) == 'C')count++;
    }
    if(count != 1){
            cout << "WA"<<endl;
            return 0;
        }
     for(int i=1;i<=S.size();i++){
         if(isupper(S[i-1]))ans++;
         }
         if(ans != 2){
             cout<<"WA"<<endl;
             return 0;
     }
     cout <<"AC"<<endl;
}

Measured memory_bytes: 256
from collections import deque

K = int(input())
q = deque([])
if K < 10:
    print(K)
    exit()
for i in range(1, 10):
    q.append(i)
counter = 9
while counter < K:
    tmp = q.popleft()
    f = tmp%10
    tmp = tmp * 10
    if f == 0:
        q.append(tmp)
        q.append(tmp+1)
        counter += 2
    elif f == 9:
        q.append(tmp+f-1)
        q.append(tmp+f)
        counter += 2
    else:
        q.append(tmp+f-1)
        q.append(tmp+f)
        q.append(tmp+f+1)
        counter += 3
for i in range(K, counter):
    q.pop()
print(q.pop())

Measured memory_bytes: 74444
<?php   
fscanf(STDIN,"%d %d %d",$n,$m,$x);
//fscanf(STDIN,"%s",$t);
$point=array();
for($i=0;$i<$n;$i++){
	$point[] = explode(" ",trim(fgets(STDIN)));
}

function dfs(&$patterns,$li,$n){
  if(count($li)==$n){
    $patterns[]=$li;
    return;
  }
  for($i=0;$i<2;$i++){
    $li[]=$i;
    dfs($patterns,$li,$n);
    array_pop($li);
  }
  return;
}


$patterns=array();    
dfs($patterns,[],$n); //２進数全パターン

//print_r($patterns);
//print_r($point);

$sum_li = array();
$money=array();



foreach($patterns as $buy_key => $buy_val){
 for($i=0;$i<$n;$i++){
   if($buy_val[$i]=='1'){
      for($j=0;$j<=$m;$j++){
       $sum_li[$buy_key][$j] += $point[$i][$j];
      }
   }
 }
  for($k=1;$k<=$m;$k++){
    //print_r($sum_li[$buy_key]);
     //echo $sum_li[$buy_key][$k]."\n";
       if($sum_li[$buy_key][$k]<$x){
         $flag=false;
       }
  }
  if($flag){
    $money[]=$sum_li[$buy_key][0];
  }
  $flag=true;
}

//print_r($money);

if(count($money)==0){
  echo "-1\n";
}else{
 echo min($money)."\n";
}

Measured memory_bytes: 21980
use std::io;

fn main() {
    let n = get_num();
    let mut d: Vec<i32> = Vec::new();
    for _i in 0..n {
        d.push(get_num());
    }

    d.sort_by(|a, b| b.cmp(a));
    let mut step: Vec<i32> = Vec::new();

    let mut current = d[0];
    step.push(current);

    for num in d {
        if current > num {
            step.push(num);
            current = num;
        }
    }

    println!("{}", step.len());
}

fn get_num() -> i32 {
    to_i(&get_input())
}

fn to_i(s: &str) -> i32 {
    let input_num: i32 = match s.trim().parse() {
        Ok(num) => num ,
        Err(_)  => panic!("input wrong number."),
    };
    input_num
}

fn get_input() -> String {
    let mut input_str = String::new();
    io::stdin().read_line(&mut input_str)
        .expect("Failed to read line")
        ;
    input_str
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define rep(i, N) for(int (i) = 0; (i) < (N); (i)++)
#define all(v) (v).begin(), (v).end()
#define eb emplace_back
#define Cout(s) cout << s << endl
string Yes(bool b) {if(b){return "Yes";} else {return "No";}}
string YES(bool b) {if(b){return "YES";} else {return "NO";}}


int main(){
	int A, B, C;
	cin >> A >> B >> C;
	if(A == B) Cout(C);
	else if(A == C) Cout(B);
	else Cout(A);
}


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

int main() {
  int N;
  cin >> N;
  vector<int> A(N),B(N),C(N-1);
  for(int i=0;i<N;i++){
    cin >> A[i];
  }
  for(int i=0;i<N;i++){
    cin >> B[i];
  }
  for(int i=0;i<N-1;i++){
    cin >> C[i];
  }
  int cnt=0;
  for(int i=0;i<N;i++){
    cnt += B[A[i]-1];
    if(A[i]+1==A[i+1]){
      cnt += C[A[i]-1];
    }
  }
  cout << cnt << endl;  
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(v) v.begin(),v.end()

using namespace std;
typedef long long ll;




int main()
{
    
    int N;
    cin >> N;
    vector<ll> A(N);
    rep(i,N) cin >> A[i];
    sort(all(A));
    
    
    ll a = 0;
    int t = 0;
    rep(i,N-1){
        a += A[i];
        if(a*2 >= A[i+1]) continue;
        else t = i+1;
            
    }
    
    cout << N - t << endl;
    
 
    
    return 0;
}



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

int **dmatrix(int x,int y);	/*x行y列の配列を確保する*/
void free_dmatrix(int **a,int x);/*x行の配列を解放する*/

int main(void){
	int D;/*コンテストの日数通常365日*/
	int c[26];/*減点項*/
	int **s;/*加点項*/
	int lday[26]={0};/*最後にした日を記録（最初は0）*/
	int *t;/*スコア計算用*/
	int score;/*スコア*/
	int i,j;
	char str[1000000];
 
	/*入力*/
	fgets(str, sizeof(str), stdin);
	D=atoi(strtok(str," "));

	fgets(str,sizeof(str), stdin);
	c[0]=atoi(strtok(str," "));
	for(i=1;i<26;i++){
		c[i]=atoi(strtok(NULL," "));
	}
	s=dmatrix(D,26);
	for(i=0;i<D;i++){
		fgets(str,sizeof(str), stdin);
		s[i][0]=atoi(strtok(str," "));
		for(j=1;j<26;j++){
			s[i][j]=atoi(strtok(NULL," "));
		}
	}
	/*入力*/

	/*入力（出力を読み込む）*/
	t=(int*)calloc(D,sizeof(int));
	for(i=0;i<D;i++){
		fgets(str,sizeof(str), stdin);
		t[i]=atoi(strtok(str," "));
	}
	/*入力（出力を読み込む）*/

	/*スコア計算、出力*/
	score=0;
	for(i=0;i<D;i++){/*tに関しては例題の出力が1からだから補正*/
		score+=s[i][t[i]-1];
		lday[t[i]-1]=i+1;/*例題の出力が1からだから補正*/
		for(j=0;j<26;j++){
			score-=c[j]*(i+1-lday[j]);
		}
		printf("%d\n",score);
	}
	/*スコア計算、出力*/


	free(t);
	free_dmatrix(s,D);

	return 0;
}

int **dmatrix(int x,int y)			/*x行y列の配列を確保する.*/
{
	int i;
	int **a;
	if ( ( a = (int**)calloc(x,sizeof(int*)) ) == NULL){
		exit(1);
	}
	for(i=0;i<x;i++) a[i]=(int*)calloc(y,sizeof(int));
	return (a);
}

void free_dmatrix(int **a,int x)/*x行の配列を解放する.*/
{
	int i;
	for (i=0;i<x;i++) free((void*)(a[i]));	
	free((void*)(a)); 
}

Measured memory_bytes: 2176
import java.util.Scanner;
 
public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		int dist = in.nextInt();
		int time = in.nextInt();
		int speed = in.nextInt();
      	int need = dist / speed;
      	if (dist%speed != 0) need += 1;
      
      	if (time >= need) {
          	System.out.println("Yes");
        } else {
          	System.out.println("No");
        }
    }
}


Measured memory_bytes: 35672
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
struct UnionFind {
    vector<int> par;
    vector<int> rank;
    vector<ll> Size;
    UnionFind(int n = 1) {
        init(n);
    }

    void init(int n = 1) {
        par.resize(n + 1); rank.resize(n + 1); Size.resize(n + 1);
        for (int i = 0; i <= n; ++i) par[i] = i, rank[i] = 0, Size[i] = 1;
    }

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

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

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

    ll size(int x){
        return Size[root(x)];
    }
};

ll N, M;
set<ll> pathes[200100];
ll w[200100];
ll subscore[200100];
bool ERASED[200100];
ll s;

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N >> M;
    UnionFind uni(N + 1);
    for(int i = 1; i <= N; i++) cin >> w[i];
    for(int i = 1; i <= M; i++) {
        ll a, b;
        cin >> a >> b;
        pathes[a].insert(b);
        pathes[b].insert(a);
        uni.merge(a, b);
    }
s = 1;
    queue<int> que;
    for(int i = 1; i <= N; i++) {
        if(pathes[i].size() == 1) {
            que.push(i);
        }
    }
    while(!que.empty()) {
        ll now = que.front();
        que.pop();
        if(now == s) continue;
        if(pathes[now].empty()) continue;
        ERASED[now] = true;
        ll nowcost = subscore[now];
        ll to = *(pathes[now].begin());
        pathes[now].clear();
        auto itr = pathes[to].lower_bound(now);
        pathes[to].erase(itr);
        chmax(subscore[to], nowcost + w[now]);
        if(pathes[to].size() == 1) que.push(to);
    }
    ll ans = 0;
    ll subans = 0;
    for(int i = 1; i <= N; i++) {
        if(!uni.issame(i, s)) continue;
        if(ERASED[i]) continue;
        ans += w[i];
        chmax(subans, subscore[i]);
    }
    cout << ans + subans << endl;
    return 0;
}


Measured memory_bytes: 25244
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for (int i = s; i < (int)(n); i++)
#define out(x) cout << x << endl
#define INF 1000000;
#include <map>
#include <math.h>
 
using ll = long long;
using namespace std;

ll n, k;
const ll mod = 1000000007;



int main(){
    int n, i;
    cin >> n >> i;
    out(n-i+1);
    }

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define per(i,a,n) for (int i=n;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin,(x).end()
#define fi first
#define se second
#define SZ(x) ((int)x.size())
#define fastCin ios::sync_with_stdio(false)
typedef vector<int> vi;
typedef long long ll;
typedef pair<int,int> pii;
typedef double db;
const db pi=acos(-1);
const int mod=1e9+7;
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll quickpow(ll x,ll k) //x^k
{
	ll ans=1;
	while (k)
	{
		if (k&1) ans=ans*x%mod;
		x=x*x%mod;
		k>>=1;
	}
	return ans;
}
int main()
{
	fastCin;
	int x,y;
	cin>>x>>y;
	bool bo=false;
	rep(i,0,100)
		rep(j,0,100)
		{
			if (i+j==x && i*2+j*4==y) bo=1;
		} 
	if (bo) cout<<"Yes\n";else cout<<"No\n";
	return 0;
}


Measured memory_bytes: 3636
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

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

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            String a = in.next();
            String b = in.next();

            double tmp = Double.parseDouble(a + b);

            if (Math.sqrt(tmp) % 1 == 0) {
                out.println("Yes");
            } else {
                out.println("No");
            }

        }

    }
}



Measured memory_bytes: 23764
a=int(input())
b=int(input())
c=int(input())
x=int(input())
cnt = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i+100*j+50*k == x:
        cnt +=1
print(cnt)


Measured memory_bytes: 3060
#include<stdio.h>

int main(void){
  char str[4];
  scanf("%s",str);
  if(str[0]==str[1]&&str[2]==str[3]&&str[0]!=str[2]){printf("Yes");}
  else if(str[0]==str[2]&&str[1]==str[3]&&str[0]!=str[1]){printf("Yes");}
  else if(str[0]==str[3]&&str[1]==str[2]&&str[0]!=str[1]){printf("Yes");}
  else{printf("No");}
}


Measured memory_bytes: 128
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.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
#define mp make_pair
 
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");}

int N, M, K;
int Group[int(1e5 + 5)], Count[int(1e5 + 5)];
vector <int> Graph[int(1e5 + 5)];
int ans[int(1e5 + 5)];

int Prepare(){
  scanf("%d%d%d", &N, &M, &K);
  for (int i = 0; i < M; i++){
    int A, B; scanf("%d%d", &A, &B);
    Graph[A].push_back(B);
    Graph[B].push_back(A);
  }
  int now = 1; Group[1] = 1;
  queue <int> que; que.push(1);

  while (!que.empty()){
    int Q = que.front(); que.pop();
    for (int i = 0; i < Graph[Q].size(); i++){
      int next = Graph[Q][i];
      if (Group[next] != 0) continue;
      Group[next] = Group[Q];
      que.push(next);
    }
    if (que.empty()){
      for (int i = now; i <= N; i++){
        if (Group[i] != 0) continue;
        Group[i] = i; now = i;
        que.push(i); break;
      }
    }
  }

  for (int i = 1; i <= N; i++) Count[Group[i]]++;

  for (int i = 1; i <= N; i++){
    ans[i] = Count[Group[i]] - 1 - Graph[i].size();
  }
  return 0;
}

int Solve(){
  for (int i = 0; i < K; i++){
    int C, D; scanf("%d%d", &C, &D);
    if (Group[C] != Group[D]) continue;
    ans[C]--; ans[D]--;
  }

  return 0;
}

int main(){
  Prepare(); Solve();
  printf("%d", ans[1]);
  for (int i = 2; i <= N; i++) printf(" %d", ans[i]);
  printf("\n");

  return 0;
}


Measured memory_bytes: 7928
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
plus = []
ans = 0
for i in range(N):
    plus.append(i+1+A[i])
plus_cnt = Counter(plus)
for j in range(N):
    ans += plus_cnt[j+1-A[j]]

print(ans)

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

int n,m;

int main() {
    cin>>n;
    int a,b;
    cin>>a>>b;
    for(int i=1;i<1000;i++){
        if(n*i>=a&&n*i<=b){
            printf("OK");
            return 0;
        }
    }
    printf("NG");
    return 0;
}


Measured memory_bytes: 3760
#include<iostream>
#include<atcoder/modint>
#include<atcoder/convolution>
using namespace std;
using namespace atcoder;
using mint=modint998244353;
int N;
int c[1<<17];
mint dp[2][2];
mint fac[1<<17],inv[1<<17];
mint comb(int a,int b){return fac[a]*inv[b]*inv[a-b];}
mint F[1<<17];
int d[1<<17];
main()
{
	cin>>N;
	fac[0]=1;
	for(int i=1;i<1<<17;i++)fac[i]=fac[i-1]*i;
	inv[(1<<17)-1]=fac[(1<<17)-1].inv();
	for(int i=(1<<17)-1;i--;)inv[i]=inv[i+1]*(i+1);
	F[0]=1;
	for(int i=1;i<=N;i++)F[i]=F[i-1]*(2*i-1);
	for(int i=0;i<2*N;i++)
	{
		int h;cin>>h;
		c[h]++;
	}
	for(int i=0;i<1<<17;i++)d[c[i]]++;
	vector<mint>dp;
	dp.push_back(mint(1));
	for(int i=2;i<1<<17;i++)if(d[i]>=1)
	{
		vector<mint>now(i/2+1);
		now[0]=1;
		for(int k=1;k*2<=i;k++)
		{
			now[k]=comb(i,2*k)*F[k];
		}
		int D=d[i];
		while(D>0)
		{
			if(D&1)dp=convolution(dp,now);
			now=convolution(now,now);
			D>>=1;
		}
	}
	mint ans=0;
	for(int i=0;i<dp.size();i++)
	{
		mint now=dp[i]*F[N-i];
		if(i%2==1)ans-=now;
		else ans+=now;
	}
	cout<<ans.val()<<endl;
}


Measured memory_bytes: 6724
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;

long long cnt;
int l;
int A[1000000];
int n;
vector<int> G;

// Insertion sort with interval g
void Insertion_sort(int A[], int n, int g)
{
  for (int i = g; i < n; ++i)
  {
    int v = A[i];
    int j = i - g;
    while (j >= 0 && A[j] > v)
    {
      A[j + g] = A[j];
      j -= g;
      ++cnt;
    }
    A[j + g] = v;
  }
}

void shell_sort(int A[], int n)
{
  // Genarate G = {1, 4, 13, 40, 121, 364, 1093, ...}
  int g_i = 1;
  while (true)
  {
    if (g_i > n) break; // Interval is never greater than n
    G.push_back(g_i);     // Add G[i]
    g_i = 3 * g_i + 1;  // G[i + 1] = 3 * G[i] + 1
  }

  // Specify G[i] in reverse order
  for (int i = G.size() - 1; i >= 0; --i)
  {
    // Excute insertion sort with interval G[i]
    Insertion_sort(A, n, G[i]);
  }
}

int main()
{
  cin >> n;
  for (int i = 0; i < n; ++i) scanf("%d", &A[i]);
  cnt = 0;

  shell_sort(A, n);

  cout << G.size() << endl;
  for (int i = G.size() - 1; i >= 0; --i)
  {
    printf("%d", G[i]);
    if (i) printf(" "); // If n !=0 then add a white space
  }
  printf("\n");
  printf("%lld\n", cnt);
  for (int i = 0; i < n; ++i) printf("%d\n", A[i]);

  return 0;
}



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

using namespace std;

string ch[7] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};

int main()
{
	string s;
	cin >> s;
	
	for (int i = 0; i < 7; i ++)
	{
		if (s == ch[i])
		{
			cout << 7 - i << endl;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
// increment
#define rep_n(_1, _2, _3, NAME, ...) NAME
#define rep_2(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep_3(i, initial, n) for (int i = (int)(initial); i < (int)(n); ++i)
#define repeat(...) rep_n(__VA_ARGS__, rep_3, rep_2, rep_1)(__VA_ARGS__)
// decrement
#define rep_r_n(_1, _2, _3, NAME, ...) NAME
#define rep_r_2(i, n) for (int i = (int)(n); i > 0; i--)
#define rep_r_3(i, initial, n) for (int i = (int)(initial); i > (int)(n); i--)
#define repeat_r(...) rep_r_n(__VA_ARGS__, rep_r_3, rep_r_2)(__VA_ARGS__)
// define variable
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const double EPS = numeric_limits<double>::epsilon();
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

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

	vector<ll> A(N, 0), B(N, 0);
	map<int, int> m;

	repeat(i, N) {
		ll a, b;
		cin >> a >> b;
		m[b] += a;
	}

	string result = "Yes";
	unsigned long long sum = 0;

	for(auto i : m) {
		sum += i.second;

		if (sum > i.first) {
			result = "No";
			break;
		}
	}

	cout << result << endl;
	return 0;
}


Measured memory_bytes: 12800
using System;

namespace abc141
{
    class abc141b
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine();
            Console.WriteLine(Solve(s));
        }

        static string Solve(string s)
        {
            var isEasy = true;
            for(var i = 0; i != s.Length; ++i) {
                if((i + 1) % 2 == 1 && s[i] == 'L') {
                    isEasy = false;
                    break;
                }
                else if((i + 1) % 2 == 0 && s[i] == 'R') {
                    isEasy = false;
                    break;
                }
            }

            return isEasy ? "Yes" : "No";
        }
    }
}


Measured memory_bytes: 11092
def inputs(): return [int(x) for x in input().split()]
n,m = inputs()
A = inputs()
A = sorted(A,reverse=True)
cnt = 0
a = sum(A)
for i in A:
    if a<=i*4*m:
        cnt+=1
if m<=cnt:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 38384
#include "bits/stdc++.h"
using namespace std;

#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define eb emplace_back
#define ins insert
#define f first
#define s second
#define cbr cerr<<"hi\n"
#define mmst(x, v) memset((x), v, sizeof ((x)))
#define siz(x) ll(x.size())
#define all(x) (x).begin(), (x).end()
#define lbd(x,y) (lower_bound(all(x),y)-x.begin())
#define ubd(x,y) (upper_bound(all(x),y)-x.begin())
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());    //can be used by calling rng() or shuffle(A, A+n, rng)
inline long long rand(long long x, long long y) { return rng() % (y+1-x) + x; } //inclusivesss
string inline to_string(char c) {string s(1,c);return s;} template<typename T> inline T gcd(T a,T b){ return a==0?llabs(b):gcd(b%a,a); }

using ll=long long; 
using ld=long double;
#define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
#define DEC(i,s,e) for(ll i=s;i>=ll(e);--i)
using pi=pair<ll,ll>; using spi=pair<ll,pi>; using dpi=pair<pi,pi>; 

#define LLINF ((long long)1e18)
#define INF int(1e9+1e6)
#define MAXN (300006)
int main(){
	FAST
	ll x;cin>>x;
	cout<<(!x)<<'\n';
}


Measured memory_bytes: 3648
import java.io.*;
import java.util.*;
import java.math.*;
class Main{
    public static void main(String[] args){
    BufferedReader sc=new BufferedReader(new InputStreamReader(System.in));
    try {
        int n = Integer.valueOf(sc.readLine());
		int inside = Integer.valueOf(sc.readLine());
		int max = inside, flag = 0;
		for(int i=0; i<n; i++){
			String[] st = sc.readLine().split(" ");
			int now = Integer.valueOf(st[0])-Integer.valueOf(st[1]);
			inside+=now;
			max = Math.max(max,inside);
			if(inside<0)
				flag = 1;
		}
		if(flag==1)
			System.out.println(0);
		else
			System.out.println(max);
    }catch(Exception e){
        System.out.println("Error");
    }
    }
}

Measured memory_bytes: 33284
X = int(input())

work = list(range(2,X))
P = [True] * (X+1)
P[0] = False
P[1] = False

for a in work:
  if not P[a]:
    continue
  for i in range(a+a,X,a):
    P[i] = False
  #print(a,P)
#print(P)

for N in range(X,X+1000):
  flg = True
  for i in range(2,len(P)-1):
    if P[i] and N%i == 0:
      flg = False
      break
  
  if flg:
    print(N)
    exit(0)

Measured memory_bytes: 7668
/*  ***  In The Name of God ... ***  */
                                      /* Yani mishe mnm shakh sham ? ...  */
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define bug() cout << "BUG" << endl ;
#define X first
#define Y second
#define sz(x) (int)x.size()
#define per(how) cout << fixed << setprecision(how)
#define bit(a , b) (a >> b) & 1
#define all(v) v.begin() , v.end()
#define LB(x) (x & -x)
typedef long long ll;
typedef long double ld;
const ll INF = 1e18 , MOD = 1e9 + 7 ;
inline void smin(ll &x , ll y) { x = min(x , y) ; }
inline void smax(ll &x , ll y) { x = max(x , y) ; }

const ll MAXN = 30 ; 
string s ; 
ll ans = INF ; 


int main ()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> s ; 
	ll n = s.size() ; 
	for(ll i = 0 ; i < n ; i++)
	{
		string t = s ; 
		ll h = 0 ; 
		while(true)
		{
			bool mark[MAXN] ; 
			fill(mark , mark + MAXN ,false) ; 
			mark[t[0] - 'a'] = true ; 
			for(ll k = 1 ; k < t.size() ; k++)	
			{
				if(!mark[t[k] - 'a'])	goto hell ;
			}
			break ; 
			hell : 
			{
				++h ; 
				string prev = t ; 
		//		for(ll j =0 ; j < prev.size() - 1 ; j++)	t = t + prev[i] ;  
				t.pop_back() ; 
				for(ll k = 0 ; k < prev.size() - 1 ; k++)
				{
					if(prev[k] == s[i])		t[k] = prev[k] ;
					else if(prev[k + 1] == s[i])	t[k] = prev[k + 1] ; 
					else	t[k] = prev[k] ; 
				}
				if(t == prev)
				{
					h = INF ;
					break ; 
				}
			}
		}
	//	cout << i << " " << h << endl ; 
		smin(ans , h) ; 
	}
	cout << ans << endl ; 
return 0 ; 
}




Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <iomanip>


using namespace std;

#define sz(a) (int)a.size()

const int N = 200;
const int INF = 1e7;

int n, k, ans;
string s;

int main () {
	cin >> n >> k;
	cin >> s;
	for(int i = 0; i < sz(s) - 1; ++i) {
	 	if(s[i] == s[i + 1]) {
	 		++ans;
	 	}
	}
	cout << min(n - 1, ans + 2 * k);
	return 0;
}


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

char s[4040];
int cnt = 0;

int main()
{
    int n;
    scanf("%d",&n);
    int r = 0, g = 0, b = 0;
    long long cnt  = 0;

    scanf("%s",s +1);
    for(int i = 1; i <=n; i++)
        if(s[i] == 'R') r++;
        else if(s[i] == 'G') g++;
        else b++;
    for(int i = 1; i <=n ;i++)
    for(int j = i+1; j <=n; j++){
        int k = 2 *j  - i;
        if(k <= n && s[i] != s[j] && s[i] != s[k] && s[j] != s[k] )
            cnt++;
    }
    printf("%lld",1ll*r*g*b - cnt);

    return 0;
}


Measured memory_bytes: 1732
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
#include <time.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


bool check(string T,string P){
	if(P.length() > T.length())return false;

	int index = 0;
	for(int i = 0; i < T.length(); i++){
		if(T[i] == P[index]){
			index++;
			if(index == P.length())return true;
		}
	}
	return false;
}


int main(){

	string T,base_P,work_P,next_P;
	getline(cin,T);
	getline(cin,base_P);

	int ans = 0;

	work_P = base_P;
	while(check(T,work_P)){
		ans++;

		next_P = base_P;

		if((work_P.length()+1)*(base_P.length())+work_P.length() > T.length())break;

		for(int i = 0; i < work_P.length(); i++){
			next_P += work_P[i]+base_P;
		}
		work_P = next_P;
	}

	printf("%d\n",ans);

	return 0;
}



Measured memory_bytes: 3424
a = int(input())
b = int(input())
c = int(input())
x = int(input())

answer = 0
for i in range(0, a+1):
  for j in range(0, b+1):
    for k in range(0, c+1):
      if 500 * i + 100 * j + 50 * k == x:
        answer += 1
      else:
        continue
print(answer)

Measured memory_bytes: 3060
def resolve():
	n = int(input())
	c = []
	for _ in range(n):
		c.append(list(map(int, input().split())))
	dp = [[0, 0, 0] for _ in range(n)]
	dp[0] = c[0]
	for i in range(1, n):
		for j in range(3):
			for k in range(3):
				if j == k:
					continue
				else:
					dp[i][j] = max(dp[i][j], dp[i-1][k] + c[i][j])
	print(max(dp[-1]))
resolve()

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

int main()
{
    string s1,s2;
    cin>>s1>>s2;
    reverse(s2.begin(),s2.end());
    //cout<<"s1"<<s1<<" s2="<<s2<<endl;
    if(s1==s2)
    {
        cout<<"YES"<<endl;
    }
    else
        cout<<"NO"<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
#define debug puts("wzpakking")
#define y1 ysghysgsygsh
using namespace std;
const int N=100005;
const int mo=998244353;
int n;
int power(int x,int y){
	int s=1;
	for (;y;y/=2,x=1ll*x*x%mo)
		if (y&1) s=1ll*s*x%mo;
	return s;
}
struct G{
	vector<int> e[N];
	int vis[N],T,sg[N],a[N];
	void init(){
		int m;
		scanf("%d",&m);
		For(i,1,m){
			int x,y;
			scanf("%d%d",&x,&y);
			e[min(x,y)].PB(max(x,y));
		}
		Rep(i,n,1){
			++T;
			for (auto j:e[i]) vis[sg[j]]=T;
			for (;vis[sg[i]]==T;++sg[i]);
			//cout<<i<<' '<<sg[i]<<endl;
			a[sg[i]]=(a[sg[i]]+power(10,18*i))%mo;
		}
	}
}T[10];
int main(){
	int ans=0;
	scanf("%d",&n);
	For(i,1,3) T[i].init();
	For(i,0,1000) For(j,0,1000)
		ans=(ans+1ll*T[1].a[i]*T[2].a[j]%mo*T[3].a[i^j])%mo;
	printf("%d\n",ans);
} 
/*
3 3 3
2 2 3
2 3 2
3 2 2
1 1 3
1 3 1
3 1 1
  1 2
sg[4]=0;
sg[3]=1;
sg[2]
*/

Measured memory_bytes: 40448
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int r[100005],c[100005];
int main(){
    int n;
    cin>>n;
    double ans=0.0;
    for(int i=1;i<=n;i++){
        int x;
        cin>>x;
        ans+=1.0/(double)x;
    }
    printf("%.10f\n",1.0/ans);
}


Measured memory_bytes: 256