akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
#define erep(i,n) for(int i = 0;i<=n;i++)
#define rep1(i,n) for(int i = 1;i<n;i++)
#define erep1(i,n) for(int i = 1;i<=n;i++)
typedef long long ll;
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstring vector<string>
#define vll vector<ll>
#define vbool vector<bool>
#define INF 1000000009
using P = pair<int,int>;

int main(){
  string s;
  cin >> s;
  char key = s[0];
  int ans = 1;
  int count = 1;
  bool flag = false;
  rep1(i,s.size()-1){
    if(count == 0){
      ans++;
      count = 1;
      key = s[i];
    }
    else if(count == 2){
      ans++;
      count = 0;
    }
    else if(key != s[i]){
      ans++;
      key = s[i];
    }
    else if(key == s[i]){
      count++;
    }
    //cout << count << " " << ans << endl;
  }
  if(count == 1 && s[s.size() -2] == s[s.size()-1]) ans--;
  cout << ans + 1 << endl;
}



Measured memory_bytes: 640
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

int cnt[50];

signed main()
{
    int N,K; cin>>N>>K;
    vint a(N); REP(i,N) cin>>a[i];

    REP(i,N) REP(j,50){
        if((a[i]>>j)&1) cnt[j]++;
    }

    K++;

    int ans=0,cur=0;
    for(int i=49;i>=0;i--){
        if(!((K>>i)&1)){
            cur+=(1LL<<i)*cnt[i];
        }
        else{
            int sum=cur+(1LL<<i)*cnt[i];
            for(int j=i-1;j>=0;j--)
                sum+=(1LL<<j)*max(cnt[j],N-cnt[j]);
            ans=max(ans,sum);
            cur+=(1LL<<i)*(N-cnt[i]);
        }
    }
    cout<<ans<<endl;
 
}


Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const long long int INF = 1100100100100100;

int main(){
    long long int v, e;
    cin >> v >> e;
    vector<vector<long long int>> g(v, vector<long long int>(v, INF));
    for(int i = 0; i < e; i++){
        long long int s, t, l;
        cin >> s >> t >> l;
        g[s][t] = l;
    }
    for(int i = 0; i < v; i++) g[i][i] = 0;

    for(int k = 0; k < v; k++){
        for(int i = 0; i < v; i++){
            for(int j = 0; j < v; j++){
                if(g[i][k] != INF && g[k][j] != INF){
                    g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
                }
            }
        }
    }

    bool ok = true;
    for(int i = 0; i < v; i++){
        if(g[i][i] < 0) ok = false;
    }

    if(ok){
        for(int i = 0; i < v; i++){
            for(int j = 0; j < v; j++){
                if(g[i][j] == INF) cout << "INF";
                else cout << g[i][j];

                if(j != v-1) cout << " ";
            }
            cout << endl;
        }
    }else{
        cout << "NEGATIVE CYCLE" << endl;
    }
    return 0;
}


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

int main(){
    string  s;
    cin >> s;
    int a = 0;int b = 0;
    for(int i = 0;i<s.size();i++){
      if(s.at(i) == '0'){
        a += 1;
      }else{
        b += 1;
      }
    }
    cout << min(a,b)*2 << endl;
}

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

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

using namespace std;

int n;
string s;
bool f[4];

int main(){
	cin >> s;
	n = s.size();

	const char* c = "NWSE";
	rep(i, n){
		rep(j, 4){
			if(s[i] == c[j]){
				f[j] = true;
			}
		}	
	}
	cout << (f[0] ^ f[2] || f[1] ^ f[3] ? "No" : "Yes") << endl;
	return 0;
}

Measured memory_bytes: 256
x,y = gets.split.map(&:to_i)
xm=x*(-1)
ym=y*(-1)
d=[]
if xm <= ym
    d.push 2+ym-xm
end
if xm <= y
    d.push 1+y-xm
end
if x <= ym
    d.push 1+ym-x
end
if x <= y
    d.push y-x
end
puts d.min
exit

