akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <stack>
#include <math.h>
#include <map>
#define Z class
#define ln cout<<'\n'
#define ll long long
#define rep(i, n) for(int i = 0; i < (n); ++i)
//ASCII a=97, A=65
// int H[N]; rep(i,N) scanf("%d", &H[i]);
// int max_x = *std::max_element(x.begin(), x.end());
// int min_y = *std::min_element(y.begin(), y.end());
using namespace std;
template<class T> inline bool chmax(T& a, T b){ if(a < b) { a=b; return 1; }return 0;}
template<class T> inline bool chmin(T& a, T b){ if(a > b) { a=b; return 1; }return 0;}
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
const long long INF = 1LL << 60;

int main(){
    int A; cin >> A;
    if(A>=1200) pr("ARC");
    else pr("ABC");
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<cmath>
#include<vector>
#include<string>
#include<algorithm>
#include<string.h>

#define ll long long
#define LL long long
#define ULL unsigned long long 
#define ull unsigned long long 
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)


using namespace std;

int main()
{
	char str[110] = {};
	int len=0;
	bool flag = true;
	int count = 0;
	while (cin >> str) {
		
		len = strlen(str);
		if (len % 2 != 0) {
			for (int i = 0; i < (len - 1)/2; i++) {
				if (str[i] != str[(len - 1) - i]) {
					flag = false;
				}
			}

		}
		else {
			for (int i = 0; i < (len) / 2; i++) {
				if (str[i] != str[(len - 1) - i]) {
					flag = false;
				}
			}
		}
		if (flag == true) {
			count++;
		}

		REP(i, 110) {
			str[i] == 0;
		}
		flag = true;
	}
	cout << count << endl;
	return 0;
}

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

#define INF 1e9
#define llINF 1e18
#define MOD 1e9+7
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
using namespace std;
string str[100];
int h,w;
int num;
bool flag;
bool used[100][100];
char moji[100];
int vx[4]={1,0,-1,0};
int vy[4]={0,1,0,-1};
void dfs(int Bit,int depth){
  if(Bit==((1<<num)-1)){
    flag=true;
    return;
  }
  for(int i=0;i<num;i++){
    if(!(Bit&(1<<i))){
      bool used2[100][100]={};
      int lemi=100,lema=0,rimi=100,rima=0;
      for(int j=0;j<h;j++){
	for(int k=0;k<w;k++){
	  if(str[j][k]==moji[i]){
	    used2[j][k]=true;
	    used[j][k]=true;
	    lemi=min(lemi,k);
	    lema=max(lema,k);
	    rima=max(rima,j);
	    rimi=min(rimi,j);
	  }
	}
      }
      bool fll=true;
      for(int j=rimi;j<=rima;j++){
	for(int k=lemi;k<=lema;k++){
	  if(!used[j][k]){
	    fll=false;
	  }
	}
      }
      if(fll)
	dfs(Bit+(1<<i),depth+1);
      for(int j=rimi;j<=rima;j++){
	for(int k=lemi;k<=lema;k++){
	  if(used2[j][k]){
	    used[j][k]=false;
	  }
	}
      }
    }
  }
}
int main(){
  int n;cin>>n;
  for(int i=0;i<n;i++){
    cin>>h>>w;
    num=0;
    for(int i=0;i<55;i++)
      for(int j=0;j<55;j++)
	used[i][j]=false;
    flag=false;
    bool alfa[26]={};
    for(int i=0;i<h;i++){
      cin>>str[i];
      for(int j=0;j<w;j++){
	alfa[str[i][j]-'A']=true;
      }
    }
    int cnt=0;
    for(int i=0;i<26;i++){
      if(alfa[i]){
	num++;
	moji[cnt]=(char)(i+'A');
	cnt++;
      }
    }
    dfs(0,0);
    if(flag)
      cout<<"SAFE"<<endl;
    else 
      cout<<"SUSPICIOUS"<<endl;
  }
  return 0;
}



Measured memory_bytes: 3096
#include <stdio.h>

int main(int argc, const char * argv[]) {

        int w,h,x,y,r;
        
        scanf("%d %d %d %d %d", &w, &h, &x, &y, &r);
        if (0 <= x-r  && x+r <= w && 0 <= y-r && y+r <= h) {
            printf("Yes\n");
        } else printf("No\n");
        
    
    
    return 0;
}

Measured memory_bytes: 580
import std.conv, std.functional, std.range, std.stdio, std.string;
import std.algorithm, std.array, std.bigint, std.complex, std.container, std.math, std.numeric, std.regex, std.typecons;
import core.bitop;

class EOFException : Throwable { this() { super("EOF"); } }
string[] tokens;
string readToken() { for (; tokens.empty; ) { if (stdin.eof) { throw new EOFException; } tokens = readln.split; } auto token = tokens.front; tokens.popFront; return token; }
int readInt() { return readToken.to!int; }
long readLong() { return readToken.to!long; }
real readReal() { return readToken.to!real; }

bool chmin(T)(ref T t, in T f) { if (t > f) { t = f; return true; } else { return false; } }
bool chmax(T)(ref T t, in T f) { if (t < f) { t = f; return true; } else { return false; } }

int binarySearch(alias pred, T)(in T[] as) { int lo = -1, hi = cast(int)(as.length); for (; lo + 1 < hi; ) { const mid = (lo + hi) >> 1; (unaryFun!pred(as[mid]) ? hi : lo) = mid; } return hi; }
int lowerBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a >= val)); }
int upperBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a > val)); }


enum MO = 10L^^9 + 7;
enum LIM = 3 * 10^^5;

