akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define fr(a,b) for(long long i=a;i<b;i++)
#define vi vector<ll>
const ll MAX=1e6;
const ll mod=1e9+7;
const ll INF=1e18+12;
set< pair<ll,ll> >ss;
ll dp[MAX][2];
ll visit[MAX];
                                    //SAMEER KUMAR SINGH//
// ================================================================================================================================//
// ================================================================================================================================//
// ================================================================================================================================//

void dfs(ll src,map<ll,vector<ll>>&mm){
      //cout<<"x";
      visit[src]=1;
      ll p1=1;
      ll p2=1;
       for(auto x:mm[src]){

          if(!visit[x]){
            dfs(x,mm);
            p1=((p1%mod)*(dp[x][1]%mod))%mod;
            p2=((p2%mod)*(dp[x][0])%mod)%mod;
          }
       }


       //cout<<p1+p2<<" "<<p1<<"\n";
       dp[src][1]=(p1%mod+p2%mod)%mod;
       dp[src][0]=p1%mod;

       return;
}

int main(){
   FASTIO;
   ll tt=1;
   //cin>>tt;

   while(tt--){
      ll n,a,b;cin>>n;

      map<ll,vector<ll>>mm;
      fr(0,n-1){
       cin>>a;
       cin>>b;
       mm[a].push_back(b);
       mm[b].push_back(a);
      }

      for(ll i=0;i<MAX;i++){
        dp[i][0]=1;
        dp[i][1]=1;
      }
      dfs(1,mm);


      cout<<dp[1][1]<<"\n";
   }
}


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

using namespace std;

#ifndef aa
#define trace(...)
#define endl '\n'
#endif
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef long double ld;
#define double long double
#define pii pair<int,int>
#define pdd pair<double,double>
#define pll pair<ll,ll>
#define sz(x) ((long long)x.size())
#define fr(a,b,c) for(int a=b; a<=c; a++)
#define frev(a,b,c) for(int a=c; a>=b; a--)
#define rep(a,b,c) for(int a=b; a<c; a++)
#define trav(a,x) for(auto &a:x)
#define all(con) con.begin(),con.end()
#define deb(x) cout << x << endl
#define done(x) {cout << x << endl;return;}
const ll infl = 0x3f3f3f3f3f3f3f3fLL;
const int infi = 0x3f3f3f3f;
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());
//const int mod = 998244353;
const int mod = 1e9 + 7;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<pair<int, int>> vpii;
typedef map<int, int> mii;
typedef set<int> si;
typedef set<pair<int,int>> spii;
typedef queue<int> qi;


const int N = 2e5+5;


void solve() {

  string s;
  cin>>s;
  int x = 0;
  rep(i,0,sz(s))
    (x+=s[i]-'0')%=9;
  cout<<(x?"No":"Yes");

}


signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    //srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    cout << fixed << setprecision(15);
    int t = 1;
   //cin >> t;

    while (t--)
        solve();
#ifdef aa
    cout << endl << endl << endl << endl << "Time elapsed: " << (double)(clock() - clk) / CLOCKS_PER_SEC << endl;
#endif
    return 0;
}


int powm(int a, int b) {
    int res = 1;
    while (b) {
        if (b & 1)
            res = (res*a) % mod;
        a = (a * a) % mod;
        b >>= 1;
    }
    return res;
}


int divide(int a, int b) {
    return (a % mod) * powm(b, mod - 2) % mod;
}

int norm(int a) {
    while (a >= mod) a -= mod;
    while (a < 0) a += mod;
    return a;
}


int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}


Measured memory_bytes: 3728
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] data = sc.nextLine().split(" ");
		int N = Integer.parseInt(data[0]);
		int M = Integer.parseInt(data[1]);
		int[] food = new int[M];
		for(int i=0;i<M;i++) {
			food[i]=0;
		}
		
		for(int i=0;i<N;i++) {
			data = sc.nextLine().split(" ");
			int K = Integer.parseInt(data[0]);
			for(int j=1;j<=K;j++) {
				int value = Integer.parseInt(data[j]);
				food[--value]++;
			}
		}
		
		int cnt=0;
		for(int i=0;i<M;i++) {
			if(food[i]==N) cnt++;
		}
    	System.out.println(cnt);
	}
}


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

using namespace std;

int main(void)
{
	string s, t;
	cin >> s >> t;
	int count = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] != t[i])
			count++;
	}
	cout << count << endl;
	return 0;
}

Measured memory_bytes: 3912
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0170