Measured memory_bytes: 1788
#include<stdio.h>
#include<algorithm>
using namespace std;
int x[1500];
int y[1500];
int val[2000000];
int val2[2000000];
int main(){
	int a,b;
	while(scanf("%d%d",&a,&b),a+b){
		for(int i=0;i<a;i++)scanf("%d",x+i);
		int now=0;
		for(int i=0;i<a;i++)x[i]=now+=x[i];
		for(int i=0;i<b;i++)scanf("%d",y+i);
		now=0;
		for(int i=0;i<b;i++)y[i]=now+=y[i];
		now=0;
		for(int i=0;i<a;i++)
			for(int j=i;j<a;j++)
				val[now++]=x[j]-(i?x[i-1]:0);
		std::sort(val,val+now);
		int at=0;
		for(int i=0;i<b;i++)
			for(int j=i;j<b;j++)
				val2[at++]=y[j]-(i?y[i-1]:0);
		int ret=0;
		for(int i=0;i<at;i++){
			ret+=upper_bound(val,val+now,val2[i])-lower_bound(val,val+now,val2[i]);
	//		printf("%d %d\n",val2[i],upper_bound(val,val+now,val2[i])-lower_bound(val,val+now,val2[i]));
		}
		printf("%d\n",ret);
	}
}

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	long long int n,k;
	cin>>n>>k;
	map<long long int,long long int> m;
	vector<long long int> v;
	set<long long int> s;
	while(n--){
		long long int x;
		cin>>x;
		s.insert(x);
		m[x]++;
	}
	set<long long int>::iterator it;
	for(it=s.begin();it!=s.end();it++){
		v.push_back(m[*it]);
	}
	sort(v.begin(),v.end());
	if(v.size()<=k){
		cout<<"0";
	}
	else{
		long long int i=0;
		long long int ans=0;
		long long int delta=v.size()-k;
		while(delta--){
			ans+=v[i];
			i++;
		}
		cout<<ans;
	}
	return 0;
}

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

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define ll1 1ll
#define ONE 1ll
#define DBG 1
#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 loop(n) rep(loop, (0), (n))
#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;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>
istream &operator>>(istream &is, pair<T, S> &p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T, typename S>
ostream &operator<<(ostream &os, pair<T, S> &p) {
  os << p.first << " " << p.second;
  return os;
}

template <typename T> void printvv(const vector<vector<T>> &v) {
  cerr << endl;
  rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
    if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
      cerr << "INF";
    } else
      cerr << v[i][j];
    cerr << (j == v[i].size() - 1 ? '\n' : ' ');
  }
  cerr << endl;
}
/*
   typedef __int128_t Int;
   std::ostream &operator<<(std::ostream &dest, __int128_t value) {
   std::ostream::sentry s(dest);
   if (s) {
   __uint128_t tmp = value < 0 ? -value : value;
   char buffer[128];
   char *d = std::end(buffer);
   do {
   --d;
 *d = "0123456789"[tmp % 10];
 tmp /= 10;
 } while (tmp != 0);
 if (value < 0) {
 --d;
 *d = '-';
 }
 int len = std::end(buffer) - d;
 if (dest.rdbuf()->sputn(d, len) != len) {
 dest.setstate(std::ios_base::badbit);
 }
 }
 return dest;
 }

 __int128 parse(string &s) {
 __int128 ret = 0;
 for (int i = 0; i < s.length(); i++)
 if ('0' <= s[i] && s[i] <= '9')
 ret = 10 * ret + s[i] - '0';
 return ret;
 }
 */

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
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(signed argc, char *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);

  int N;
  cin >> N;
  vector<vector<int>> v(N, vector<int>(3));
  rep(i, 0, N) {
    rep(j, 0, 3) { cin >> v[i][j]; }
  }

  vector<vector<int>> dp(N + 1, vector<int>(3));

  rep(i, 0, N) {
    rep(j, 0, 3) {
      rep(k, 0, 3) {
        if (j == k)
          continue;
        chmax(dp[i + 1][k], dp[i][j] + v[i][k]);
      }
    }
  }
  cout<<*max_element(all(dp.back()))<<endl;

  return 0;
}


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

int N, cnt;

int main() {
    cin >> N;
    cnt = 0;
    int D1, D2, res = 0;
    for (int i = 0; i < N; i++) {
        cin >> D1 >> D2;
        if (D1 == D2) {
            cnt++;
            if (cnt == 3) res = 1;
        } else {
            cnt = 0;
        }
    }
    if (res == 0) cout << "No" << endl;
    else cout << "Yes" << endl;
}

Measured memory_bytes: 3632
input = STDIN.read.split("\n")

str = input[0]
target = input[1].to_i
pos = 0
num = 0
gosencho = 5*10**15

for i in 0...str.length
  c = str[i].to_i

  if c == 1
    pos = pos + 1
  else
    for l in 1..gosencho
      pos = pos + c**l
      if target <= pos
        break
      end
    end
  end

  if target <= pos
    num = c
    break
  end
end

print num


Measured memory_bytes: 1788
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <queue>
#include <vector>
using namespace std;
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200002
#define LIMIT2 500002
typedef long long ll;
typedef long double ld;
typedef const void cv;
#define rep(i,n) for((i)=0;(i)<(n);(i)++)
#define per(i,n) for((i)=(n)-1;(i)>=0;(i)--)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
#define zt(a,b) (max((a),(b))-min((a),(b)))
#define absl(v) labs((v))
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll nPr(int n,int r){ll i,result=1;rep(i,r){result*=(ll)(n-i);}return result;}
ll nCr(int n,int r){ll i,result=1;if(n<r) return 0;rep(i,min(r,n-r)){result*=(ll)(n-i);result/=(ll)(i+1);}return result;}
#define nHr(n,r) nCr((int)((n)+(r)+1),(int)(r))
#define sankaku(x) (((x)*((x)+1))/2)
int dx[8]={1,0,-1,0,1,-1,-1,1},dy[8]={0,1,0,-1,1,1,-1,-1};
int upint(cv *a, cv *b) { return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0; }
int downint(cv *a, cv *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; }
int upchar(cv *left, cv *right) {return strcmp((char *)left,(char *)right);}
int downchar(cv *left, cv *right) {return strcmp((char *)right,(char *)left);}
void tmpInit(int *c,ll m) {ll i;rep(i,m) c[i]=i;}
ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1){
      res *= a; if(mod>=1) res %= mod;
    }
    a *= a; if(mod>=1) a %= mod;
    n >>= 1;
  }
  return res;
}
void initialize(){
    
}
int a,b[LIMIT1],c[LIMIT1];
int d[LIMIT1];
int tmp(cv *p,cv *q){
  int n = c[*(int *)q]-c[*(int *)p];
  if(n != 0) return n;
  else return b[*(int *)q]-b[*(int *)p];
}
int main(void){
  initialize();
  ll n,m,i,j,k,result=0;
  char s[LIMIT1];
  priority_queue<ll,vector<ll>,greater<ll>> que;
  
  scanf("%lld %lld",&n,&m);
  rep(i,n){
    scanf("%d",&a);
    que.push(a);
    result += (ll)a;
  }
  rep(i,m){
    scanf("%d %d",&b[i],&c[i]);
  }
  tmpInit(d,m);
  qsort(d,m,sizeof(int),tmp);
  rep(i,m){
    while(b[d[i]]>=1){
      j = que.top();
      if(j>=c[d[i]]) break;
      que.pop();
      que.push(c[d[i]]);
      b[d[i]]--;
      result+=c[d[i]]-j;
    }
  }
  printf("%lld", result);
  
  return 0;
}

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