long[] inv, fac, invFac;
void prepare() {
  inv = new long[LIM];
  fac = new long[LIM];
  invFac = new long[LIM];
  inv[1] = 1;
  foreach (i; 2 .. LIM) {
    inv[i] = MO - ((MO / i) * inv[cast(size_t)(MO % i)]) % MO;
  }
  fac[0] = invFac[0] = 1;
  foreach (i; 1 .. LIM) {
    fac[i] = (fac[i - 1] * i) % MO;
    invFac[i] = (invFac[i - 1] * inv[i]) % MO;
  }
}
long binom(long n, long k) {
  if (0 <= k && k <= n) {
    assert(n < LIM);
    return fac[cast(size_t)(n)] * invFac[cast(size_t)(k)] % MO * invFac[cast(size_t)(n - k)] % MO;
  } else {
    return 0;
  }
}

int N;
long A, B, C;

void main() {
  prepare();
  
  try {
    for (; ; ) {
      N = readInt();
      A = readLong();
      B = readLong();
      C = readLong();
      
      const P = (A * inv[cast(int)(A + B)]) % MO;
      const Q = (B * inv[cast(int)(A + B)]) % MO;
      auto PP = new long[N + 1];
      auto QQ = new long[N + 1];
      PP[0] = QQ[0] = 1;
      foreach (i; 1 .. N + 1) {
        PP[i] = (PP[i - 1] * P) % MO;
        QQ[i] = (QQ[i - 1] * Q) % MO;
      }
      
      long ans;
      long probSum;
      void doIt(int x, int y) {
        assert(x == N || y == N);
        assert(!(x == N && y == N));
        long tmp = (PP[x] * QQ[y]) % MO;
        tmp *= binom(x + y - 1, N - 1);
        tmp %= MO;
        probSum += tmp;
        probSum %= MO;
        debug {
          if (N <= 10) {
            writeln(x, " ", y, ": ", tmp);
          }
        }
        tmp *= (x + y);
        tmp %= MO;
        ans += tmp;
        ans %= MO;
      }
      
      foreach (x; 0 .. N) {
        doIt(x, N);
      }
      foreach (y; 0 .. N) {
        doIt(N, y);
      }
      debug {
        writeln("probSum = ", probSum);
      }
      
      ans *= ((100 * inv[cast(int)(A + B)]) % MO);
      ans %= MO;
      writeln(ans);
    }
  } catch (EOFException e) {
  }
}


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

int main() {
  int r, g, b;
  cin >> r >> g >> b;
  
  r *= 100;
  g *= 10;
  b += r + g;
  
  if (b % 4 == 0)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}

Measured memory_bytes: 256
(n, m) = gets.chomp.split(' ').map(&:to_i)

c = [0] * m

n.times do
  a = gets.chomp.split(' ').map(&:to_i)
  a.shift
  a.each {|v| c[v - 1] += 1}
end

puts c.count{|x| x == n}.to_s

Measured memory_bytes: 1788
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cwchar>
#include <cwctype>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long int ll;
typedef long double ld;
const ll INF=(1LL<<62);
const ld pi=acosl((ld)-1);
// const ll mod = 1000000007;
const ll mod = 1234567;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
#define endn "\n"

bool solve(){
  string s;cin>>s;
  cout<<(s[0]=='7' or s[1]=='7' or s[2]=='7' ? "Yes" : "No")<<endl;
  return false;
}

signed main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout<<fixed<<setprecision(30);
  solve();
}


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

int main(){
	double a, b, c, d, e, f, x, y;
	while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f)!=EOF){
		x = (b * f - c * e) / (b * d - a * e);
		y = (c * d - a * f) / (b * d - a * e);
		if(-0.0005 < x && x <= 0.0) x = 0.0;
		if(-0.0005 < y && y <= 0.0) y = 0.0;
		printf("%.3lf %.3lf\n", x, y);
	}

	return 0;
}

Measured memory_bytes: 1080
// 

import std.stdio,std.array,std.conv;
void main(){
  auto sn=readln.split,n=to!int(sn[0]);
  auto sk=readln.split,k=to!int(sk[0]);
  int d=1;
  for(int i=0;i<n;i++){
    int a=d*2;
    int b=d+k;
    if(a>b) d=b;
    else d=a;
    }
    
    writeln(d);
}

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

int main()
{
    string s;
    cin>>s;
    for (char c : s) {
    if (c == '?') {
      cout << "D";
    } else {
      cout << c;
    }
  }
  cout << endl;
  return 0;
}



Measured memory_bytes: 3752
//To include everything you need
#include <bits/stdc++.h>
using namespace std;
typedef std::vector<int>  vi;
typedef std::vector<std::pair<int,int> > vpi;
typedef std::vector<string>  vs;
typedef std::vector<char>  vc;


int main(){

    long  n;
    cin>>n;
    std::map<string,long> votes;
    int largestVote = 0;
    for(long i=0;i<n;i++){
        string vote;
        cin>>vote;
        votes[vote]++;
        int currLargest = votes[vote];
        if(currLargest > largestVote)
            largestVote = currLargest;
    }
    std::map<string,long>::iterator it;
    for(it = votes.begin();it != votes.end();it++){
        if(it->second == largestVote)
            cout<<it->first<<endl;
    }

}

Measured memory_bytes: 25216
#include <stdint.h>
#include <algorithm>
#include <bitset>
#include <functional>
#include <iostream>
#include <string>
#include <vector>