"""
import sys
from sys import stdin
input = stdin.readline
from collections import namedtuple
from itertools import permutations


def solve(items):
    total_weight = 0
    for i in items:
        total_weight += i.w
    best_ans = []
    best_gp = float('inf')
    # ???????????????????????????????????????????????°?????????????????§????????????
    for perm in permutations(items):
        ans = []
        squashed = False
        cw = 0
        gp = 0
        n = len(items)
        for p in perm:
            if p.s < cw:
                squashed = True
                break
            cw += p.w
            ans.append(p.name)
            gp += n * p.w
            n -= 1
        # ????????°???????????£?????´????????????????¨???????????????????????????????????????£?????????????????§????????????
        if not squashed:
            gp /= total_weight
            if gp < best_gp:
                best_gp = gp
                best_ans = ans[:]
    # ????????????????????????????????£??????????????§?????????????±?????????????????????????????????????????????????
    best_ans.reverse()
    return best_ans


def solve2(items):
    items.sort(key=lambda x:x.w, reverse=True)
    ans = []
    while items:
        total_weight = 0
        for i in items:
            total_weight += i.w
        cap = [x.s - total_weight + x.w for x in items]
        for i in range(len(items)):
            if cap[i] >= 0:
                ans.append(items[i].name)
                items.pop(i)
                break
    return ans



item = namedtuple('item', ['name', 'w', 's'])
def main(args):
    while True:
        n = int(input())
        if n == 0:
            break
        items = []
        for _ in range(n):
            name, w, s = input().split()
            items.append(item(name, int(w), int(s)))
        result = solve2(items)
        print('\n'.join(result))


if __name__ == '__main__':
    main(sys.argv[1:])

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

int a, b, c, k, n, m;
ll t[1 << 17], d[1 << 17];
vector<int> u, v;

int main()
{
    string s;
    cin >> s;
    if (s[5] == '0' && s[6] < '5')
    {
        if (s[6] == '4' && s[8] == '3' && s[9] == '1')
            cout << "TBD" << endl;
        else
            cout << "Heisei" << endl;
    }
    else
        cout << "TBD" << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
//Optimisations
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("O2")
//shortcuts for functions
#define pb push_back
#define mp make_pair
#define ff first 
#define ss second
#define all(v) v.begin(),v.end()
#define prec(n) fixed<<setprecision(n)
#define n_l '\n'
// make it python 
#define gcd __gcd
#define append push_back
#define str to_string
// utility functions shortcuts
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define sswap(a,b) {a=a^b;b=a^b;a=a^b;}
#define swap(a,b) {auto temp=a; a=b; b=temp;}
#define init(dp) memset(dp,-1,sizeof(dp));
#define set0(dp) memset(dp,0,sizeof(dp));
#define bits(x) __builtin_popcount(x)
#define SORT(v) sort(all(v))
#define endl "\n"
#define forr(i,n) for(ll i=0;i<n;i++)
// declaration shortcuts
typedef long long int ll;
#define int ll
// Constants
constexpr int dx[] = {-1, 0, 1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, -1, 0, 1, 1, -1, 1, -1};
constexpr ll INF = 1999999999999999997; 
constexpr int inf= INT_MAX;
constexpr int MAXSIZE = int(1e6)+5;
constexpr auto PI  = 3.14159265358979323846L;
constexpr auto oo  = numeric_limits<int>::max() / 2 - 2;
constexpr auto eps = 1e-6;
constexpr auto mod = 1000000007;
constexpr auto MOD = 1000000007;
constexpr auto MOD9 = 1000000009;
constexpr auto maxn = 100006;
//void IOfile(){
//freopen(file_name, reade_mode, stdin);
//freopen(file_name, write_mode, stdout);
//}
void fastio(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}

vector<pair<int,int>>v[maxn];
int color[maxn];

void dfs(int st, int p){
	for(auto i:v[st]){
		if(i.first == p) continue;
		if(i.second%2) color[i.first] = color[st]^1;
		else color[i.first] = color[st];
		dfs(i.first,st);
	}
}

int32_t main(){
	fastio();
	int n;
	cin >> n;
	for(int i = 1; i <= n-1; i++){
		int a,b,w;
		cin >> a >> b >> w;
		v[a].push_back({b,w});
		v[b].push_back({a,w});
	}
	for(int i = 1; i <= n;i++){
		color[i] = -1;
	}
	color[1] = 0;
	dfs(1,0);
	for(int i = 1; i <= n; i++){
		cout << color[i] <<"\n";
	}
}

Measured memory_bytes: 13404
#include <iostream>
#include <vector>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <iomanip>
#include <deque>
#include <math.h>
#include <map>
#include <stack>
#include <list>
#include <sstream>
#include <algorithm>
#include <bitset>
#include <limits>
#include <cstring>
#include <climits>
#include <iterator>
#include <cassert>
#include <string>
using namespace std;

template<class T> bool amin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool amax(T &a, T b) { return a < b ? (a = b, true) : false; }
#define REP(i, n) for(int i=0;i<n;i++)
#define REPE(i, n) for(int i=0;i<=n;i++)
#define REP2(i, j, n) for(int i=j;i<n;i++)
#define REP2E(i, j, n) for(int i=j;i<=n;i++)
#define REP3(i, j, n, s) for(int i=j;i<n;i+=s)
#define REP3E(i, j, n, s) for(int i=j;i<=n;i+=s)
#define RREP(i, n) for(int i=n;i>=0;i--)
#define RREP2(i, n, j) for(int i=n;i>=j;i--)
#define MSI unordered_map<string, int>
#define MII unordered_map<int, int>
#define VI vector<int>
#define VL vector<long>
#define PI pair<int, int>
#define VPI vector<PI>
#define VVI vector<VI>
#define VC vector<char>
#define VVL vector<VL>
#define VVPI vector<VPI>
#define MSVI unordered_map<string, VI>
#define MII unordered_map<int, int>
#define TCASES int t; cin>>t; while(t-- > 0)
#define MOD 1000000007


int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	#ifdef LOCAL_TEST
	freopen("input.txt","r",stdin);
	#endif
	int n; cin >> n;
	int i=0, j=0, start=0;
	bool can_do=true;
	while(n-- > 0){
		int t, x, y;
		cin >> t >> x >> y;
		int diff = abs(x-i) + abs(y-j);
		if(t < start+diff || (t-start-diff) % 2 != 0) can_do=false;

		start=t;
		i=x; j=y;
	}

	if(can_do) cout << "Yes\n";
	else cout << "No\n";
	return 0;
}


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

using namespace std;
using Graph = vector<vector<int>>;
using Grid= vector<vector<char>>;
using vin= vector<int>;
using ll=long long;
using vll= vector<ll>;
using vbl=vector<bool>;
using vch=vector<char>;
using pinin=pair<int ,int>;

#define ft first
#define sd second
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rell(i,n) for (ll i=0; i< (ll)(n); i++)
#define sort(x) sort(x.begin(), x.end())
#define rese(x) reverse(x.begin(), x.end())
#define vnn(x,y,s,name) vector<vector<int>> name(x, vector<int>(y,s))
#define mse(x) memset(x, 0, sizeof(x))

string yes="Yes",no="No";

int main() {
    deque<pinin> s;
    int h,w,ch,cw,dh,dw;
    cin>>h>>w>>ch>>cw>>dh>>dw;
    ch--;
    cw--;
    dh--; 
    dw--;
    int dx[4]={1,0,-1,0};
    int dy[4]={0,1,0,-1};
    
    vector<string> fld(h);
    rep(i,h) cin>>fld[i];
    vnn(h,w,1001001,maze);
    pinin start;
    start.ft=ch;
    start.sd=cw;
    s.push_back(start);
    maze[ch][cw]=0;
    while(!s.empty()){
        pinin k=s.front();
        s.pop_front();
        int value=maze[k.ft][k.sd];
        rep(i,4){
            pinin l;
            l.ft=k.ft+dx[i];
            l.sd=k.sd+dy[i];
            if(l.ft<0||l.ft>=h||l.sd<0||l.sd>=w) continue;
            if(fld[l.ft][l.sd]=='#') continue;
            if(maze[l.ft][l.sd]<=value) continue;
            
            maze[l.ft][l.sd]=value;
            s.push_front(l);
        }
        rep(i,5){
            rep(j,5){
                int di=i-2;
                int dj=j-2;
                pinin m;
                m.ft=k.ft+di;
                m.sd=k.sd+dj;
                if(m.ft<0||m.ft>=h||m.sd<0||m.sd>=w) continue;
                if(fld[m.ft][m.sd]=='#') continue;
                if(maze[m.ft][m.sd]<=value+1) continue;
                
                maze[m.ft][m.sd]=value+1;
                s.push_back(m);
            }
        }
    }
    if(maze[dh][dw]==1001001) maze[dh][dw]=-1;
    cout<<maze[dh][dw]<<endl;
    
    
}


Measured memory_bytes: 9456
#include<iostream>
#include<list>
#include<stdio.h>
using namespace std;
int main(){
  int n,num;
  list<int> b;   
  char a[10];
  list<int>::iterator it;
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%s",a);
    if(a[5]=='t'){
      scanf("%d",&num);
      b.push_front(num);
    }else if(a[6]=='L'){
      b.pop_back();
    }else if(a[6]=='F'){
      b.pop_front();
    }else {
      scanf("%d",&num);
      it=b.begin();
      for(;it!=b.end();it++){
	if(*it==num){
	  b.erase(it);
	  break;
	}
      }
    }
  }
  it=b.begin();
  for(;it!=b.end();it++){    
    if(it!=b.begin())printf(" ");
    printf("%d",*it);
  }printf("\n");
  return 0;
}

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



//defines...
#define ll long long
#define tata return;
#define pb push_back
#define mp make_pair
#define in insert
#define run ios_base::sync_with_stdio(false);cin.tie(NULL);
#define yes cout<<"YES"<<endl;
#define no cout<<"NO"<<endl;
#define vec vector<ll>
#define setl set<ll>
#define mapl map<ll,ll>
#define shunno cout<<0<<endl;
#define ek cout<<1<<endl;
#define pi 2*acos(0.0)1
#define hobena cout<<-1<<endl;




//typedefs...
typedef pair<ll,ll>pll;

//const..
//const ll fx[]={0,1,0,-1};
//const ll fy[]={1,0,-1,0};
const ll mod=1e9+7;

/*ll ncr(ll n, ll k)
{
    ll res = 1;


    if (k > n - k)
        k = n - k;

    for (int i = 0; i < k; ++i) {
        res *= (n - i);
        res /= (i + 1);
    }

    return res;
}
*/

void oka()
{
    ll n,i,j,cur,ans=0;
    cin>>n;
    ll a[n];
    for(i=0;i<n;i++)
        cin>>a[i];
        cur=a[0];
    for(i=0;i<n-1;i++)
    {
        if(cur<a[i+1])
            continue;
        else
        {
            ans++;
            cur=a[i+1];

        }
    }
    cout<<++ans<<endl;

}















int main()
{
  // freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    run
    ll t;
    t=1;
  //cin>>t;
    while(t--){

    oka();
    }



}


Measured memory_bytes: 5192
/*

  "With age, comes wisdom. With travel, comes understanding.
   Remember that happiness is a way of travel – not a destination"

*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define int            long long int
#define F              first
#define S              second
#define pb             push_back
#define si             set <int>
#define vi             vector <int>
#define pii            pair <int, int>
#define vpi            vector <pii>
#define vpp            vector <pair<int, pii>>
#define mii            map <int, int>
#define mpi            map <pii, int>
#define spi            set <pii>
#define endl           "\n"
#define sz(x)          ((int) x.size())
#define all(p)         p.begin(), p.end()
#define double         long double
#define que_max        priority_queue <int>
#define que_min        priority_queue <int, vi, greater<int>>
#define bug(...)       __f (#__VA_ARGS__, __VA_ARGS__)
#define print(a)       for(auto x : a) cout << x << " "; cout << endl
#define print1(a)      for(auto x : a) cout << x.F << " " << x.S << endl
#define print2(a,x,y)  for(int i = x; i < y; i++) cout<< a[i]<< " "; cout << endl

inline int power(int a, int b)
{
     int x = 1;
     while (b)
     {
          if (b & 1) x *= a;
          a *= a;
          b >>= 1;
     }
     return x;
}

typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> Set;

template <typename Arg1>
void __f (const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f (const char* names, Arg1&& arg1, Args&&... args)
{
     const char* comma = strchr (names + 1, ',');
     cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...);
}

const int N = 200005;
int a[N], n, m, k;

void solve()
{
     string s; cin >> s;
     if (sz(s) & 1)
     {
          cout << "No";
          return ;
     }
     for (int i = 0; i < sz(s); i++)
     {
          if (s[i] != 'h' || s[i + 1] != 'i')
          {
               cout << "No";
               return ;
          }
          i++;
     }
     cout << "Yes";

}

int32_t main()
{
     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

     cout << setprecision(9) << fixed;
     clock_t z = clock();
     solve();
     cerr << "Run Time : " << ((double)(clock() - z) / CLOCKS_PER_SEC);

     return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <cmath>
#include <numeric>
#include <iomanip>
#include <deque>
#include <tuple>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cstdint>
#include <unordered_map>
#include <sstream>
#include <boost/multiprecision/cpp_int.hpp>

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define pb push_back
#define pf push_front

namespace mp = boost::multiprecision;
using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;

ll M = 1000000007;

typedef pair<int, int> P;

bool ps1(const P &element1, const P &element2)
{ //first昇順
	return element1.first < element2.first;
}
bool ps2(const P &element1, const P &element2)
{ //first降順
	return element1.first > element2.first;
}
bool ps3(const P &element1, const P &element2)
{ //second昇順
	return element1.second < element2.second;
}
bool ps4(const P &element1, const P &element2)
{ //second降順
	return element1.second > element2.second;
}
int digits(int n)
{
	int count = 0;

	while (n > 0)
	{
		n /= 10;

		count++;
	}
	return count;
}
int digit(int n)
{

	int ans = 0;
	while (n > 0)
	{
		ans += n % 10;
		n /= 10;
	}
	return ans;
}
ll combination(ll n, ll r)
{
	if (r * 2 > n)
		r = n - r;
	ll dividend = 1;
	ll divisor = 1;
	for (ll i = 1; i <= r; ++i)
	{
		dividend *= (n - i + 1);
		divisor *= i;
	}
	return dividend / divisor;
}
int GCD(int x, int y)
{
	return x ? GCD(y % x, x) : y;
}
vector<int> divisor(int n)
{
	vector<int> value;
	FOR(i, 1, pow(n, 0.5) + 1)
	{
		if (i <= sqrt(n))
		{
			if (n % i == 0)
			{
				value.push_back(i);
				if (i * i != n)
				{
					value.push_back(n / i);
				}
			}
		}
	}
	return value;
}

int main()
{
	int n;
	cin>>n;
	string s;
	cin>>s;
	int left=0;
	int right=0;
	int radd=0;
	int ladd=0;
	deque<char>ans;
	rep(i,n){
		if(s[i]=='('){
			left++;
		}else if(s[i]==')'){
			right++;
			if(right>left+ladd){
				ladd++;
			}
		}
	}
	if(ladd+left>right){
		radd=ladd+left-right;
	}
	rep(i,ladd){
		ans.push_front('(');
	}
	rep(i,n){
		ans.push_back(s[i]);
	}
	rep(i,radd){
		ans.push_back(')');
	}
	rep(i,ans.size()){
		cout<<ans[i];
	}cout<<endl;
	//cout<<"(((()))())"<<endl;
}


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

#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define LL long long
#define pii pair <int,int>
#define fi first
#define se second
#define pb push_back
#define mpr make_pair

using namespace std;

const LL MOD=1e9+7;

LL k,cur=0;
bool vis[1000010];

int main()
{
	cin>>k;
	for(int i=1;;i++)
	{
		cur=(cur*10+7)%k;
		if(cur==0)
		{
			cout<<i<<endl;
			return 0;
		}
		if(vis[cur])
		{
			puts("-1");
			return 0;
		}
		vis[cur]=true;
	}
	return 0;
}

Measured memory_bytes: 4592
def main():
    import sys
    #int(sys.stdin.readline())
    s = sys.stdin.readline().rstrip()
    #map(int, sys.stdin.readline().split())
    A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    a = 'abcdefghijklmnopqrstuvwxyz'
    if s in A:
        print('A')
    elif s in a:
        print('a')




if __name__=='__main__':
    main()

Measured memory_bytes: 8960
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL -1
using namespace std;
const int64_t MOD = 1e9 + 7;

int main() {
	string A, B;
	cin >> A >> B;

	string ans = "";
	if (A.size()==B.size()) {
		if (A>B) ans = "GREATER";
		else if (A<B) ans = "LESS";
		else ans = "EQUAL";
	}
	else if (A.size() > B.size()) {
		ans = "GREATER";
	}
	else {
		ans = "LESS";
	}

	cout << ans << endl;
}

Measured memory_bytes: 3624
#include <iostream>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef long double ld;

const ll B = 1e18;
const ll C = 1e9;

ll sqr(ll x) {
	ll b = 1;
	for(ll z = 1e9; z > 0; z /= 2) {
		while((z+b)*(z+b) <= x && (z+b)*(z+b) >= 0) {
			b += z;
		}
	}
	return b;
}

int main() {
	ll S;
	cin >> S;

	ll x1 = 0;
	ll y1 = 0;
	ll x2 = 1e9;
	ll y3 = (S-1)/x2; ++y3;
	ll y2 = x2*y3 - S;
	ll x3 = 1;

	cout << x1 << " " << y1 << " " << x2 << " " << y2 << " " << x3 << " " << y3 << "\n";
	return 0;

	if(S == B) {
		cout << 0 << " " << 0 << " " << 0 << " " << C << " " << C << " " << 0 << "\n";
		return 0;
	}
	/*
	ll x1 = sqr(S);
	ll x2 = S - x1*x1;
	ll x3 = 0;

	ll y1 = 0;
	ll y2 = x1 + 1;
	ll y3 = 1;
*/
	if(x2 <= C) {
		cout << x1 << " " << y1 << " " << x2 << " " << y2 << " " << x3 << " " << y3 << "\n";
		return 0;
	}

	y2 = x1 + 2;
	x2 = S - x1*(x1 + 1);

	if(y2 <= C) {
		cout << x1 << " " << y1 << " " << x2 << " " << y2 << " " << x3 << " " << y3 << "\n";
		return 0;		
	}
	throw exception();
	cout << "!\n";
	cout << x1 << " " << y1 << " " << x2 << " " << y2 << " " << x3 << " " << y3 << "\n";

}

Measured memory_bytes: 256
from collections import deque

N, Q = [int(i) for i in input().split()]
q = deque()
for _ in range(N):
    p = input().split()
    q.append((p[0], int(p[1])))

current_time = 0
while len(q) > 0:
    p = q.popleft()
    if p[1] > Q:
        current_time += Q
        q.append((p[0], int(p[1])-Q))
    else:
        current_time += p[1]
        print(p[0], current_time)
    


Measured memory_bytes: 12532
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cctype>
#include <complex>
using namespace std;

#define INF_LL (ll)1e18
#define INF (int)1e9
#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
using ll = long long;
using PII = pair<int, int>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}


int K;
ll a[114514];

ll ok(ll x){
	REP(i, K)
		x -= x%a[i];
	return x;
}

int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> K;
	REP(i, K)
		cin >> a[i];
	ll l = 0, r = INF_LL, m;
	while(r-l > 1){
		m = (l+r)/2;
		if(ok(m) >= 2)
			r = m;
		else
			l = m;
	}
	ll r1 = r;
	l = 0, r = INF_LL;
	while(r-l > 1){
		m = (l+r)/2;
		REP(i, K){
			m = m-m%a[i];
		}
		if(m <= 2)
			l = (l+r)/2;
		else
			r = (l+r)/2;
	}
	if(ok(r1) != 2 || ok(l) != 2){
		cout << -1 << endl;
		return 0;
	}
	cout << r1 << " " << l << endl;
}


Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;
const int MAX = 700000;
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;
}
/*第二引数で第一引数を割ったときの切り上げの計算*/
long long int maxtime(long long int x, long long int y){
	return(x + y - 1) / y;

}
/*最大公約数*/
long long int lcm(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;

	if (number2 > number1) {
		m = number2;
		n = number1;
	}
	long long int s = -1;
	while (s != 0) {
		s = m % n;
		m = n;
		n = s;
	}
	return m;
}
/*最大公倍数*/
long long int gcd(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;
	return m / lcm(m, n) * n;
}
/*逆元計算*/
long long int  modinv(long long a, long long m) {
	long long int b = m, u = 1, v = 0;
	while (b) {
		long long int t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
// index が条件を満たすかどうか
vector<long long int >meguru;
bool isOK(int index, int key) {
	if (meguru[index] >= key) return true;
	else return false;
}
// 汎用的な二分探索のテンプレ
int binary_search(int key) {
	int left = -1; //「index = 0」が条件を満たすこともあるので、初期値は -1
	int right = (int)meguru.size(); // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()
	/* どんな二分探索でもここの書き方を変えずにできる！ */
	while (right - left > 1) {
		int mid = left + (right - left) / 2;

		if (isOK(mid, key)) right = mid;
		else left = mid;
	}
	/* left は条件を満たさない最大の値、right は条件を満たす最小の値になっている */
	return right;
}
long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

int main() {
	int n;
	cin >> n;
	long long int sum = 0;
	vector<long long int >s;
	for (int i = 0; i < n; i++) {
		long long int a;
		cin >> a;
		s.push_back(a);
		sum = sum + a;
	}
	long long int right = 0;
	long long int left = sum;
	long long int ans = 2000000000000000000;
	for (int i = 0; i < s.size(); i++) {
		right = right + s[i];
		left = left - s[i];
		ans = min(ans, abs(left - right));
	}
	cout << ans;
}

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


int main(){
	const int ex[10]={0,2,5,5,4,5,6,3,7,6};
	int n;
	cin>>n;
	int m;
	cin>>m;
	vector<int>r;
	int b[10]={};
	for(int i=0;i<m;i++)
	{
		cin>>b[i];
		r.push_back(ex[b[i]]);
	}
	int a[10]={};
	for(int i=0;i<m;i++)
	{
		a[ex[b[i]]]=a[ex[b[i]]]>b[i]?a[ex[b[i]]]:b[i];
	}


	int dp[10001];//dp[i]=nでi本でn桁最大
	dp[0]=0;
	for(int i=1;i<=n;i++)
	{
		int k=-9999;
		for(int j=0;j<m;j++)
		{
			if(i-r[j]>=0){
				k=(dp[i-r[j]]>k?dp[i-r[j]]:k);
			}
		}
		if(dp[i]==0)
			dp[i]=-1;
		dp[i]=k+1;
	}
	for(int i=n;i>0;){
		int max=0;
		for(int j=0;j<m;j++)
		{
			if(i-r[j]<0) continue;
			if(dp[i-r[j]]==dp[i]-1){
				max=max>a[r[j]]?max:a[r[j]];
			}
		}
		i-=ex[max];
		cout<<max;
		if(dp[i]==1){
			cout<<a[i];
			break;}
	}
	cout<<endl;
	return 0;
}

Measured memory_bytes: 256
num = int(input())

flag = False
while True:
    if num == 2:
        print(2)
        exit()
    for i in range(2, int(num**0.5)+1):
        if num % i ==0:
            flag = False
            break
        else:
            flag = True
    if flag:
        print(num)
        exit()
    else:
        num+=1

Measured memory_bytes: 38768
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef pair<ll,ll> P;
#define all(v) (v).begin(),v.end()
#define fi first
#define se second
set<string> c;
map<ll,ll> mp;
const ll inf=(1e18);
const ll mod=1000000007;
const ll mod2=998244353;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
int main(){
int n;
cin>>n;
vector<ll> a(n),ind(n);
for(int i=0;i<n;i++){cin>>a[i];--a[i];}
for(int i=0;i<n;i++)ind[a[i]]=i;
set<ll> s;
ll ans=0;
for(int x=0;x<n;x++){
    ll i=ind[x];
    ll c=0;
    s.insert(i);
    ll l=-1,r=n;
    auto ite=s.find(i);
    if(ite!=s.begin()){ite--;l=*ite;}
    ite=s.find(i);
    ite++;
    if(ite!=s.end())r=*ite;
    c=(i-l)*(r-i);
    ans+=(x+1)*c;
}
cout<<ans<<endl;
}





Measured memory_bytes: 12800
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
    int n, a[1000];
    double s = 0, p = 1;
    cin >> n;
    for(int i = 0; i < n; i++)
    {
        cin >> a[i];
        p = p * a[i];
    }
    for(int i = 0; i < n; i++)
    {
        s = s + p/a[i];
    }
    cout << setprecision(16) << p / s;
    return 0;
}

Measured memory_bytes: 3728
#include<set> 
#include<map> 
#include<stack> 
#include<cmath> 
#include<cstdio> 
#include<queue> 
#include<vector> 
#include<climits> 
#include<cstring> 
#include<iostream> 
#include<algorithm> 
using namespace std; 
#define MAXC 30
#define MAXN 500
#define LL long long 
#define INF INT_MAX 
int read(){ 
    int f=1,x=0; 
    char c=getchar(); 
    while(c<'0'||'9'<c){if(c=='-')f=-1;c=getchar();} 
    while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();} 
    return f*x; 
}
int c,d[MAXC+5][MAXC+5],cnt[3][MAXC+5],S[3][MAXC+5];
int change(int t,int x){
	int ret=0;
	for(int i=1;i<=c;i++)
		ret+=cnt[t][i]*d[i][x];
	return ret;
}
int main(){
	int n=read(),ans=INF;
	c=read();
	for(int i=1;i<=c;i++)
		for(int j=1;j<=c;j++)
			d[i][j]=read();
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			cnt[(i+j)%3][read()]++;
	for(int t=0;t<=2;t++)
		for(int i=1;i<=c;i++) 
			S[t][i]=change(t,i);
	for(int i=1;i<=c;i++)
		for(int j=1;j<=c;j++)
			for(int k=1;k<=c;k++)
				if(i!=j&&j!=k&&i!=k){
					int tmp=S[0][i]+S[1][j]+S[2][k];
					if(tmp<ans) ans=tmp;
				}
	printf("%d\n",ans);
	return 0;
} 


Measured memory_bytes: 256
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String line[] = br.readLine().split(" ");
        int intArray[] = new int[n];
        for (int i=0; i<n; i++){
            intArray[i] = Integer.parseInt(line[i]);
        }

        int mi = Integer.MAX_VALUE;
        for (int i=0; i<n; i++){
            mi = Math.min(mi,intArray[i]);
        }
        
        int ma = Integer.MIN_VALUE;
        for (int i=0; i<n; i++){
            ma = Math.max(ma,intArray[i]);
        }
        
        long sum = 0;
        for (int i=0; i<n; i++){
            sum += Long.parseLong(line[i]);
        }
        System.out.println(String.format("%s %s %s", mi , ma, sum));
    }
}

Measured memory_bytes: 25736
#include <bits/stdc++.h>
typedef long long ll;
#define REP(i,n) for(int i=0;i<n;i++)
#define ALL(x) (x).begin(),(x).end()
using namespace std;

//素因数分解
vector<pair<ll,int>> factorize(ll n){
    vector<pair<ll,int>>res;
    for(ll i=2;i*i<=n;i++){
        if(n%i)continue;
        res.emplace_back(i,0);
        while (n%i == 0)
        {
        n /= i;
        res.back().second++;
        }
        
    }
    if(n != 1) res.emplace_back(n,1);
    return res;
}

void trace(int A[],int N){
    REP(i,N){
        if(i>0)printf(" ");
        printf("%d",A[i]);
    }
    printf("\n");
}


int main(){
    int X,A,B;
    cin >> X >> A >> B;
    X -= A;
    while(X>=B)X-=B;
    cout << X << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？
*/

int main(){
    int N, A, B; cin >> N >> A >> B;

    cout << min(A*N, B) << endl;
}

Measured memory_bytes: 256
def main():
    n = int(input())
    p_lst = list(map(int, input().split()))

    min_val = n + 1
    ans = 0

    for i in range(n):
        if min_val > p_lst[i]:
            min_val = p_lst[i]
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 99928
#include "bits/stdc++.h"
#define MAXN 200009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(__typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second
#define my_little_dodge 46
#define debug(x)  cerr<< #x <<" = "<< x<<endl;
using namespace std;

typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
int n,A,B,arr[MAXN];
bool ok(int x){
	ll res=0;
	for(int i=1;i<=n;i++){
		ll t=arr[i]-B*1LL*x;
		if(t>0)
			res+=(t+A-1)/A;	
	}
	return (res<=x);
}
int main(){
	//~ #ifndef ONLINE_JUDGE
    //~ freopen("file.in", "r", stdin);
	//~ #endif	
	scanf("%d",&n);
	scanf("%d%d",&A,&B);A=A-B;
	for(int i=1;i<=n;i++)	
		scanf("%d",&arr[i]);
	int st=1,en=INF;
	while(st+1<en){
		int mid=(st+en)>>1;
		if(ok(mid))
			en=mid;
		else
			st=mid;
	}
	if(ok(st))
		printf("%d\n",st);
	else
		printf("%d\n",en);
	return 0;
}


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

int count = 0;
void check(int k, int s)
{
	int x,y,z;
	
	for(x=0; x<=k; x++){
		for(y=0; y<=k; y++){
			z = s - x - y;
			//int sum = x + y + z;
			if(x + y + z == s && z <= k && z >= 0){
				count++;
				//cout << x << ' ' << y << ' ' << z << ' ' << sum << endl;
			}
		}
	}
}
int main()
{
	int k,s;
	cin >> k >> s;	
	check(k,s);
	cout << count << endl;
}



Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    char w[100];
    char cp[27]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','\0'};
    int ch[27]={0};
    int len,i,sum=0,j,xx=0;
    gets(w);
    len=strlen(w);
    for(i=0; i<len; i++)
    {
        for(j=0; j<26; j++)
        {
            if(w[i]==cp[j])
            {
                ch[j]++;
                break;
            }
        }
    }
  for(i=0;i<26;i++)
  {
     if(ch[i]!=0&&ch[i]%2!=0)
	{
		printf("No\n");
		xx++;
		break;
	}
	else continue;
  }
    if(xx==0)
	printf("Yes\n");
    return 0;
}

Measured memory_bytes: 128
s = input()
n = len(s)
for i in range((n - 1)//4):
    if not(s[i] == s[(n-1)//2-i-1] and s[(n+3)//2 + i-1] ==  s[-i-1] and s[i] == s[-i-1]):
        print('No')
        exit()
if (n-1)%4 != 0:
    j = (n - 1) // 4
    if s[j] != s[-j-1]:
        print('No')
        exit()
print('Yes')

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

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int P, Q, A, N;

int solve(int p, int q, int n, int t) {
    if (P*q == p*Q) return 1;
    if (P*q < p*Q) return 0;
    if (N == n) return 0;

    int ret = 0;

    for (int i=t; q*i<=A; ++i) {
        ret += solve(p*i+q, q*i, n+1, i);
    }

    return ret;
}

int main() {
    while (cin >> P >> Q >> A >> N and P and Q and A and N) {
        cout << solve(0, 1, 0, 1) << endl;
    }
}



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

int main(){
	char c[5];
	while(scanf("%s",c),!(c[0]=='0'&&c[1]=='0'&&c[2]=='0'&&c[3]=='0')){
		if(c[0]==c[1]&&c[0]==c[2]&&c[0]==c[3]){ printf("NA\n"); continue;}
		int res=0;
		while(!(c[0]=='6'&&c[1]=='1'&&c[2]=='7'&&c[3]=='4')){
			char l[5],m[5];
			for(int i=0;i<5;i++) l[i]=m[i]=c[i];
			sort(l,l+4,greater<char>()); sort(m,m+4);
			int a=(l[0]-48)*1000+(l[1]-48)*100+(l[2]-48)*10+(l[3]-48);
			int b=(m[0]-48)*1000+(m[1]-48)*100+(m[2]-48)*10+(m[3]-48);
			int x=a-b;
			for(int i=0,p=1000;i<4;i++){ c[i]=(char)(48+x/p); x%=p; p/=10;}
			res++;
		}
		printf("%d\n",res);
	}
}

Measured memory_bytes: 1164
import sys
input = sys.stdin.readline

num = int(input())
tool = list(map(int, input().split()))

def tool_set(num, tool):
  count = 0
  for i in range(num - 1):
    if tool[i] > tool[i + 1]:
      count += tool[i] - tool[i + 1]
      tool[i + 1] = tool[i]
  print(count)

tool_set(num, tool)

Measured memory_bytes: 31472
#![allow(unused_imports)]
#![allow(non_snake_case, unused)]

use std::cmp::*;
use std::collections::*;
use std::ops::*;

macro_rules! eprint {
	($($t:tt)*) => {{
		use ::std::io::Write;
		let _ = write!(::std::io::stderr(), $($t)*);
	}};
}
macro_rules! eprintln {
	() => { eprintln!(""); };
	($($t:tt)*) => {{
		use ::std::io::Write;
		let _ = writeln!(::std::io::stderr(), $($t)*);
	}};
}
macro_rules! dbg {
	($v:expr) => {{
		let val = $v;
		eprintln!("[{}:{}] {} = {:?}", file!(), line!(), stringify!($v), val);
		val
	}}
}

macro_rules! mat {
	($($e:expr),*) => { Vec::from(vec![$($e),*]) };
	($($e:expr,)*) => { Vec::from(vec![$($e),*]) };
	($e:expr; $d:expr) => { Vec::from(vec![$e; $d]) };
	($e:expr; $d:expr $(; $ds:expr)+) => { Vec::from(vec![mat![$e $(; $ds)*]; $d]) };
}

macro_rules! ok {
	($a:ident$([$i:expr])*.$f:ident()$(@$t:ident)*) => {
		$a$([$i])*.$f($($t),*)
	};
	($a:ident$([$i:expr])*.$f:ident($e:expr$(,$es:expr)*)$(@$t:ident)*) => { {
		let t = $e;
		ok!($a$([$i])*.$f($($es),*)$(@$t)*@t)
	} };
}

pub fn readln() -> String {
	let mut line = String::new();
	::std::io::stdin().read_line(&mut line).unwrap_or_else(|e| panic!("{}", e));
	line
}

macro_rules! read {
	($($t:tt),*; $n:expr) => {{
		let stdin = ::std::io::stdin();
		let ret = ::std::io::BufRead::lines(stdin.lock()).take($n).map(|line| {
			let line = line.unwrap();
			let mut it = line.split_whitespace();
			_read!(it; $($t),*)
		}).collect::<Vec<_>>();
		ret
	}};
	($($t:tt),*) => {{
		let line = readln();
		let mut it = line.split_whitespace();
		_read!(it; $($t),*)
	}};
}

macro_rules! _read {
	($it:ident; [char]) => {
		_read!($it; String).chars().collect::<Vec<_>>()
	};
	($it:ident; [u8]) => {
		Vec::from(_read!($it; String).into_bytes())
	};
	($it:ident; usize1) => {
		$it.next().unwrap_or_else(|| panic!("input mismatch")).parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1
	};
	($it:ident; [usize1]) => {
		$it.map(|s| s.parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1).collect::<Vec<_>>()
	};
	($it:ident; [$t:ty]) => {
		$it.map(|s| s.parse::<$t>().unwrap_or_else(|e| panic!("{}", e))).collect::<Vec<_>>()
	};
	($it:ident; $t:ty) => {
		$it.next().unwrap_or_else(|| panic!("input mismatch")).parse::<$t>().unwrap_or_else(|e| panic!("{}", e))
	};
	($it:ident; $($t:tt),+) => {
		($(_read!($it; $t)),*)
	};
}

pub fn main() {
	let _ = ::std::thread::Builder::new().name("run".to_string()).stack_size(32 * 1024 * 1024).spawn(run).unwrap().join();
}

const MOD: usize = 1_000_000_007;
const INF: i64 = std::i64::MAX/2;

pub trait SetMinMax {
	fn setmin(&mut self, v: Self) -> bool;
	fn setmax(&mut self, v: Self) -> bool;
}
impl<T> SetMinMax for T where T: PartialOrd {
	fn setmin(&mut self, v: T) -> bool {
		*self > v && { *self = v; true }
	}
	fn setmax(&mut self, v: T) -> bool {
		*self < v && { *self = v; true }
	}
}

fn solve() {
	let s = read!(String);
	if s.contains("7") {
		println!("Yes");
	}
	else {
		println!("No");
	}
}

fn run() {
    solve();
}


Measured memory_bytes: 2204
#include<bits/stdc++.h>
using namespace std;
#define LL long long

int main(){
	// sengen
	int n;
	// nyuryoku
	cin >> n;
	int a[n];
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	sort(a,a+n);
	int dp[a[n-1]+1];
	for(int i=0;i<=a[n-1];i++){
		dp[i] = 1;
	}
	int ans = 0;
	// keisan
	for(int i=0;i<n;i++){
		int b = a[i];
		for(int j=b*2;j<=a[n-1];j += b){
			dp[j] = 0;
		}
		if(i != n-1){
			if(a[i] == a[i+1]){
				dp[b] = 0;
			}
		}
		if(dp[b] != 0){
			ans++;
		}
	}
	// syutsuryoku
	cout << ans;
}

Measured memory_bytes: 8280
S = input()
SS = []

S += 'a'
p = S[0]
c = 1
for i in range(1,len(S)):
  if S[i] != p:
    SS.append([p,c])
    c = 1
  else:
    c += 1
  p = S[i]
#print(SS)
a = 0
ans = 0
for s,c in SS:
  if s == '<':
    ans += c*(c+1)//2
    a = c
  else:
    if a < c:
      ans += c-a
    ans += c*(c-1)//2
    a = 0
print(ans)

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

int main(){
    ll n;
    cin>>n;
    vector<ll> a(n);
    vector<ll> cnt(100010);
    ll ans=0;
    ll b[100010],c[100010];
    ll q;
    rep(i, n) {
        cin>>a[i];
        ans+=a[i];
        a[i]--;
        cnt[a[i]]++;
    }
    cin>>q;
    rep(i, q) cin>>b[i]>>c[i];

    rep(i, q){
        ans += (c[i]-b[i])*cnt[b[i]-1];
        cnt[c[i]-1]+=cnt[b[i]-1];
        cnt[b[i]-1]=0;
        cout<<ans<<endl;
    }
}

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

typedef long long ll;
const ll inf=1e18;
int N;
vector<int> g[200100];
ll a[200100];
ll dp[200100];
ll ans[200100];

void solve(int u, int pa=-1){
    int ind=lower_bound(dp,dp+N,a[u])-dp;
    ll prev=dp[ind];
    dp[ind]=a[u];
    /*
    for(int i=0;i<N;i++){
        if(dp[i]==inf) cout << "inf" << " ";
        else cout << dp[i] << " ";
    }
    cout << endl;
    */
    ans[u]=lower_bound(dp,dp+N,inf)-dp;
    for(auto v:g[u]){
        if(v==pa) continue;
        solve(v,u);
    }
    dp[ind]=prev;
}

int main(){
    cin >> N;
    for(int i=0;i<N;i++) cin >> a[i];
    for(int i=0;i<N-1;i++){
        int u,v; cin >> u >> v;
        u--; v--;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    for(int i=0;i<N;i++){
        dp[i]=inf;
    }
    solve(0);
    for(int i=0;i<N;i++){
        cout << ans[i] << endl;
    }
}

Measured memory_bytes: 33440
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define fr(i,n) for(i=0;i<n;i++)
#define F first
#define S second
#define fast std::ios_base::sync_with_stdio(false)
#define mod 1000000007
#define pi 3.14159265
int main() {
	fast;
	lli a,b,c;
	cin>>a>>b>>c;
	if(a+b+c>=22)
	{
		cout<<"bust";
	}
	else
		cout<<"win";
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define range(i, l, r) for(long long int (i) = (l); (i) < (r); (i)++)
#define reversed_range(i, l, r) for (long long int (i) = (r) - 1; (i) >= l; (i)--)
using namespace std;
template <typename T>
using vec = vector<T>;
using lint = long long;
using ulint = unsigned long long;
using pint = pair<int, int>;
using plint = pair<lint, lint>;

template <typename S, typename T>
ostream& operator <<(ostream& os, pair<S, T> p) {
    os << "(";
    os << p.first << ", " << p.second;
    return os << ")";
}

template <typename T>
ostream& operator <<(ostream& os, vec<T> v) {
    os << "[";
    if (v.size() == 0) return os << "]";
    for (int i = 0; i < v.size() - 1; i++) {
        os << v.at(i) << ", ";
    }
    return os << v.at(v.size() - 1) << "]";
}

template <typename T>
ostream& operator <<(ostream& os, set<T>& s) {
    os << "{";
    if (s.begin() == s.end()) return os << "}";
    auto it_first_item = s.begin();
    cout << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        cout << ", " << *it;
    }
    return cout << "}";
}

template <typename T>
ostream& operator <<(ostream& os, unordered_set<T>& s) {
    os << "{";
    if (s.begin() == s.end()) return os << "}";
    auto it_first_item = s.begin();
    cout << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        cout << ", " << *it;
    }
    return cout << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, map<K, V> m) {
    os << "{";
    if (m.begin() == m.end()) return os << "}";
    auto it_first_item = m.begin();
    cout << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        cout << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, unordered_map<K, V> m) {
    os << "{";
    if (m.begin() == m.end()) return os << "}";
    auto it_first_item = m.begin();
    cout << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        cout << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

lint pow(lint num, lint e, lint MOD) {
    lint res = 1;
    lint cur_num = num;
    while (e) {
        if (e & 1) {
            res *= cur_num;
            res %= MOD;
        }
        cur_num *= cur_num;
        cur_num %= MOD;
        e >>= 1;
    }
    return res;
}

int main() {
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    lint N; cin >> N;
    string S, T; cin >> S >> T;
    string ans;
    range(i, 0, S.size() * 2) {
        if (i % 2 == 0) ans.push_back(S.at(i / 2));
        else ans.push_back(T.at(i / 2));
    }
    cout << ans << "\n";
}

Measured memory_bytes: 256
// ITP1_7_A:   Grading
// 2017.7.27
 
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
 
int main()
{
    int m, f, r;
    int s;
 
    while (1) {
        scanf("%d%d%d", &m, &f, &r);
        if (m == -1 && f == -1 && r == -1) break;
 
        if (m < 0 || f < 0) puts("F");
        else {
            s = m + f;
            if (s >= 80) puts("A");
            else if (s >= 65) puts("B");
            else if (s >= 50) puts("C");
            else if (s < 30) puts("F");
            else puts(r >= 50 ? "C" : "D");
        }
    }
    return 0;
}


Measured memory_bytes: 2052
/** author: __nishad **/

#include<bits/stdc++.h>
using namespace std;


typedef long long ll ;
typedef vector<ll> vll ;

#define all(v) (v).begin(),(v).end()
#define precision(k) cout<<setprecision(k)<<fixed;
#define rep(i,a) for(int i=0; i<a;i++)
#define rep1(i,a,b) for(int i=(a);i<=(b);++i)
#define min(v) *min_element(all(v))
#define max(v) *max_element(all(v))
#define getpos(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define pi 3.14159265358979323

int main()
{
    IOS;

    vector<int> v;
    vector<int>::iterator it;
    ll n, i=1;

    cin>>n;

    v.pb(n);

    while(true){
        if(n%2 == 0){
            int rem = n/2;
            it = find(v.begin(), v.end(), rem);
            if(it!= v.end()){
                cout<<it-v.begin()+4;
                return 0;
            }
            v.pb(n/2);

            n = n/2;
        }
        else{
            int rem = 3*n+1;
            it = find(v.begin(), v.end(), rem);
            if(it!= v.end()){
                cout<<it-v.begin()+4;
                return 0;
            }
            v.pb(3*n+1);

            n = 3*n+1;
        }

        i++;
    }




}


Measured memory_bytes: 256