int main(){
	string input;
	cin >> input;
	
	int value;
	value = 700;
	
	if(input[0] == 'o'){
		value = value + 100;
	}
	
	if(input[1] == 'o'){
		value += 100;
	}
	
	if(input[2] == 'o'){
		value += 100;
	}
	
	
//	cout << 700 + 100*((input[0]+input[1]+input[2] - 'x'*3)/('o'-'x')) << endl;
	cout << value << endl;	
	return 0;
}

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

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define EB emplace_back
#define GREATER(T) T, VT<T> greater<T>
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

void simu(int N, VPII ans) {
    VI p(N);
    iota(ALL(p), 0);
    REP(_, N) {

        VPII battle;
        FORE(e, ans) {
            int l;
            REP(j, N) if (e.first == p[j]) l = j;
            int r;
            REP(j, N) if (e.second == p[j]) r = j;
            cout << "(" << l + 1 << ", " << r + 1 << "), ";
        }
        cout << endl;

        REP(i, N) p[i] = (p[i] + 1) % N;
    }
}

int main(void) {
    int N, M;
    cin >> N >> M;

    VPII ans;
    {
        int r = M % 2 == 0 ? M : M - 1;
        REP(i, M / 2) {
            ans.EB(i, r--);
        }
    }
    {
        int l = (M % 2 == 0 ? M : M - 1) + 1;
        int r = l + (M % 2 == 0 ? M - 1 : M);
        REP(i, (M + 1) / 2) {
            ans.EB(l + i, r--);
        }
    }


    FORE(e, ans) {
        cout << e.first + 1 << " " << e.second + 1 << endl;
    }

    // simu(N, ans);
}


Measured memory_bytes: 4168
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [input() for _ in range(n)]

n = int(input())

i = 1
ans = 1000000000000
while i * i <= n:
    if (n % i == 0):
        a = i
        b = n//a
        a_keta = len(str(a))
        b_keta = len(str(b))
        m_keta = max(a_keta, b_keta)
        ans = min(ans, m_keta)
    i += 1
print(ans)






Measured memory_bytes: 8988
if __name__ == '__main__':
    inp = input()

    nle = 0
    ngt = 0
    ans = 0
    for i in range(len(inp)):
        if inp[i] == '>':
            nle += 1
        else:
            ngt += 1

        if (i + 1 < len(inp) and inp[i] == '>' and inp[i + 1] == '<') or (i == len(inp) - 1):
            ans += (max(nle, ngt) * (max(nle, ngt) + 1)) / 2
            ans += (min(nle, ngt) * (min(nle, ngt) - 1)) / 2
            nle = 0
            ngt = 0

    print(int(ans))


Measured memory_bytes: 4232
//Ruthless Coding 
#include <bits/stdc++.h>

#define uni(x)      (x).resize(unique(all(x)) - (x).begin())
#define fprint(v)   for(auto x : v) cout << x << ' '
#define ALL(x)      (x).begin(), (x).end()
#define MP(x, y)    make_pair(x, y)
#define PII         pair<int, int>
#define SZ(x)       int((x).size())
#define PB(x)       push_back(x)
#define ll          long long
#define S           second 
#define F           first
#define nl          '\n'

using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
mt19937_64 rnd;

const int N = 2e5 + 5;

int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    string s;
    cin >> s;
    set<char> acgt = {'A', 'C', 'G', 'T'};
    int n = SZ(s);
    int ans = 0;
    int ct = 0;
    for(int i = 0; i < n; i++){
        if(acgt.find(s[i]) != acgt.end()){
            ct++;
        }else{
            ans = max(ans, ct);
            ct = 0;
        }
    }
    ans = max(ans, ct);
    cout << ans;
    return 0;
}


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

int main() {
    string n;
    std::cin >> n;
    rep(i, 3){
        if(n.at(i) == '7') {
            std::cout << "Yes" << std::endl;
            break;
        }
        if(i == 2) std::cout << "No" << std::endl;
    }
}


Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
long gcd(long m,long n){
  if(n==0)return (m<0?-m:m);
  return gcd(n,m%n);
}

main(){
  int N,X;
  long g;
  vector<long> x;
  cin>>N>>X;
  x.resize(N);
  for(int i=0;i<N;i++)cin>>x[i],x[i]-=X,x[i]*=(x[i]<0?-1:1);
  g=x[0];
  for(int i=1;i<N;i++)g=gcd(g,x[i]);
  cout<<g<<endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <vector>
#include <stdio.h>
#include <math.h>
#include <string.h>
using namespace std;
typedef long long ll;

//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)

#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))

//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく

//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

using namespace std;

int main(void){
 
  ll a,b,c,k;
  cin >> a >> b >> c >> k;
  int ans = 0;
  while(true){
    if( b > a ) break;
    ans++;
    b *= 2;
  }
  while(true){
    if( c > b ) break;
    ans++;
    c *= 2;
  }
  if( k >= ans ){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 3600
import java.util.Scanner

object Main {
  val sc = new Scanner(System.in)
  def main(args: Array[String]): Unit = {
    val wl = Seq(sc.nextInt, sc.nextInt, sc.nextInt).sorted

    val res = if(wl == Seq(5,5,7)) "YES" else "NO"

    println(res)
  }
}


Measured memory_bytes: 25408
#include <cmath>
#include <algorithm>
#include <iostream>
using namespace std;

void output(int i, int j) { cout << i << ' ' << j << endl; }

int main() {
    int n; cin >> n;
    int a[n]; for (int i = 0; i < n; i++) cin >> a[i];
    int b[n]; for (int i = 0; i < n; i++) b[i] = abs(a[i]);
    int k = max_element(b, b+n) - b;
    cout << 2*n-1 << endl;
    if (a[k] >= 0) {
        output(k+1, n);
        output(k+1, n);
        output(n, n);
        for (int i = 2; i < n; i++) output(n, i), output(n, n);
    } else {
        output(k+1, 1);
        output(k+1, 1);
        output(1, 1);
        for (int i = n-1; i > 1; i--) output(1, i), output(1, 1);
    }
}


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

using namespace std;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define fin(ans) cout << (ans) << endl;
#define blank(ans) cout << (ans) << " ";
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef long long lli;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<ld> vd;
typedef vector<str> vs;
typedef vector<ll> vll;
typedef vector<pair<ll, ll>> vpll;
typedef vector<pair<ll, str>> vpls;
typedef vector<tuple<str, ll, ll>> vtsl;
typedef vector<vector<ll>> vvll;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ld DMAX = 4500;
const ld DMIN = -4500;
const ll MOD = 1000000007;

//実行部
void Main()
{
  ll a, b, c; cin >> a >> b;
  fin((a+b)%24)
}

//前処理
int main()
{
  //ios::sync_with_stdio(false);
  //cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  Main();
  return 0;
}


Measured memory_bytes: 256
import kotlin.math.absoluteValue

fun main() {
    readLine()
    readLine()!!.split(" ").asSequence().map(String::toInt).sortedDescending()
            .mapIndexed { index, i ->  index to i }
            .groupBy { it.first.rem(2) == 0 }
            .map { e ->
                e.value.sumBy { it.second }
            }.reduce { alice, bob ->
                (alice - bob).absoluteValue
            }.let {
                println(it)
            }
}


Measured memory_bytes: 37256
import java.util.*;
import java.util.function.*;
import java.math.*;
public class Main {
    public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		String S = s.next();
		
		if(S.contains("RRR")) {
			System.out.println(3);
		}else if(S.contains("RR")) {
			System.out.println(2);
		}else if(S.contains("R")) {
			System.out.println(1);
		}else {
			System.out.println(0);
		}

	}
}

Measured memory_bytes: 35524
import java.util.Scanner;

public class Main {

    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());

        double sum = 0;

        for (int i = 0; i < n; i++) {
            double x = Double.parseDouble(sc.next());

            sum += (sc.next().equals("BTC")) ? x * 380000 : x;
        }

        System.out.println(sum);
    }
}