int main(int argc, char *argv[]) {
  using namespace std;
  string s;
  cin >> s;
  int flg = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'N')
      flg |= 1;
    else if (s[i] == 'S')
      flg |= 2;
    else if (s[i] == 'E')
      flg |= 4;
    else if (s[i] == 'W')
      flg |= 8;
  }
  if (flg == 3 || flg == 12 || flg == 15) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N; cin >> N;
	vector<int> v(N); rep(i, 0, N) { cin >> v[i]; }
	int x(0), y(0), sum(0);
	rep(i, 0, N) {
		sum += v[i];
		if (i & 1 && sum >= 0) {
			x += abs(sum) + 1;
			sum = -1;
		}
		else if (!(i & 1) && sum <= 0) {
			x += abs(sum) + 1;
			sum = 1;
		}
	}
	sum = 0;
	rep(i, 0, N) {
		sum += v[i];
		if (i & 1 && sum <= 0) {
			y += abs(sum) + 1;
			sum = 1;
		}
		else if (!(i & 1) && sum >= 0) {
			y += abs(sum) + 1;
			sum = -1;
		}
	}
	cout << min(x, y) << endl;
	return 0;
}

Measured memory_bytes: 1024
#include <stdio.h>
 
int main(){
  int n, a, b, c, d, i, j, k, h[5][4][11] = {};
  scanf("%d", &n);
  while(n--){
    scanf("%d%d%d%d", &a, &b, &c, &d);
    h[a][b][c] += d;
  }
 
  for(i = 1;i < 5;i++){
    for(j = 1;j < 4;j++){
      for(k = 1;k < 11;k++) printf(" %d", h[i][j][k]);
      puts("");
    }
    if(i != 4){
      for(k = 0;k < 20;k++) putchar('#');
      puts("");
    }
  }
  return 0;
}


Measured memory_bytes: 2104
N, K = map(int, input().split())
S = list(input())
r_cnt = 0
answer = 0
before = S[0]
for s in S:
  if s == before:
    answer += 1
  else:
    r_cnt += 1
    before = s