Measured memory_bytes: 21716
#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<climits>
using namespace std;



int n,m;
vector<int> cost;
vector<vector<int> > dp;
void init(){
  cost.clear();
  dp.clear();
}

bool input(){
  cin>>m>>n;
  if(n==0&&m==0)return 0;
  for(int i=0;i<n;i++){
    int tmp;
    cin>>tmp;
    cost.push_back(tmp);
  }
  return 1;
}

int rec(int i,int x){
  if(i==n){
    return 0;
  }
  if(x==m){
    return INT_MAX-1500010;
  }
  if(dp[i][x]!=0){
    return dp[i][x];
  }
  dp[i][x]=INT_MAX-1500010;
  int c=cost[i];
  for(int j=i+1;j<cost.size()+1;j++){
    dp[i][x]=min(dp[i][x],max(rec(j,x+1),c));
    c+=cost[j];
  }
  return dp[i][x];
}


int solve(){
  dp.resize(n);
  for(int i=0;i<n;i++){
    dp[i].resize(m);
  }
  return rec(0,0);
}


int main(){
  while(init(),input()){
    cout<<solve()<<endl;
  }
}

Measured memory_bytes: 1228
por_list = list(input().split(' '))

stack = []


for i in por_list:
    try:
        stack.append(int(i))
    except ValueError:
        x = stack.pop()
        y = stack.pop()
        if i == '+':
            stack.append(x+y)
        elif i == '-':
            stack.append(y-x)
        elif i == '*':
            stack.append(x*y)
print(stack.pop())


Measured memory_bytes: 5596
{-# LANGUAGE BangPatterns #-}

import Control.Monad
import Data.Char
import qualified Data.ByteString.Char8 as C
import Data.List
import qualified Data.Vector.Unboxed as U

main = sol <$> (get <$> C.getLine) <*> (get <$> C.getContents) >>= print

sub [n,a,b] = sol [n,a,b] <$> replicateM n readLn

get = unfoldr (C.readInt . C.dropWhile isSpace) 

sol [n,a,b] hs = bs 0 hi p
  where
  v = U.fromListN n hs
  hi = U.foldl1' (+) $ U.map (`dc` a) v
  p x = (x>=) . U.foldl1' (+) $ U.map (flip dc (a-b) . max 0 . subtract (x*b)) v
  bs !l !r p
    | l+1>=r    = r
    | p m       = bs l m p
    | otherwise = bs m r p
    where !m = (l+r) `div` 2

dc p q = (p+q-1) `div` q

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

using namespace std;

string s;
string::const_iterator iter;
string::const_iterator enditer;

typedef complex<int> number;

void cons(char e) {
  if(*iter == e) { iter++; }
  else { assert(0); }
}

bool ifcons(char e) {
  if(*iter == e) { cons(e); return true; }
  else { return false; }
}

#define DEBUG                                   \
  cout << "Remain string: \""                   \
  << string(iter, enditer) << endl;            \
  assert(0);

inline void check_overflow(number x) {
  if(abs(real(x)) > 10000 || abs(imag(x)) > 10000) { throw(0); }
}

number fact();
number term();
number expr();

number fact() {
  number ret; int sign = +1;
  if(ifcons('-')) {
    sign = -1;
  }
  
  if(ifcons('(')) {
    ret = expr();
    cons(')');
  }
  else if(isdigit(*iter)) {
    int num = 0;
    bool out = 0;
    while(isdigit(*iter)) {
      num *= 10; num += (*iter++)-'0';
      if(num > 10000) out = 1, num = 0;
    }
    if(out) { throw(0); }
    else { ret = number(num, 0); }
  }
  else if(ifcons('i')) { ret = number(0, 1); }
  else { DEBUG; }
  
  return ret*number(sign, 0);
}

number term() {
  
  number ret = fact();
  
  for(;;) {
    if(ifcons('*')) {
      ret *= fact();
      check_overflow(ret);
    }
    else { break; }
  }
  return ret;
}

number expr() {
  
  number ret = term();
  
  for(;;) {
    if(ifcons('+')) {
      ret += term();
      check_overflow(ret);
    }
    else if(ifcons('-')) {
      ret -= term();
      check_overflow(ret);
    }
    else { break; }
  }
  return ret;
}

int main() {
  
  while(getline(cin, s)) {
    iter = s.begin();
    enditer = s.end();
    number r;
    try {
      r = expr();
    } catch(...) {
      cout << "overflow\n";
      continue;
    }
    if(abs(real(r)) <= 10000 && abs(imag(r)) <= 10000) {
      if(r == number(0, 0)) cout << 0 << endl;
      else {
        bool f = 1;
        if(real(r) == 0) { f = 0; }
        else { cout << real(r); }
        if(imag(r) != 0) {
          if(f && imag(r) > 0) cout << "+";
          if(imag(r) < 0) cout << "-";
          cout << abs(imag(r));
          cout << "i";
        }
        cout << endl;
      }
    }
    else {
      cout << "overflow\n";
    }
  }
  
  return 0;
}

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

int main()
{
	int a, b, k = 0;
	int count = 1;

	std::cin >> a >> b >> k;

	for (int i = (a>b ? b : a); i > 0; i--) {
		if (a % i == 0 && b % i == 0)
		{
			if (count++ == k)
			{
				cout << i << std::endl;
				return 0;
			}
		}
	}

	cout << 0 << std::endl;

	return 0;
}

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

int main()
{
    int N, K, X, Y;
    cin >> N >> K >> X >> Y;

    int uns;
    if (N >= K) {
        uns = K * X;
        uns += (N - K) * Y;
    }
    else {
        uns = N * X;
    }

    cout << uns << endl;

    return 0;
}

Measured memory_bytes: 256
from math import ceil

N = int(input())
TA = [list(map(int, input().split())) for _ in range(N)]

def ceil(a, b):
    return a // b + int(a % b != 0)

a = 1
b = 1
for x, y in TA:
    n = max(ceil(a, x), ceil(b, y))
    a = n * x
    b = n * y
print(a + b)

Measured memory_bytes: 3188
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <vector>

#define INF (1 << 30)
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
const long long mod = 1e9+7;

using namespace std;
using ll = __int64_t;
using ull = unsigned long long;

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int DX[] = {1, 1, 0, -1, -1, -1, 0, 1};
int DY[] = {0, -1, -1, -1, 0, 1, 1, 1};

bool comp(const pair<int, ll>& p1, const pair<int, ll>& p2){
    return p1.second > p2.second;
}

void solve(){
    int n, k;
    int h[100000];
    cin >> n >> k;
    rep(i, n) cin >> h[i];

    int dp[n+1];
    rep(i, n) dp[i] = (1 << 30);
    dp[0] = 0;
    for(int now = 0; now < n; now++){
        for(int next = now+1; next <= min(n-1, now+k); next++){
            dp[next] = min(dp[now] + abs(h[now] - h[next]), dp[next]);
        }
    }
    cout << dp[n-1] << endl;
}

int main() {
    solve();
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
//----***やべーやつら***----
using namespace std;
#define int long long

//----***型定義***----
using ll = long long;
using P = pair<int,int>;

//----***Like a Pythonista***----
#define REP(ii,jj,nn) for (ll ii=jj;ii<(nn);ii++)
#define RREP(ii,nn,jj) for (ll ii = nn; jj<ii;ii--)
#define each(i,...) for (auto&& i:__VA_ARGS__)
#define ALL(vec) (vec).begin(),(vec).end()
#define sum(...) accumulate(ALL(__VA_ARGS__),0LL)
#define dsum(...) accumulate(ALL(__VA_ARGS__),0.0)
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
template<class T> inline auto max(const T& a){ return *max_element(ALL(a)); }
template<class T> inline auto min(const T& a){ return *min_element(ALL(a)); }
inline ll gcd(ll a,ll b){if(b == 0) return a;return  gcd(b,a%b);}
inline ll lcm(ll a,ll b){ll g = gcd(a,b);return a / g * b;}

//----***定数***----
#define MOD 1000000007
#define INF 100000000000000000
#define EPS 1e-9
#define PI  acos(-1)
const vector<vector<int>> DXY={{-1,0},{1,0},{0,-1},{0,1}};

//----***パーツ***----
#define fi first
#define se second
#define pb push_back
#define re return
#define br break

//----***入出力***---
void print() { std::cout << "\n"; }
template <class T>void print(const T &x) {std::cout << x<<"\n";}
template <class T, class... Args>void print(const T &x, const Args &... args) {std::cout << x << " ";print(args...);}
#define debug(var)  do{std::cerr << #var << " ↓ "<<"\n";view(var);}while(0);
#define dbg cerr<<"🥺🥺🥺🥺🥺🥺"<<endl;
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

//----***初期時読み込み***----
struct initial{initial(){cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(15);};}initial_;

struct Q{int a;int b;int c;};

signed main(){
  int N,ans=0,a,b;cin>>N;
  vector<int> arr(N),arr1(N);
  REP(i,0,N)cin>>arr[i];
  REP(i,0,N)cin>>arr1[i];
  REP(i,0,N)ans+=(arr[i]-arr1[i]>0?arr[i]-arr1[i]:0);
  print(ans);
}


Measured memory_bytes: 256
import math
n = int(input())
x = [0] * n
y = [0] * n
for i in range(n + 1):
    try:
        x[i], y[i] = map(int, input().split())
    except EOFError:
        break
zen = []
for j in range(n):
    for k in range(n):
        d = math.hypot((x[j] - x[k]), (y[j] - y[k])) * math.factorial(n - 1)
        zen.append(d)
a = sum(zen) / math.factorial(n)
print(a)

Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int num[1000];
const string ans[] = {"black","blue","lime","aqua","red",
		      "fuchsia","yellow","white"};
int ff = 15*16 + 15;
int RGB[][3] = {{0,0,0},
		{0,0,ff},
		{0,ff,0},
		{0,ff,ff},
		{ff,0,0},
		{ff,0,ff},
		{ff,ff,0},
		{ff,ff,ff}};

int _16to10(string a){
  return num[a[0]] * 16 + num[a[1]];
}
int main(){
  num['1'] = 1,  num['2'] = 2,  num['3'] = 3,  num['4'] = 4,num['5'] = 5,num['6'] = 6,num['7'] = 7,num['8'] = 8,num['9'] = 9,num['a'] = 10,num['b'] = 11,  num['c'] = 12,  num['d'] = 13,  num['e'] = 14,num['f'] = 15;
  string color;
  while(cin >> color,color[0] !='0') {
    string r,g,b;
    r = color.substr(1,2);
    g = color.substr(3,2);
    b = color.substr(5,2);
    int rnum,gnum,bnum;
    rnum = _16to10(r);
    gnum = _16to10(g);
    bnum = _16to10(b);
    double mn = 1000000000;
    string anscolor;
    for(int i = 7 ; i >= 0 ; i-- ){
      double dk = pow(rnum-RGB[i][0],2)+pow(gnum-RGB[i][1],2)+pow(bnum-RGB[i][2],2);
      if(mn >= dk){
	mn = dk;
	anscolor = ans[i];
      }
    } 
    cout << anscolor << endl;
  }
  return 0;
}

Measured memory_bytes: 1192
#include <iostream>
#include <string>
using namespace std;
int main(){
	string str,ans="";
	char hennkann;
	getline(cin,str);
	for(int i=0;i<str.size();i++){
		if('a'<=str[i]&&str[i]<='z'){
			hennkann=str[i];
			hennkann-=32;
			ans+=hennkann;
		}else if(str[i]==' '){
			ans+=' ';
		}else{
			ans+='.';
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3108
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define NMAX 110000
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
typedef long long int ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll mod = 1e+9+7;

int main()
{	
    ll a,p; cin >> a >> p;

    cout << (3*a+p)/2 << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull  unsigned long long ;
#define _CRT_SECURE_NO_WARNINGS 
const double  pai= acos(-1.0);
const int max1=5e5+5;
int a[max1];
int main()
{
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	int n,i,sum=0;
	cin>>n;
	for(i=1;i<n;i++)
	cin>>a[i];
	a[i]=a[i-1];
	sum+=a[1];
	for(i=1;i<n;i++)
	sum+=min(a[i],a[i+1]);
	cout<<sum;
	return 0;
 }

Measured memory_bytes: 256
//#pragma GCC target ("avx2,sse2")
//#pragma GCC optimization ("Ofast")
//#pragma GCC optimization ("unroll-loops")
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <set>
#include <queue>

using namespace std;

const int N = 2e6 + 14;
const int INF = 1e9;
const int mod = 1e9;
const int SZ = (1 << 17) - 1;
const int K = 320;

#define eb emplace_back
#define sz(s) (int)(s.size())
#define ppb pop_back

#define ll long long

void solve() {
	int n, m, len;
	cin >> n >> m >> len;
	int x, y;
	cin >> x >> y;
	string s, t;
	cin >> s >> t;
	int mnx = 1;
	int mxx = n;
	int mny = 1;
	int mxy = m;
	for (int i = sz(s) - 1; i >= 0; -- i) {
		if (t[i] == 'L') {
			++mxy;
			mxy = min(mxy, m);
		}
		if (t[i] == 'R') {
			--mny;
			mny = max(1, mny);
		}
		if (t[i] == 'D') {
			--mnx;
			mnx = max(1, mnx);
		}
		if (t[i] == 'U') {
			++mxx;
			mxx = min(mxx, n);
		}
		if (s[i] == 'L') 
			++mny;
		if (s[i] == 'R')
			--mxy;
		if (s[i] == 'U')
			++mnx;
		if (s[i] == 'D')
			--mxx;
		if (mxy < mny or mxx < mnx) {
			cout << "NO";
			return;
		}
	}
	if (x > mxx or y > mxy or x < mnx or y < mny)
		cout << "NO";
	else
		cout << "YES";
}

main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	solve();
	return 0;
}


Measured memory_bytes: 920
#include <stdio.h>
#include <stdlib.h>//random,NULL
#include <string.h>
#include <time.h>
#include <unistd.h>//sleep()
#include <math.h>
#include <stdbool.h>

#define rep(i,n) for(int i=0; i<((int)n); i++)
#define REP(i,n) for(int i=0; i<=((int)n); i++)
#define srep(i,a,n) for(int i=a; i<((int)n); i++)
#define SREP(i,a,n) for(int i=a; i<=((int)n); i++)
#define rrep(i,n) for(int i=n-1; i>=0; i--)
#define RREP(i,n) for(int i=n; i>=0; i--)
#define INF 1000000000


int main(){
  char buf[1024];
  char S[12];
  int N;
  int K;

  fgets(buf,sizeof(buf),stdin);
  sscanf(buf, "%d", &N);

  fgets(S,sizeof(S),stdin);

  fgets(buf,sizeof(buf),stdin);
  sscanf(buf, "%d", &K);

  rep(i,N){
    if(S[i]!=S[K-1]){
      S[i]='*';
    }
  }

  printf("%s\n",S);

  return 0;


}


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

int main(){
    int n;
    cin >> n;
    vector<int> scores(n);
    for (int i=0;i<n;i++){
        cin >> scores[i];
    }
    int total_score = accumulate(scores.begin(), scores.end(), 0);
    if (total_score % 10 != 0){
        cout << total_score << endl;
    } else {
        vector<int> non_ten_divisible;
        for (auto &s : scores){
            if (s % 10 != 0){
                non_ten_divisible.push_back(s);
            }
        }
        if (non_ten_divisible.size() == 0){
            cout << 0 <<endl;
        } else {
            cout << total_score - *min_element(non_ten_divisible.begin(), non_ten_divisible.end()) << endl;
        }
    }
    return 0;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define debug(x) cout<<x
#define pb push_back
#include<string.h>
ll modex(ll a, ll b, ll mod){
	ll ans=1;
	while(b){
		if(b%2) ans=(ans*a)%mod;
		a=(a*a)%mod;
		b/=2;
	}
	return ans;
}
ll count(ll val){
	ll cnt=0;
	while(val){
		if(val%2) cnt++;
		val/=2;
	}
	return cnt;
}
ll fun(ll val){
	if(val==0) return 0;
	return (1+fun(val%count(val)));
}
int main(){
	ios_base::sync_with_stdio(false); 
    cin.tie(NULL);                    
    cout.tie(NULL);
    ll T=1;
    //cin>>T;
    while(T--){
    	ll n;
    	cin>>n;
    	string str;
    	cin>>str;
    	ll val=0,val1=0,val2=0,cnt=0;
    	for(int i=0;i<n;i++) if(str[i]=='1') cnt++;
    	for(int i=0;i<n;i++){
    		val=(val+(int)(str[i]-'0')*modex(2,n-1-i,cnt))%cnt;
    		val1=(val1+(int)(str[i]-'0')*modex(2,n-1-i,cnt+1))%(cnt+1);
    		if(cnt>1)val2=(val2+(int)(str[i]-'0')*modex(2,n-1-i,cnt-1))%(cnt-1);
    	}
    	for(int i=0;i<n;i++){
    		if(str[i]=='1'){
    			if((cnt-1)==0) {
    				cout<<"0"<<endl;
    				continue;
    			}
    			ll value=((((val2-modex(2,n-1-i,cnt-1))%(cnt-1))+(cnt-1))%(cnt-1));
    			cout<<(1+fun(value))<<endl;
    		}
    		else{
    			ll value=((val1+modex(2,n-1-i,cnt+1))+cnt+1)%(cnt+1);
    			cout<<(1+fun(value))<<endl;
    		}
    	}
    }
   	return 0; 
}

Measured memory_bytes: 3732
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int R = sc.nextInt();
        int ans;
        if (N < 10) {
            ans = R+100*(10-N);
        } else {
            ans = R;
        }
        System.out.println(ans);
    }
}



Measured memory_bytes: 21204
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math

n = getN()

r_vectors = []
l_vectors = []
py = []
ny = []
for i in range(n):
    x, y = getList()
    if x == 0:
        if y > 0:
            py.append((x, y))
        elif y < 0:
            ny.append((x, y))
        else:
            n -= 1

    elif x > 0:
        r_vectors.append((x, y))
    else:
        l_vectors.append((x, y))




l_vectors.sort(key=lambda v:-v[1]/v[0])
r_vectors.sort(key=lambda v:-v[1]/v[0])


r_vectors = r_vectors + ny

l_vectors = l_vectors + py

vectors = (r_vectors + l_vectors) * 2

# print(vectors)
ans = 0

for i, start in enumerate(vectors[:n]):
    tx, ty = 0, 0
    for j in range(n):
        # print(i, j)
        x, y = vectors[i+j]
        tx += x
        ty += y
        tmp = tx ** 2 + ty ** 2
        # print(tmp)
        if ans < tmp:
            ans = tmp


print(math.sqrt(ans))

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

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

  vector<vector<int>> txy(N + 1, vector<int>(3));
  for (int i = 0; i < 2; i++)
    txy[0][i] = 0;
  for (int i = 0; i < N; i++)
    cin >> txy[i + 1][0] >> txy[i + 1][1] >> txy[i + 1][2];

  int dift, difx, dify;
  for (int i = 0; i < N; i++)
  {
    dift = txy[i + 1][0] - txy[i][0];
    difx = abs(txy[i + 1][1] - txy[i][1]);
    dify = abs(txy[i + 1][2] - txy[i][2]);
    if (dift < difx + dify)
      N = 0;
    if ((dift % 2) != ((difx + dify) % 2))
      N = 0;
  }

  if (N != 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Measured memory_bytes: 5760
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(c>=a && b>=(c-a)){System.out.printf("YES\n");}
  else {System.out.printf("NO\n");}
  
  }
  }


Measured memory_bytes: 21716
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

int INF = INT_MAX / 2;
ll MOD = 1234576891234601LL;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	vector<int> dp(100000, INF);
	vector<vector<int> > v(100000);
	dp[0] = 1;
	for (int i = 0; i < 100000; i++)
		for (int j = 1; ; j++) {
			int _i = i + j * (j + 1) / 2 - 1;
			if (_i >= 100000) break;
			if (dp[i] + j < dp[_i]) {
				dp[_i] = dp[i] + j;
				v[_i] = v[i];
				v[_i].push_back(j);
			}
		}
	map<int, int> mp;
	for (int i = 1; i <= 2000; i++)
		mp[i * (i - 1) / 2] = i;
	/*
	for (int N = 3; N <= 50; N++) {
		int K;
		vector<int> a;
		for (int i = 0; i < 100000; i++) {
			int _N = N + i;
			if (!mp.count(_N)) continue;
			int V = mp[_N];
			if (V < dp[i]) continue;
			K = V;
			a = v[i];
			for (int t = 0; t < V - dp[i]; t++)
				a.push_back(1);
			cout << N << ' ' << V << endl;
			break;
		}
		for (int i = 0; i < a.size(); i++)
			cout << a[i] << ' ';
		cout << endl;
	}
	return 0;
	*/
	int N; cin >> N;
	if (N == 2) {
		cout << -1 << endl;
		return 0;
	}
	if (N == 7) {
		cout << 6 << endl;
		cout << 0 << ' ' << 0 << endl;
		cout << 4 << ' ' << 0 << endl;
		cout << 2 << ' ' << 2 << endl;
		cout << 1 << ' ' << 3 << endl;
		cout << 3 << ' ' << 3 << endl;
		cout << 2 << ' ' << 6 << endl;
		return 0;
	}
	if (N == 9) {
		cout << 6 << endl;
		cout << 0 << ' ' << 0 << endl;
		cout << 1 << ' ' << 0 << endl;
		cout << 2 << ' ' << 0 << endl;
		cout << 1 << ' ' << 1 << endl;
		cout << 0 << ' ' << 2 << endl;
		cout << 2 << ' ' << 2 << endl;
		return 0;
	}
	if (N == 20) {
		cout << 8 << endl;
		cout << 1 << ' ' << 0 << endl;
		cout << 2 << ' ' << 0 << endl;
		cout << 3 << ' ' << 0 << endl;
		cout << 0 << ' ' << 1 << endl;
		cout << 2 << ' ' << 1 << endl;
		cout << 4 << ' ' << 1 << endl;
		cout << 1 << ' ' << 2 << endl;
		cout << 3 << ' ' << 2 << endl;
	}
	int K;
	vector<int> a;
	for (int i = 0; i < 100000; i++) {
		int _N = N + i;
		if (!mp.count(_N)) continue;
		int V = mp[_N];
		if (V < dp[i]) continue;
		K = V;
		a = v[i];
		for (int t = 0; t <= V - dp[i]; t++)
			a.push_back(1);
		break;
	}
	cout << K << endl;
	int x = 0, y = 0;
	cout << x << ' ' << y << endl;
	for (int i = 0; i < a.size(); i++) {
		while (a[i]--) {
			x++;
			y += i;
			cout << x << ' ' << y << endl;
		}
	}
}

Measured memory_bytes: 9060
S = input()
L = len(S)

A = [chr(i) for i in range(97, 97+26)]
A.append('C')
ans = 'AC'
c = 0
for i in range(L):

    if i == 0:
        if S[i] != 'A':
            ans = 'WA'
            break
        continue
    if  2 <= i <= L-2:
        if S[i] == 'C':
            c += 1
    if not S[i] in A:
        ans = 'WA'
        break

if c != 1:
    ans = 'WA'
print(ans)



Measured memory_bytes: 3064
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

const int MAX = 1000000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

vector<pair<long long, int> > prime_factorize(long long n) {
    vector<pair<long long, int> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

int main(){
  ll N, M; cin >> N >> M;
  vector<pair<ll, int>>A = prime_factorize(M);
  ll ans = 1;
  COMinit();
  for(auto C: A){
    ans *= COM(C.second + N - 1, C.second);
    ans %= mod;
  }
  cout << ans << endl;
}

Measured memory_bytes: 23680
#include<stdio.h>

int main() {
	char n[1];

	scanf("%c",&n[1]);

	if ('a'==n[1]|| 'i'==n[1]||'u'==n[1]||'e'==n[1]||'o'==n[1]) {
		printf("vowel");
	}
	else {
		printf("consonant");
	}
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <cmath>
#include <map>

int main()
{
    int R, G, B, N;
    std::cin >> R >> G >> B >> N;

    int cnt = 0;
    for (int r = 0; r < N / R + 1; r++)
    {
        int rR = r * R;
        for (int g = 0; g < (N - rR) / G + 1; g++)
        {
            if ((N - rR - g * G) % B == 0)cnt++;
        }
    }

    std::cout << cnt << std::endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <climits>
#include <map>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <climits>
using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pi;
typedef long long int lli;


int memo[1000010] = {0,0,1};
double PI = 3.14159265359;

lli MOD = 10e9+7;

int main(void){
    
    int K,S;
    cin >> K >> S;
    lli res = 0;
    
    for(int x = 0; x <= K ; x++){
        for(int y = 0; y <= K; y++){
            if(S - (x+y) > K || S < x+y){
                continue;
            }
            
            res ++;
            
        }
    }
    
    cout << res << endl;
    
}


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

using namespace std;
typedef long long ll;
const int N = 1e5+5;
const ll oo = 1e18;
const ll mod = 1e9+7;
const int INF = 1 << 30;

int main()
{
    ios::sync_with_stdio(0);cin.tie(0);ios_base::sync_with_stdio(0);
    
    ll n;
    cin >> n;
    ll sum = 0;
    sum += (n / 500) * 1000;
    int mood = n % 500;
    sum += (mood / 5) * 5;
    cout << sum << endl; 
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

char grid[2][4];

int main() {
  cin>>grid[0];
  cin>>grid[1];
  if (grid[0][0] == grid[1][2] && grid[0][1] == grid[1][1] && grid[0][2] == grid[1][0]) cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int k , x ,n ,s ;
    cin >> k>>x ;
    n=x-k+1;
    s=2*k-1;
    for (int v=0;v<s;v++){
         cout << n<<" ";
         n++;
         }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rint register int
#define rep(i,a,b) for (rint i=(a),_E=(b); i<=_E; ++i)
#define per(i,a,b) for (rint i=(a),_E=(b); i>=_E; --i)
#define REP(i,n) for (rint i=0,_E=(n); i<_E; ++i)
#define pb push_back
#define cmin(x,y) (y<x?x=y:0)
#define cmax(x,y) (y>x?x=y:0)
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef long long ll;

const int N = 100005;
const int mod = 1000000007;
int a[N], b[N], n, cur, ans = 1;

int main() {
	scanf("%d", &n);
	rep (i, 1, n) scanf("%d", &a[i]);
	rep (i, 1, n) scanf("%d", &b[i]);
	sort(a + 1, a + n + 1);
	sort(b + 1, b + n + 1);
	cur = 0;
	rep (i, 1, n) {
		while (cur < n && a[cur+1] < b[i]) ++ cur;
		if (cur > i) ans = 1ll * ans * (cur - i + 1) % mod;
	}
	swap(a, b);
	cur = 0;
	rep (i, 1, n) {
		while (cur < n && a[cur+1] < b[i]) ++ cur;
		if (cur > i) ans = 1ll * ans * (cur - i + 1) % mod;
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 1024