answer -= 1
if r_cnt%2 == 0:
  print(answer+min(r_cnt//2, K)*2)
elif r_cnt//2 >= K:
  print(answer+K*2)
else:
  print(answer+(r_cnt//2+1)*2-1)


Measured memory_bytes: 72248
#include<bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = a; i < b; i++)
typedef long long ll;

long long INF = 1e18;

int main(){
        string s,t;
        cin >> s>>t;

        for (int i = 0; i < s.size(); i++){
                if(s[i] != t[i]){
                        cout << "No" << endl;
                        return 0;
                }
        }
        cout << "Yes" << endl;

        return 0;
}


Measured memory_bytes: 3628
N = int(input())
P = [int(x) for x in input().split()]

PIdx = sorted([(i + 1, v) for i, v in enumerate(P)], key = lambda x: x[1])

L = [0]
for i in range(N + 1):
    L.append(i)

R = [i + 1 for i in range(N + 1)]
R.append(N + 1)

ans = 0
for i, v in PIdx:
    l1 = L[i]
    l2 = L[l1]
    r1 = R[i]
    r2 = R[r1]

    ans += v * ((i - l1) * (r2 - r1) + (l1 - l2) * (r1 - i))

    L[r1] = l1
    R[l1] = r1

print(ans)

Measured memory_bytes: 25788
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define debug(x) cerr << "[(" << __LINE__ << ") " << (#x) << "]: " << x << endl;

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

    char c;
    cin >> c;
    if (c > 'Z') cout << "a\n";
    else cout << "A\n";
}


Measured memory_bytes: 3664
#include <stdio.h>
#define rep(i,n)for(int i=0;i<(int)(n);i++)
int main(){
    int n,m,x,c[12]={0},a[12][12]={0},y,z[12],b,d=2e9;
    scanf("%d%d%d",&n,&m,&x);
    rep(i,n){
    scanf("%d",&c[i]);
        rep(j,m){
            scanf("%d",&a[i][j]);
        }
    }
    rep(i,2){rep(j,2){rep(k,2){rep(l,2){rep(o,2){rep(p,2){rep(q,2){rep(r,2){rep(s,2){rep(t,2){rep(u,2){rep(v,2){
        y=i*c[0]+j*c[1]+k*c[2]+l*c[3]+o*c[4]+p*c[5]+q*c[6]+r*c[7]+s*c[8]+t*c[9]+u*c[10]+v*c[11];
        for(b=0;b<m;b++){
            z[b]=i*a[0][b]+j*a[1][b]+k*a[2][b]+l*a[3][b]+o*a[4][b]+p*a[5][b]+q*a[6][b]+r*a[7][b]+s*a[8][b]+t*a[9][b]+u*a[10][b]+v*a[11][b];
            if(z[b]<x)break;
        }
        if(b==m&&y<d)d = y;
    }}}}}}}}}}}}
    if(d==(int)2e9)puts("-1");
    else printf("%d",d);
    return 0;
}

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

int main()
{
    long long int n, ans = 0, i;
    cin >> n;
    for(i = 1; i <= sqrt(n); i++){
        if(n%i == 0) ans = (n/i) + i - 2;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
sd = str(input())
t = str(input())

n = len(sd)
m = len(t)
s = []

for i in range(n-m, -1, -1):  # n-mするとm字分だけちょうど文字列取れる
    t_kamo = sd[i:i + m]
    for j in range(m + 1):
        # 1文字ずつ順に入りうるか調べる
        if j == m:  # 最後までいったら"?"を"a"に置き換えて出力
            print((sd[:i] + t + sd[i+len(t):]).replace("?", "a"))
            exit()
        if t_kamo[j] == "?":
            continue
        elif t_kamo[j] != t[j]:  # 文字列t_kamoと文字列tの同じ位置の文字が違うならbreak
            break

# 全部の文字列t_kamoにおいて最後まで文字列tが入らなかったらUNRESTORABLEを出力する
print("UNRESTORABLE")


Measured memory_bytes: 3064
#!/usr/bin/env python

if __name__ == '__main__':
    man = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]

    n = int(raw_input())
    for _ in range(n):
        b,f,r,v = map(int, raw_input().split())
        man[b-1][f-1][r-1] += v

    print ' '+('\n%s\n ' % ('#'*20)).join(map(lambda x : '\n '.join(map(lambda y : ' '.join(map(str, y)), x)), man))



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

int main() {
    int X, Y;
    cin >> X >> Y;
    int ans = 0;
    if(X == 1) ans += 300000;
    if(X == 2) ans += 200000;
    if(X == 3) ans += 100000;
    if(Y == 1) ans += 300000;
    if(Y == 2) ans += 200000;
    if(Y == 3) ans += 100000;
    if(X == 1 && Y == 1) ans += 400000;
    cout << ans << endl;
}

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

#define SZ(x) (int)(x.size())
#define REP(i, n) for(int i = 0; i < n; i++)
#define FOR(i, a, b) for(int i = a; i < b; i++)

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
const double eps = 1e-8;
const int MOD = 1000000007;

template<typename T>
struct edge {
    int src, to;
    T cost;

    edge() {}
    edge(int src, int to, T cost): src(src), to(to), cost(cost) {}
};

template<typename T>
using Graph = vector<vector<edge<T>>>;

template<typename T>
struct LowLink {
    const int inf = 1000000000;
    int sz;
    std::vector<int> pre, low;
    std::vector<bool> sel;
    std::vector<std::pair<int, int>> bridge;
    std::vector<int> articulation;

    LowLink(const Graph<T> &g) {
        sz = g.size();
        pre.resize(sz, inf);
        low.resize(sz, inf);
        sel.resize(sz, false);
        int cnt = 0;
        dfs(g, 0, -1, cnt);
    }

    void dfs(const Graph<T> &g, int now, int prev, int &cnt) {
        if(pre[now] != inf) {
            low[prev] = min(low[prev], pre[now]);
            return;
        }
        pre[now] = cnt;
        low[now] = cnt;
        cnt++;
        for(int i=0;i<(int)(g[now].size());++i) {
            int nxt = g[now][i].to;
            //if g is an undirected graph
            if(nxt == prev) continue;
            dfs(g, nxt, now, cnt);
        }
        if(prev != -1) low[prev] = min(low[prev], low[now]);
        if(prev != -1 && pre[prev] < low[now]) {
            bridge.emplace_back(make_pair(prev, now));
        }
    }

    void get_articulation(const Graph<T> &g, int now, int prev) {
        sel[now] = true;
        int art = 0;
        for(int i=0;i<(int)(g[now].size());++i) {
            int nxt = g[now][i].to;
            //cout << now << ":" << nxt << endl;
            if(sel[nxt]) continue;
            // if g is an undirected graph
            if(nxt == prev) continue;
            if(now == 0 || pre[now] <= low[nxt]) art++;
            get_articulation(g, nxt, now);
        }
        if((now == 0 && art >= 2) || (now != 0 && art >= 1)) articulation.push_back(now);
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    
    int n, m; cin >> n >> m;
    Graph<int> g(n);
    REP(i, m) {
        int u, v; cin >> u >> v;
        g[u].push_back(edge<int>(u, v, 1));
        g[v].push_back(edge<int>(v, u, 1));
    }

    LowLink<int> link(g);
    link.get_articulation(g, 0, -1);
    
/*     cout << "low" << endl;
    for(const auto &e: link.low) {
        cout << e << endl;
    }
    cout << "pre" << endl;
    for(const auto &e: link.pre) {
        cout << e << endl;
    }
    cout << "art" << endl; */

    sort(link.articulation.begin(), link.articulation.end());
    for(const auto &e: link.articulation) {
        cout << e << endl;
    }
}






Measured memory_bytes: 5708
x1, y1, x2, y2 = (int(i) for i in input().split())
x3 = x2 + (y1 - y2)
y3 = y2 + (x2 - x1)
x4 = x3 + (y2 - y3)
y4 = y3 + (x3 - x2)
print(x3, y3, x4, y4)

Measured memory_bytes: 9032
from heapq import heappush, heappop
import queue
import re
import math
import functools

def s_raw():
    return input().rstrip("\r")

def int_raw():
    return int(input())


def ss_raw():
    return input().split()


def ints_raw():
    return list(map(int, ss_raw()))


INF = 1 << 29


def make1d_arr(n, val=INF):
    return [val for i in range(n)]


def make2d_arr(h, w, val=INF):
    return [[val for i in range(w)]for i in range(h)]


def gcd(a, b):
    if(b == 0):
        return a
    return gcd(b, a % b)


def BFord(n,es):
    v_cost = [INF]*n
    v_cost[0] = 0
    for v in range(n*2):
        for e in es:
            frm = e[0]
            to = e[1]
            if v_cost[to] > v_cost[frm]+e[2]:
                v_cost[to] = v_cost[frm]+e[2]
                if v >= n:
                    v_cost[to] = -INF
        if v == n-1:
            prev = v_cost[:]
    v_cost = [-INF if prev[idx]!=v_cost[idx] else v_cost[idx] for idx in range(n)]
    return v_cost
    
def ZAlgo(s):
    l = len(s)
    A = [0]*l
    i =1
    j =0
    A[0]=l
    while i<l:
        while i+j<l and s[j] == s[i+j]:
            j+=1
        if j==0:
            i+=1
            continue
        A[i]=j
        k=1
        while (i+k<l) and (k+A[k]<j):
            A[i+k] =A[k]
            k+=1
        i+=k
        j-=k
    return A


def main():
    n,k = ints_raw()
    return sum([a>=k for a in ints_raw()])


if __name__ == "__main__":
    print(main())


Measured memory_bytes: 52508
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define rrep(i,n) for(int i=(int)n-1;i>=0;--i)
using namespace std;
using ll = long long;
template<typename T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T> inline bool chmin(T& a,T b){if(b<a){a=b;return 1;}return 0;}
template<typename T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_vec(size_t a,Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a,make_vec<T>(ts...));}
template<typename T,typename U,typename... V>
typename enable_if<is_same<T,U>::value>::type fill_v(U& u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V>
typename enable_if<!is_same<T,U>::value>::type fill_v(U& u,const V... v){for(auto& e:u)fill_v<T>(e,v...);}

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

    int n;
    cin >> n;
    vector<int> cnt(26);
    vector<string> s(n);
    rep(i, n) cin >> s[i];

    rep(i, n) {
        if (i == 0) rep(j, s[i].size()) cnt[s[i][j] - 'a']++;
        else {
            vector<int> now(26);
            rep(j, s[i].size()) now[s[i][j] - 'a']++;
            rep(j, 26) chmin(cnt[j], now[j]);
        }
    }

    string ans;
    rep(i, 26) ans += string(cnt[i], 'a' + i);
    cout << ans << endl;
}


Measured memory_bytes: 3644
int main(void){
    int m,f,r;

    while(1){
        scanf("%d%d%d",&m,&f,&r);
        if(m == (-1) && f == (-1) && r == (-1))
            break;

        if(m == -1 || f == -1)
            printf("F\n");
        else if(m + f >= 80)
            printf("A\n");
        else if(m + f >= 65)
            printf("B\n");
        else if(m + f >= 50)
            printf("C\n");
        else if(m + f >= 30){
            if(r >= 50)
                printf("C\n");
            else
                printf("D\n");
        }
        else
            printf("F\n");
    }
    return 0;
}

Measured memory_bytes: 584
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
typedef long long ll;
namespace mp = boost::multiprecision;
using Mint = mp::cpp_int;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = int(a); i < int(b); i++)
#define all(v) v.begin(), v.end()
#define uni(v) v.erase(unique(all(v)), v.end())
#define sort_g(v) sort(all(v), greater<int>())
#define dump(x) cerr << #x << ' ' << '=' << ' ' << x << endl

int main() {
    int N, R;
    string S;
    cin >> N;
    vector<tuple<string, int, int>> vec(N);

    rep(i, N) {
        cin >> S >> R;
        vec.at(i) = make_tuple(S, -1 * R, i + 1);
    }

    sort(all(vec));

    rep(i, N) {
        cout << get<2>(vec.at(i)) << endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define f first
#define s second
#define pb push_back
#define fix  cout<<std::fixed;
#define mk make_pair
#define mod 1000000007
#define time  cerr<< '\n' << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms\n" ;
#define IOS             ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int main()
{  IOS
	string a,b,ans="";
	cin>>a>>b;
	ll dp[a.length()+1][b.length()+1];

	memset(dp,0,sizeof(dp));

	for(int i=1;i<=a.length();i++)
	{
		for(int j=1;j<=b.length();j++)
		{
			if(a[i-1]==b[j-1])
				dp[i][j]=dp[i-1][j-1]+1;
			else
				dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
		}
	}
int x=a.length(),y=b.length();

	for(;x>0&&y>0;)
	{
       		if(a[x-1]==b[y-1])
       			{ans+=a[x-1];x=x-1;y=y-1;}
       		else if(dp[x-1][y]>dp[x][y-1])
       			{x=x-1;}
       		else y=y-1;
	}
reverse(ans.begin(),ans.end());
cout<<ans;
}


Measured memory_bytes: 70656
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b;
  cin >> a >> b;
  int modu_a = a%2;
  int modu_b = b%2;
  if (modu_a * modu_b == 0){
   cout << "Even" << endl; 
  }
  else {
   cout << "Odd" << endl; 
  }
}

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

using namespace std;
typedef long long ll;

int a, b, c, d, e, f;
int tot=-1, tok=1;
void solve()
{
     cin >> a >> b >> c >> d >> e >> f;
     for(int i = 0; i * a * 100 <= f; i++){
        for(int j = 0; j * b * 100 <= f - i * a * 100; j++){
            int water = i * a * 100 + j * b * 100;
            if(water == 0) continue;
            for(int r = 0; r * c <= f - water; r++){
                for(int k = 0; k * d <= f - water - r * c;k++){
                        int sugarsum = k * d + r * c;
                        int sum = water + sugarsum;
                        int real = i * a * e + j * b * e;
                        if(real < sugarsum || sum >f)  continue;
                    if(sugarsum * 1.0 / sum > tok *1.0 / tot ){
                         tot = sum;
                         tok=sugarsum;
                    }
                }
            }
        }
     }
     cout<< tot <<" "<< tok <<endl;
}
int main()
{
    ios::sync_with_stdio(0);cin.tie(0);
    solve();
    return 0;
}


Measured memory_bytes: 3584
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int d[100010];
    rep(i, N) cin >> d[i];
    sort(d, d + N);
    cout << d[N / 2] - d[N / 2 - 1] << endl; 

    return 0;
}


Measured memory_bytes: 4036
#include<iostream>
#include<algorithm>
using namespace std;
long long int A[100005];
int main()
{
	long long int n, res;
	while(cin >> n)
	{
		for(long long int i = 0; i < n; i++)
		{
			cin >> A[i];
			if(i == 0) res = A[i];
			if(i > 0) res = __gcd(res, A[i]);
		}
		cout << res << endl;
	}
	return 0;
}

Measured memory_bytes: 1024
from collections import Counter


mod = 2019
S = map(int, reversed(input()))

mods = [0]
num = 0
digit = 1
for s in S:
    num += s * digit
    num %= mod
    mods.append(num)
    digit = digit * 10 % mod

counter = Counter(mods)
ans = 0
for count in counter.values():
    ans += count * (count-1) // 2
print(ans)


Measured memory_bytes: 16692
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cassert>

#include<cmath>
#include<functional>
#include<algorithm>

#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<set>
#include<unordered_set>
#include<map>
#include<unordered_map>
#include<bitset>
#include<tuple>

#define TEST {IS_TEST=true;}

using namespace std;
using ll = int_fast64_t;
using v_bool = vector <bool>;
using v_ll = vector <ll>;
using v_std = vector <string>;
using p_ll = pair <ll,ll>;
using vv_ll = vector <vector <ll> >;
using vp_ll = vector < p_ll >;

bool IS_TEST=false;
ll ll_min=1LL<<63;
ll ll_max=~ll_min;
ll MOD = 1000000007;



ll N,K;
v_ll V;
int main(){
    cin >> N >> K;
    V.assign(N+1,0);
    for (ll i=1;i<=N;i++) cin >> V[i];
    sort(V.begin()+1,V.begin()+N+1);
    ll ans=0;
    for (ll i=N;i>N-K;i--) ans+=V[i];
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef vector<int> vi;
typedef vector<vi> vvi;

const int INF = 1000000000;

void combs(vvi &bk, vi &ct, int &mc, int i, int kt, int k, int x, vi xs, int c = 0) {
	kt++;
	c += ct[i];
	for (int j = 0; j < (int)xs.size(); j++)
		xs[j] += bk[i][j];
	if (kt < k) {
		for (int j = i + 1; j < (int)bk.size() + 1 - (k - kt); j++)
			combs(bk, ct, mc, j, kt, k, x, xs, c);
	} else {
		bool is = true;
		for (int j = 0; j < (int)xs.size(); j++) {
			if (xs[j] < x) {
				is = false;
				break;
			}
		}
		if (is)
			mc = min(mc, c);
	}
}

int main() {FIN
	
	int n, m, x, i, j, mc = INF;
	cin >> n >> m >> x;
	vi ct(n);
	vvi bk(n, vi(m));
	for (i = 0; i < n; i++) {
		cin >> ct[i];
		for (j = 0; j < m; j++)
			cin >> bk[i][j];
	}
	
	vi xs(m, 0);
	for (i = 1; i <= n; i++) {
		for (j = 0; j < (n - i + 1); j++) {
			combs(bk, ct, mc, j, 0, i, x, xs);
		}
	}
	
	if (mc == INF)
		cout << "-1\n";
	else
		cout << mc << "\n";
	
	return 0;
}


Measured memory_bytes: 3664
import Data.List
main=do
 [a,b]<-map read.words<$>getLine
 s<-getLine
 putStrLn(if(length.elemIndices '-')s==1&& null(elemIndices '-'(take a s))&& null(elemIndices '-'(drop(a+1)s))then"Yes"else"No")

Measured memory_bytes: 508
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
import sys

class SegmentTree():
    def __init__(self,n):
        self.e = 0
        self.r = 0 #ノードの段数
        cnt = 0
        while cnt<n:
            cnt=2**self.r
            self.r +=1
        self.tree = [self.e]*(2**self.r -1)# 0-index
        self.n = 2**(self.r-1) #一番下のnodeの数
    def build(self,lis):
        for i,val in enumerate(lis):
            self.update(i,val)
    def func(self,a,b): #適宜書き換え
        return max(a,b)
    def update(self,i,val):
        i += self.n -1
        self.tree[i] =self.func(self.tree[i],val)
        while i>0:
            i = (i-1)//2
            self.tree[i] = self.func(self.tree[i*2+1],self.tree[i*2+2])
    def query(self,l,r):
        l += self.n -1
        r += self.n -1 #半開区間[l,r) ==[l,r-1]  に対するquery
        lval = self.e
        rval = self.e
        while r>l:
            if l%2 == 0:
                lval = self.func(lval,self.tree[l])
                l+=1
            if r%2==0:
                rval = self.func(rval,self.tree[r-1])
                r-=1
            r//=2
            l//=2
        return self.func(lval,rval)
    def index(self,i):
        return i+self.n -1
    def value(self,i):
        return self.tree[i+self.n -1]

n,k = ma()
LR = []
A=[]
for i in range(n):
    A.append(ni())

mx=max(A)
dp = SegmentTree(mx+1)
for a in A:
    max_len = dp.query(max(0,a-k),min(mx+1,a+k+1))
    dp.update(a,max_len+1)
print(dp.query(0,mx+1))


Measured memory_bytes: 144948
import java.util.Scanner;

public class Main {
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		if (a <= b) {
			if (c <= a) {
				System.out.println(c + " " + a + " " + b);
			} else if (a < c && c <= b) {
				System.out.println(a + " " + c + " " + b);
			} else if (b < c) {
				System.out.println(a + " " + b + " " + c);
			}
		} else {
			if (c <= b) {
				System.out.println(c + " " + b + " " + a);
			} else if (b < c && c <= a) {
				System.out.println(b + " " + c + " " + a);
			} else if (a < c) {
				System.out.println(b + " " + a + " " + c);
			}
		}
	}
}


Measured memory_bytes: 17172
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  
  string S;
  unordered_map<string, int> count;
  long result = 0;
  
  for(int i=0; i < N; i++) {
    cin >> S;
    sort(S.begin(), S.end());
    if (count[S] > 0 ) {
      result += count[S];
    }
    count[S]++;
  }

  cout << result << endl;
}


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

int main(){
  string s;
  cin>>s;
  int k,count=0;
  k=s.size();
  for(int i=0;i<k;i++){
    if(s.at(i)=='o'){
      count++;
    }
  }
  if(8-count<=15-k){
    cout<<"YES"<<endl;
  }
  else{
    cout<<"NO"<<endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007
using namespace std;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
typedef pair<double,int> Pdi;
const ll INF=100000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
//priority_queue<Pdi,vector<Pdi>,greater<Pdi>> que;
//vector<Pli> v[18];
P2 xy[MAX_N]={};
ll dp[1<<18]={};
string str[100000];
typedef pair<int,int> O;
typedef pair<O,O> P;
vector<int> v[200001];
queue<int> que[2];
bool d[200001]={};
int A1[200001]={},B1[200001]={};
int main() {
	int n,m;
	int a,b;
	cin>>n>>m;
	string s;
	cin>>s;
	rep(i,m){
		cin>>a>>b;
		v[a-1].push_back(b-1);
		if(a!=b)v[b-1].push_back(a-1);
	}
	bool ans=false;
	int n1=n;
	rep(i,n){
		rep(j,v[i].size()){
			int g=v[i][j];
			if(s[g]=='A')A1[i]++;
			if(s[g]=='B')B1[i]++;
		}
		if(A1[i]==0||B1[i]==0){
			d[i]=true;
			que[0].push(i);
			n1--;
		}
	}
	bool x=0;
	while(1){
		bool p=false;
		while(!que[x].empty()){
			int q=que[x].front();que[x].pop();
			rep(j,v[q].size()){
				int g=v[q][j];
				if(!d[g]){
					if(s[q]=='A')A1[g]--;
					if(s[q]=='B')B1[g]--;

					if(A1[g]==0||B1[g]==0){
						d[g]=true;
						que[!x].push(g);
						p=true;
						n1--;
					}
				}
			}
		}
		if(!p){
			ans=true;
			break;
		}
		if(n1==0)break;
		x=!x;
	}
	if(ans)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}


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

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

	int n, c = 0;
	cin >> n;
	int p[25];
	cin >> p[0];
	cin >> p[1];
	for (int i = 2; i < n; i++) {
		cin >> p[i];
		if (p[i - 2] > p[i - 1] && p[i - 1] > p[i]) {
			c++;
		}
		if (p[i - 2] < p[i - 1] && p[i - 1] < p[i]) {
			c++;
		}
	}
	cout << c;
}

Measured memory_bytes: 256
#include <stdio.h>

int
main(void)
{
    int w, h, r, x, y;
    scanf("%d %d %d %d %d", &w, &h, &x, &y, &r);
    if (x - r >= 0 && y - r >= 0 && x + r <= w && y + r <= h)
        printf("Yes\n");
    else
        printf("No\n");

    return 0;
}


Measured memory_bytes: 2100
import java.util.*;
import java.lang.*;

public class Main {
    static boolean hardToInput(String code){
        for(int i=0; i<code.length()-1; i++){
            if(code.charAt(i)==code.charAt(i+1)) return true;
        }
        return false;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String code = sc.next();
        System.out.println(hardToInput(code) ? "Bad" : "Good");

    }
}

Measured memory_bytes: 23124
#include "bits/stdc++.h"
#define Rep(i,n) for(int i=0;i<n;i++)
#define For(i,n1,n2) for(int i=n1;i<n2;i++)
#define REP(i,n) for(ll i=0;i<n;i++)
#define RREP(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define put(a) cout<<a<<"\n";
#define all(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define TDARRAY(int,a,n,m) vector<vector<int>> a(n,vector<int>(m,0));
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
template<class T> inline bool chmax(T& a, T b) {if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a, T b) {if(a>b){a=b;return 1;}return 0;}

int x,y,z,k;
bool used[1000][1000][1000];
int dx[3][3]={{1,0,0},{0,1,0},{0,0,1}};
//int dy[3]={0,1,0};
//int dz[3]={0,0,1};

ll etop(stack<ll> s){
    if(!s.empty())return s.top();
    else return 1e11;
}

int main(){
    cin >> x >> y >> z >> k;
    int n=x+y+z;
    vector<ll> a(x);
    vector<ll> b(y);
    vector<ll> c(z);
    REP(i,x){
        cin >> a[i];
    }
    sort(all(a),greater<>());
    REP(i,y){
        cin >> b[i];
    }
    sort(all(b),greater<>());
    REP(i,z){
        cin >> c[i];
    }
    sort(all(c),greater<>());
    ll ma = a.front();
    ll mb = b.front();
    ll mc = c.front();
    priority_queue<pair<ll,vector<int>>> pq;
    vector<int> d(3);
    d={0,0,0};
    ll sp=0;
    sp += a[d[0]];
    sp += b[d[1]];
    sp += c[d[2]];
    pq.push(pair<ll,vector<int>>(sp,d));
    ll s = 0;
    ll res;
    REP(i,k){
        pair<ll,vector<int>> p = pq.top();pq.pop();
        s=p.first;
        REP(j,3){
            REP(k,3){
                d[k]=p.second[k]+dx[j][k];
            }
            if(d[0]<x&&d[1]<y&&d[2]<z){
                if(!used[d[0]][d[1]][d[2]]){
                    used[d[0]][d[1]][d[2]]=1;
                    sp=0;
                    sp+=a[d[0]];
                    sp+=b[d[1]];
                    sp+=c[d[2]];
                    pq.push(pair<ll,vector<int>>(sp,d));
                }
            }
        }
        res = s;
        put(res);
    }
    return 0;
}


Measured memory_bytes: 973440
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <climits>
#include <algorithm>
#include <utility>

using namespace std;
using Int = long long int;
using UInt = unsigned long long int;
using VI = vector<long long int>;

int main(void) {
    Int a, x;
    cin >> a >> x;
    if (a < x) {
        cout << 0 << endl;
    } else {
        cout << 10 << endl;
    }
    return 0;
}



Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(n) begin(n), end(n)
using ll = long long;
using namespace std;

int main(){
	int n;
	cin >> n;
	string s = to_string(n);
	rep(i, s.size()){
		if(s[i] == '7'){
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 3692
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
	int ret = 1;
	for (int i = 1; i <= 5; ++i) {
		int j;
		cin >> j;
		if (j == 0) {
			ret = i;
		}
	}

	cout << ret << endl;

	return 0;
}

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


using namespace std;


using ull = unsigned long long;


int main()
{
    string S;
    ull K;
    cin >> S;
    cin >> K;

    auto pos = S.find_first_not_of('1');
    if (string::npos == pos || pos + 1 > K) {
        cout << 1 << endl;
    } else {
        cout << S[pos] << endl;
    }
}


Measured memory_bytes: 256
using System;
using System.Linq;

class Program {
  public static void Main() {
    int[] input = Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();
    int num, time;
    
    if (input[0] == input[1]) {
      num = input[0];
      time = input[0];
    } else if (input[0] < input[1]) {
      num = input[0];
      time = input[1];
    } else {
      num = input[1];
      time = input[0];
    }
    
    for (int i = 1; i <= time; i++)
      Console.Write(num);
  }
}


Measured memory_bytes: 13268
#include<bits/stdc++.h>
    #define int ll
    #define M 1000000007
    #define hell 998244353
    #define inf 1e18
    #define pb push_back
    #define pi 3.1415926536
    #define mp make_pair
    #define ub upper_bound
    #define lb lower_bound
    #define all(a) a.begin(),a.end()
    #define ll long long
    #define vec vector <int>
    #define pii pair<int,int>
    #define endl "\n"
    #define gcd __gcd
    using namespace std;
    int parent[200005];
    int sz[200005];
    int k=0;
    int power(int x, unsigned int y, unsigned int m) 
    { 
        if (y == 0) 
            return 1; 
        int p = power(x, y/2, m) % m; 
        p = (p * p) % m; 
  
        return (y%2 == 0)? p : (x * p) % m; 
    } 
    int modInverse(int a, int m) 
    {   
        return power(a, m-2, m);
    }
    int nCrModPFermat(int n, int r, int p) 
    { 
           if (r==0) 
              return 1; 
  
        int fac[n+1]; 
        fac[0] = 1; 
        for (int i=1 ; i<=n; i++) 
            fac[i] = fac[i-1]*i%p; 
  
        return (fac[n]* modInverse(fac[r], p) % p * 
            modInverse(fac[n-r], p) % p) % p; 
    } 
    int find_set(int v) 
    {
        if (v == parent[v])
            return v;
        return find_set(parent[v]);
    }
    void union_sets(int a, int b) 
    {
        a = find_set(a);
        b = find_set(b);
        if (a != b)
        {    
            if(sz[a] < sz[b])
            {
                parent[a] = parent[b];
                sz[b] += sz[a];
                k=max(k,sz[b]);
            }
            else
            {
                parent[b] = parent[a];
                sz[a] += sz[b];
                k=max(k,sz[a]);
            }
        }
    }
    signed main()
    {
        ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
        ll t=1;
        // cin >> t;
        /*SAARE INPUTS LENA*/
        /*VARIABLES KI RANGE DEKHLENA*/
        /*EXPONENT RANGE OF OUTPUT KA DHYAN RAKHNA*/
        while(t-->0)
        {
            ll n=0,m=0;
            cin>>n;
            for(int i = 1;i<=n;i++)
            {
                parent[i] = i ;
                sz[i] = 1;
            }
            cin>>m;
            ll a=0,b=0;
            for (int i = 0; i < m; ++i)
            {
                cin>>a>>b;
                union_sets(a,b);
            }
            cout<<max(k,k-k+1);
            // cout<<k;
        }
        return 0;
    }


Measured memory_bytes: 6708
#include<stdio.h>

int main (void) {
  long long int N, M;
  scanf("%lld %lld",&N, &M);
  long long ans = 0;
  
  if(N*2>=M){
    ans = M/2;
  } else {
    ans = N;
    M -= N*2;
    ans += M/4;
  }

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

  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/














int H, W;
string S[2010];
vector<int> yoko[2010];
vector<int> tate[2010];
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> H >> W;
	rep(y, 0, H) cin >> S[y];

	rep(y, 0, H) yoko[y].push_back(-1);
	rep(x, 0, W) tate[x].push_back(-1);

	rep(y, 0, H) rep(x, 0, W) if (S[y][x] == '#') {
		yoko[y].push_back(x);
		tate[x].push_back(y);
	}

	rep(y, 0, H) yoko[y].push_back(W);
	rep(x, 0, W) tate[x].push_back(H);

	int ans = 0;
	rep(sx, 0, W) rep(sy, 0, H) if (S[sy][sx] == '.') {
		int yoko_idx = lower_bound(all(yoko[sy]), sx) - yoko[sy].begin();
		int L = sx - yoko[sy][yoko_idx - 1] - 1;
		int R = yoko[sy][yoko_idx] - sx - 1;

		int tate_idx = lower_bound(all(tate[sx]), sy) - tate[sx].begin();
		int D = sy - tate[sx][tate_idx - 1] - 1;
		int U = tate[sx][tate_idx] - sy - 1;

		chmax(ans, L + R + D + U + 1);
	}

	cout << ans << endl;
}







Measured memory_bytes: 38528
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <algorithm>
#define INF 0x3f3f3f3f;

using namespace std;

int main() {
    int k,cnt=0;
    long long n;
    scanf("%lld%d",&n,&k);
    while(n){
        cnt++;
        n=n/k;
    }
    printf("%d\n",cnt);
}


Measured memory_bytes: 128