akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;

int main() {
    vector<int> num;
	int n;
	double w,h;
	while(scanf("%d,%lf,%lf",&n,&w,&h)!=EOF) if (w/(h*h)>=25) num.push_back(n);
	if (num.size()>0) for (n=0;n<num.size();n++) cout << num[n] << endl;
	else cout << "該当なし" << endl;
	return 0;
}

Measured memory_bytes: 1252
import sys

n = int(input())
(t, a) = map(int, input().split())
hs = input().split()

for i in range(len(hs)):
    hs[i] = float(hs[i])

ts = []
for h in hs:
    ts.append(t - h * 0.006)

min = 0
min_t = sys.maxsize
for i in range(len(hs)):
    dt = abs(ts[i] - a)
    if dt < min_t:
        min = i
        min_t = dt
print(min + 1)


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

using namespace std;

#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define REP3(i, m, n) for(int i = m, i##_len=(n);i < i##_len;i++)
#define FORVEC(i, v) for(int i = 0;i < v.size();i++)

#define INF 1000000000
#define pb(a) push_back(a)
#define vi vector<int>
#define P pair<int,int>
#define all(vec) (vec.begin()),(vec.end())
#define ll long long int;
#define sz(x) ((int)(x).size())
#define in(x) int x;cin>>x;
#define bit(n) (1<<(n))


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


int main(){
	int n,m,a[100],b,p[100]={},cnt;
	cin>>n>>m;
	REP(i,m){
		cin>>a[i];
	}
	REP(i,m){
		cnt=0;
		REP(j,n){
			cin>>b;
			if(a[i]==b){
				p[j]++;
			}else{
				p[a[i]-1]++;
			}

		}
		/*REP(j,n){
			cout<<" "<<p[j];
		}*/
	}
	REP(i,n){
		cout<<p[i]<<"\n";
	}
	return 0;
}

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

int main(){
    ll x,c=0;
    cin>>x;
    ll res, ans = 100;
    while(ans<x) {
        res = ans;
        res /= 100;
        ans += res;
        c++;
    }
    cout<<c;
}

Measured memory_bytes: 3592
#include<bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define MOD	1000000007
#define int	long long
#define pii pair<int,int> 
#define vi vector<int>
using namespace std;

int power(int a, int b){ int S = 1; while(b--)S *= a; return S;}

int32_t main(){
	string s;
	cin >> s;
	int n = s.size();
	int m = 0;
	for(int i = 0, j = n-1; i < j; i++, j--){
		if(s[i] != s[j]){
			m = 1;
			break;
		}
	}
	if(m != 1){
		for(int i = 0, j = (n-2)/2; i < j; i++, j--){
			if(s[i] != s[j]){
				m = 1;
				break;
			}
		}
	}
	if(m != 1){
		for(int i = (n+2)/2, j = n-1; i < j; i++, j--){
			if(s[i] != s[j]){
				m = 1;
				break;
			}
		}
	}
	if(m == 0){
		cout << "Yes";
	}
	else{
		cout << "No";
	}
	return 0;
}



Measured memory_bytes: 256
//Author: Fuadul Hasan(fuadul202@gmail.com)
//BSMRSTU,Gopalganj

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

#define ll long long

const int N   = 2e5 + 5;

int main(){

	int n,m;
	cin>>n>>m;
	int x = (m*2)+1;
	if(n%x==0)
		cout<<(n/x)<<endl;
	else cout<<(n/x)+1<<endl;
}



Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <math.h>
#include <map>
#include <list>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <string>
#include <sstream>
#include <bitset>
#include <string.h>
// #include <limits.h>

#define FOR(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define FORUL(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#define FORULE(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define FOREACH(it, X) for(__typeof((X).begin()) it = (X).begin(); it != (X).end(); it++)
#if defined(_MSC_VER) || __cplusplus > 199711L
#define AUTOVAR(newvar,v) auto newvar = (v)
#else
#define AUTOVAR(newvar,v) __typeof(newvar) r = (v)
#endif
#define PB(x) push_back(x)
#define MP(x,y) make_pair((x),(y))
#define MEMSET(m,v) memset(m,v,sizeof(m))

typedef long long        ll;
typedef unsigned long long    ull;

#define INTMAX  99999999

#define DEBUG 0

#if DEBUG
#define DOUT cout<<"["<<__LINE__<<"]:"
#else
#define DOUT 0 && cout
#endif

using namespace std;

string S;

int main(int argc, char *argv[])
{
	ios::sync_with_stdio(false);

	cin >> S;

	int divcnt = 0;
	char prev = '\0';
	FOR(i, S.size()) {
		// DOUT << "prev=="<<prev<<endl;
		// DOUT << "S["<<i<<"]=="<<S[i]<<endl;
		if (prev && prev!=S[i]) {
			divcnt++;
		}
		prev = S[i];
	}

	cout << divcnt << endl;

	return 0;
}
 


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

int main(void){
    int N;
    cin >> N;
    vector<int> a(N);
    for (int i = 0; i < N; i++)
    {
        cin >> a[i];
    }

    int cnt = 0;

    for(int i = 0; i < N; i+=2){
        if(a[i] % 2 != 0) cnt++;
    }

    cout << cnt << endl;
    
    return 0;
}


Measured memory_bytes: 3596
using System;
using System.Collections.Generic;
using System.Text;

namespace ITP1_5_D
{
	class Program
	{
		static void Main(string[] args)
		{
			string s = Console.ReadLine();
			int n = int.Parse(s);

			int i = 1;
			do {
				int x = i;
				if (x % 3 == 0) {
					Console.Write(" {0}", i);
				} else {
					do {
						if (x % 10 == 3) {
							Console.Write(" {0}", i);
							break;
						}
						x /= 10;
					} while (x != 0);
				}
			} while (++i <= n);
			Console.WriteLine();
		}
	}
}

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

using namespace std;

int main()
{
	int h, w;

	cin >> h >> w;

	vector<vector<int>> col(h, vector<int> (w));

	int n;

	cin >> n;
        
	int i = 0, j = 0, t = 1;                 
	 
	for (int x = 1; x <= n; x++)
	{
		int a;

		cin >> a;

		while (a)
		{
			if (t == 1 && j == w)
			{
				j = w - 1;
				t = -1;
				i++;
			}
			else if (t == -1 && j == -1)
			{
				j = 0;
				t = 1;
				i++;
			}

			//cout << i << " " << j << endl;
			col[i][j] = x;
			j += t;
			a--;	
		}		
	}
	
	for (int i = 0; i < h; i++)
	{
		for (int j = 0; j < w; j++)
			cout << col[i][j] << " ";
		cout << endl;
	}
	
	return 0;
}

Measured memory_bytes: 384
N = int(input())
Y_MAX = 0
X_MAX = 0
Y_MIN = 1000000000000
X_MIN = 1000000000000

for i in range(N):
    x, y = map(int, input().split())
    if abs(0 - x) + abs(y - 1000000000000) > Y_MAX:
        Y_MAX = abs(0 - x) + abs(y - 1000000000000)
    if abs(0 - x) + abs(y - 1000000000000) < Y_MIN:
        Y_MIN = abs(0 - x) + abs(y - 1000000000000)
    if abs(0 - x) + abs(0 - y) > X_MAX:
        X_MAX = abs(0 - x) + abs(0 - y)
    if abs(0 - x) + abs(0 - y) < X_MIN:
        X_MIN = abs(0 - x) + abs(0 - y)

print(max(Y_MAX - Y_MIN, X_MAX - X_MIN))


Measured memory_bytes: 9196
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
 
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#define start_routine() int begtime = clock();
#define end_routine() int endtime = clock(); cerr << endl << "Time elapsed: " << (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms"; return 0
#define speed() cin.tie(0), cout.tie(0), ios_base::sync_with_stdio(false)
// #define exit(a, b) return cout << a, b;
 
// debugger
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
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...);
}
#define debug(stuff) cout << #stuff << ": " << stuff <<endl
#define debugc(stuff) cout << #stuff << ": "; for(auto x: stuff) cout << x << " "; cout << endl;
// 
 
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define all(v) v.begin(), v.end() 
 
#define print(stuff) cout << stuff << endl
#define printc(stuff) for(auto x: stuff) cout << x << " "; cout << endl;
#define printPrec(stuff) cout << fixed << setprecision(15) << stuff << endl;
#define len length
#define ret0 return 0
#define ret return 
 
 
#define ll long long
#define ld long double
#define fi first
#define endl '\n'
#define se second
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define fill(ar, x) memset(ar, x, sizeof ar)
 
#define vl vector<ll> 
#define sl set<ll>
#define pll pair<ll, ll>
#define mll map<ll, ll> 
#define pq priority_queue<ll>
 
// typedef tree<ll,null_type,less<ll>,rb_tree_tag,
// tree_order_statistics_node_update> indexed_set;
 
#define inf (long long int) 1e18
#define eps 0.000001
#define mod 1000000007
#define mod1 998244353
#define MAXN (ll)2e5+5
#define N (1ll<<10)

void solve(){
    ll a, v, c;
    cin>>a>>v>>c;
    if(a+v+c >= 22) print("bust");
    else print("win");
}
 
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
 
    ll t = 1;
    // cin>>t;
    while(t--){
        solve();
    }
        
  
}


Measured memory_bytes: 256
h,w = map(int, input().split())
ab = list(input() for _ in range(h))

res =[]

for i in range(h):
    if ab[i].count(".") ==w:
        pass
    else:
        res.append(ab[i])

l = len(res)

ress=[]
for j in range(w):
    b = list(map(lambda x: x[j], res))
    if b.count(".") ==l:
        pass
    else:
        ress.append(b)

ans = list(zip(*ress))

for i in range(l):
    print(''.join(ans[i]))

Measured memory_bytes: 9308
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
#include <queue>
#include <map>
#include <set>
using namespace std;
using ll = long long;
const int INF = 1<<30;
const int MOD = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2>& p) { os << p.first << " " << p.second; return os; }
template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) { for(int i = 0; i < (int) v.size(); i++) os << v[i] << (i + 1 != v.size() ? " " : ""); return os; }

void solve()
{
    int n, m; cin >> n >> m;
    int k = pow(2, m);
    int ans = 100 * (n - m) + 1900 * m;
    ans *= k;
    cout << ans << endl;
}

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
A,B,Q=map(int, input().split())
S=[int(input()) for _ in range(A)]
T=[int(input()) for _ in range(B)]
X=[int(input()) for _ in range(Q)]

import bisect
def solve(x):
    sr=bisect.bisect_right(S,x)
    tr=bisect.bisect_right(T,x)
    sl=sr-1
    tl=tr-1
    ret=10**12
    if sl>=0 and tl>=0:
        ret=min(ret,x-min(S[sl],T[tl]))
    if sr<A and tl>=0:
        ret=min(ret,S[sr]-T[tl]+min(S[sr]-x,x-T[tl]))
    if sl>=0 and tr<B:
        ret=min(ret,T[tr]-S[sl]+min(T[tr]-x,x-S[sl]))
    if sr<A and tr<B:
        ret=min(ret,max(S[sr],T[tr])-x)
    return ret

for x in X:
    print(solve(x))

Measured memory_bytes: 131420
#include<bits/stdc++.h>
#define Rint register int
using namespace std;
typedef long long LL;
const int mod = 1e6 + 3;
int q, x, n, d;
inline int kasumi(int a, int b){
	int res = 1;
	while(b){
		if(b & 1) res = (LL) res * a % mod;
		a = (LL) a * a % mod;
		b >>= 1;
	}
	return res;
}
int fac[mod], inv[mod], invfac[mod];
inline void init(int m){
	fac[0] = 1;
	for(Rint i = 1;i <= m;i ++) fac[i] = (LL) i * fac[i - 1] % mod;
	invfac[m] = kasumi(fac[m], mod - 2);
	for(Rint i = m;i;i --){
		invfac[i - 1] = (LL) i * invfac[i] % mod;
		inv[i] = (LL) invfac[i] * fac[i - 1] % mod;
	}
}
int main(){
	scanf("%d", &q);
	init(mod - 1);
	while(q --){
		scanf("%d%d%d", &x, &d, &n);
		if(!d){
			printf("%d\n", kasumi(x, n)); continue;
		}
		x = (LL) x * inv[d] % mod;
		if(!x || x + n > mod){
			puts("0"); continue;
		}
		printf("%d\n", (LL) fac[x + n - 1] * invfac[x - 1] % mod * kasumi(d, n) % mod);
	}
}

Measured memory_bytes: 12544
N = int(input())
a = [int(_) for _ in input().split()]
color = [False]*8
overnum = 0

for i in a:
    if i < 400:
        color[0] = True
    elif i < 800:
        color[1] = True
    elif i < 1200:
        color[2] = True
    elif i < 1600:
        color[3] = True
    elif i < 2000:
        color[4] = True
    elif i < 2400:
        color[5] = True
    elif i < 2800:
        color[6] = True
    elif i < 3200:
        color[7] = True
    else:
        overnum += 1

print(max(1, color.count(True)), color.count(True)+overnum)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define _Pi 3.1415926535
#define _MOD = 1e9+7;
using namespace std;
typedef long long ll;

int main(){
    int a,b; cin >> a >> b;

    for(double i = 1; i <= 20000; ++i){
        if((int)(i * 0.08) == a && (int)(i * 0.1) == b){
            cout << i << endl;
            return 0;
        }
    }

    cout << -1 << endl;

    
    return 0;
}


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

#define SENTINEL 1000000001

void printArray(int array[], int n) {
    for (int i = 0; i < n; i++) {
        if (i != 0) printf(" ");
        printf("%d", array[i]);
    };
}

void merge(int array[], int left, int mid, int right, int * p_compareCount) {
    int nL = mid - left;
    int nR = right - mid;
    
    int Left[nL + 1], Right[nR + 1];
    int i, j, k;
    
    for (i = 0; i < nL; i++)  Left[i] = array[left + i];
    for (j = 0; j < nR; j++) Right[j] = array[mid  + j];
    
    Left[nL] = Right[nR] = SENTINEL;
    
    for (i = 0, j = 0, k = left; k < right; k++) {
        
        (*p_compareCount)++;
        
        if (Left[i] < Right[j]) 
            array[k] = Left[i++];
        else 
            array[k] = Right[j++];
    }
}

void mergeSort(int array[], int left, int right, int *p_compareCount) {
    if (left + 1 < right) {
        int mid = (left + right)/2;
        mergeSort(array, left, mid, p_compareCount);
        mergeSort(array, mid, right, p_compareCount);
        merge(array, left, mid, right, p_compareCount);
    }
}

int main(int argc, char** argv) {
    int nArray, i;
    scanf("%d", &nArray);
    
    int array[nArray];
    
    for (i = 0; i < nArray; i++) {
        scanf("%d", &array[i]);
    };
    
//    printf("Scanned: ");printArray(array, nArray);printf("\n");
    
    int compareCount = 0;
    
    mergeSort(array, 0, nArray, &compareCount);
    
//    printf("Sorted: ");
    printArray(array, nArray);printf("\n");
    printf("%d\n", compareCount);

    return (EXIT_SUCCESS);
}



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

int main(){
string A,B,ans;
cin>>A>>B;
if(A.size()>B.size()){
  ans ="GREATER";
}else if(A.size()<B.size()){
  ans = "LESS";
}else{
  ans = "EQUAL";
  for(int i = 0;i<A.size();i++){
    if((A.at(i)-'0')>(B.at(i)-'0')){
      ans = "GREATER";
      break;
    }else if((A.at(i)-'0')<(B.at(i)-'0')){
      ans = "LESS";
      break;
    }
  }
}

  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
#define _GLIBCXX_DEBUG
#define int long long
using namespace std;
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPR(i, n) for (ll i = (ll)(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 ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MAXIN(x) max_element(ALL(x)) - v.begin();
#define MIN(x) *min_element(ALL(x))
#define INF 1000000000000
#define MOD 10000007
#define MAXR 100000
#define PI 3.14159265358979323846
using namespace std;

vector<int> c;
int n, m, x;
vector<vector<int> > s;
vector<int> buy;

void debugV(vector<int>& deV) {
    for (int i = 0; i < deV.size(); i++) {
        cout << "[" << i << "]= " << deV[i] << ",";
    }
    cout << endl;
}

void debugVV(vector<vector<int> >& deV) {
    for (int i = 0; i < deV.size(); i++) {
        cout << i << " ";
        for (int j = 0; j < deV[i].size(); j++) {
            cout << "[" << j << "]= " << deV[i][j] << ",";
        }
        cout << endl;
    }
}

int saiki(int d, bool buyIT) {
    // if (i == N) {
    //     if (!a || !b || !c) return INF;
    //     return abs(a - A[0]) + abs(b - A[1]) + abs(c - A[2]);
    // }
    // int res = saiki(i + 1, a, b, c);
    // res = min(res, saiki(i + 1, a + l[i], b, c) + (a ? 10 : 0));
    // res = min(res, saiki(i + 1, a, b + l[i], c) + (b ? 10 : 0));
    // res = min(res, saiki(i + 1, a, b, c + l[i]) + (c ? 10 : 0));
    if (d != 0) buy[d - 1] = buyIT;

    int nedan = 0;

    if (d == n) {
   //     debugV(buy);
        vector<int> ri(m);
        REP(i, n) {  //参考書ごと
            if (buy[i]) {
                nedan += c[i];
                REP(j, m) {  //アルゴごと
                    ri[j] += s[i][j];
                }
            }
        }
        if (nedan == 0) return INF;
        bool allok = true;
        REP(i, m) {
            if (ri[i] < x) allok = false;
        }
        if (allok) {
    //        cout << nedan << endl;
            return nedan;
        } else {
            return INF;
        }
    }

    int res = INF;
    res = min(res, saiki(d + 1, true));
    res = min(res, saiki(d + 1, false));

    return res;
}

signed main() {
    cin >> n >> m >> x;
    c.resize(n);
    buy.resize(n);

    REP(i, n) {
        cin >> c[i];
        s.push_back(vector<int>());
        REP(j, m) {
            int a;
            cin >> a;
            s[i].push_back(a);
        }
    }

    int ans = saiki(0, true);
    if (ans == INF)
        cout << "-1" << endl;
    else
        cout << ans << endl;
    return 0;
}

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

int main(){
  string s;cin >> s;
  string ss = s+s;
  ll n; cin >> n;
  ll ans1 = 0;
  bool flag=true;
  for(int i=1; i<s.size(); i++){
    if(s.at(i-1)!=s.at(i)){flag=false;}
  }
  if(flag){
	cout << (ll)(s.size())*n/2 << endl;
    return 0;
  }
  for(int i=1; i<s.size(); i++){
    if(s.at(i-1)==s.at(i)){ans1++;i++;}
  }
  ll ans2 = 0;
  for(int i=1; i<ss.size(); i++){
    if(ss.at(i-1)==ss.at(i)){ans2++;i++;}
  }
  if(n==1)cout << ans1 << endl;
  if(n==2)cout << ans2 << endl;
  if(2<n)cout << (ans2-ans1)*(n-2)+ans2 << endl;
}
  


Measured memory_bytes: 256
S = input()
keyword = "keyence"
R = S[::-1]
c=0
r = 0
for i in range(7):
    if S[i]==keyword[i]:
        c+=1
    if S[i] !=keyword[i] and R[r]==keyword[-1-r]:
        r+=1
if r+c ==7:
    print("YES")
else:print("NO")
        

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

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


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

#define f(i,a,b) for (int i = a; i < b; i++)

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

int main() {
	string s,t; int n,m;
  cin>>n>>m>>s>>t;
  	int j = 0;
  	f(i,0,n) {
    	while (1LL*i*m > 1LL*j*n) j++;
      	if (1LL*i*m == 1LL*j*n && s[i] != t[j]) {
        	cout << -1 << endl;
          return 0;
        }
    }
  cout << 1LL*n*m/gcd(n,m) << endl;
	return 0;
}

Measured memory_bytes: 512
s = input()
n = len(s) - 1

ans = 0
for i in range(2 ** n):
    first = ''
    for j in range(n):
        if ((i >> j) & 1):
            ans += int(first + s[j])
            first = ''
        else:
            first += s[j]
    ans += int(first + s[-1])
print(ans)

Measured memory_bytes: 9140
#include<stdio.h>

void dividing_student(int a, int b, int c);

int main(void)
{
    while(1){
        int n;/*nはデータの個数*/
        scanf("%d", &n);    
        if(n == 0){
            break;
        }else{
            for( int i = 0; i < n; ++i){
                int pm ,pe, pj; /*左から数学、英語、国語の点数*/
                scanf("%d %d %d", &pm, &pe, &pj);
                dividing_student( pm, pe, pj);
            }
        }
    }
    return 0;
}

void dividing_student( int a, int b, int c)
{
    if( a >= 100|| b >= 100 || c >=100){
        printf("A\n");
    }else if( (a + b) / 2 >= 90){
        printf("A\n");
    }else if( (a + b + c) / 3 >= 80){
        printf("A\n");
    }else if( (a + b + c) / 3 >= 70){
        printf("B\n");
    }else if((a + b + c) / 3 >= 50 && (a >= 80 || b >= 80)){
        printf("B\n");
    }else{
        printf("C\n");
    }
}    
    

Measured memory_bytes: 1012
n = int(input())
arr = list(map(int,input().split()))

arr.sort()
arr.reverse()

stack = []
ans = 0
while(True):
    if len(arr) == 0:
        if stack[-1] > len(stack):
            ans += len(stack)
        else:
            ans += (len(stack) - stack[-1])
        break
    tmp = arr.pop(-1)
    if len(stack) == 0:
        stack.append(tmp)
    elif stack[-1] == tmp:
        stack.append(tmp)
    else:
        if stack[-1] == len(stack):
            pass
        elif stack[-1] > len(stack):
            ans += len(stack)
        else:
            ans += (len(stack) - stack[-1])
        stack = []
        stack.append(tmp)

print(ans)


Measured memory_bytes: 14400
function myout(text){console.log(text);}//standard output
function Main(input) {
	//input = parseInt(input);
	input = input.split("");
	//input = input.split("\n");
	//input = input.split(" ").map((a)=>Number(a));
	//input = input.split("\n").map((a)=>Number(a));
  var output = 0;
  for(var i = 1; i <= input.length; i++){
    var mae = input[i-1];
    var ato = input[i];
    if(mae == ato){
       output++;
      if(ato == "1"){
         input[i] = "0";
         }else{
         input[i] = "1";
         }
    }
  }
  myout(output);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());


Measured memory_bytes: 8268
#import <Foundation/Foundation.h>
int main() {
	int n;
	scanf("%d",&n);
	long sum=0;
	scanf("%ld",&sum);
	long prev=sum;
	for(int i=0;i<n-2;i++){
		long b;
		scanf("%ld",&b);
		sum+=MIN(b,prev);
		prev=b;
	}
	sum+=prev;
	printf("%ld\n",sum);
}

Measured memory_bytes: 6852
#include <bits/stdc++.h>
#define endl '\n'
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define zy -2147382637
#define bql 2147483647
#define ll long long
#define ull unsigned long long
#define ld long double
#define il inline
#define sz(x) x.size()
#define maxn 100010
#define rp(i, l, r) for (int i = l; i <= r; i++)
#define rb(i, r, l) for (int i = r; i >= l; i--)
#define fi first
#define se second
#define pb push_back
#define mp make_pair

using namespace std;
ll max(ll a,ll b){if(a>b)return a;else return b;}
ll min(ll a,ll b){if(a<b)return a;else return b;}
ll lowbit(ll x){return x&(-x);}
ll prime(ll x){
   if(x<=1)return false;
   for(int i=2;i<=int(sqrt(x));i++){
	   if(x%i==0)return false;
   }return true;
}
bool cmp(ll a,ll b){return a>b;}
ll gcd(ll a,ll b){ll r;while(b>0){r=a%b;a=b;b=r;}return a;}
ll powmod(ll a,ll b,ll mod) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
inline ll read() {
	char c = getchar(); ll w = 1; ll x = 0;
	while (!isdigit(c))
		(c == '-') && (w = -w), c = getchar();
	while (isdigit(c))
		x = (x << 1) + (x << 3) + (c ^ '0'), c = getchar();
	x *= w;
}
const int dx[8] = {-1, 1, 0, 0, -1, 1, -1, 1},
		  dy[8] = {0, 0, -1, 1, -1, -1, 1, 1};
int main(){
	fast;
	ll n;
	cin>>n;
	string s;
	cin>>s;
	ll ans=1;
	char flag=s[0];
	for(int i=1;i<s.size();i++){
		if(s[i]!=flag){
			flag=s[i];
			ans++;
		}
	}cout<<ans<<endl;
	return 0;
}/*『你强归你强，我永不示弱』*/




Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
using namespace std;
using ll = unsigned long long;
using P = pair<int, int>;
const ll mod = 1'000'000'007;

int main()
{
    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    ll ans = 0;
    int w = 0; // 横方向の長さを保持する変数
    rep(i, n)
    {
        ans = (ans + a[i] * w) % mod;
        w = (w + a[i]) % mod;
    }
    cout << ans << endl;
}


Measured memory_bytes: 4840
#include <stdio.h>
#include <string.h>

int main(){
    int n;
    
    scanf("%d",&n);
    
    int p[n+1];
    int poi[n+1];
    char s[n+1][11],box[11];
    
    
    for(int i=1;i<=n;i++){
        scanf("%s %d",s[i],&p[i]);
        poi[i]=i;
    }
    
    for(int i=2;i<=n;i++){
        for(int j=2;j<=n;j++){
            if(strcmp(s[j-1],s[j])>0){
                strcpy(box,s[j-1]);
                strcpy(s[j-1],s[j]);
                strcpy(s[j],box);
                
                int Box1,Box2;
                
                Box1=poi[j-1];
                poi[j-1]=poi[j];
                poi[j]=Box1;
                
                Box2=p[j];
                p[j]=p[j-1];
                p[j-1]=Box2;
            }
        }
    }
    
    for(int i=2;i<=n;i++){
        for(int j=2;j<=n;j++){
            if(strcmp(s[j-1],s[j])==0){
                if(p[j]>p[j-1]){
                    int Box1,Box2;
                    
                    Box1=poi[j];
                    poi[j]=poi[j-1];
                    poi[j-1]=Box1;
                    
                    Box2=p[j];
                    p[j]=p[j-1];
                    p[j-1]=Box2;
                }
            }
        }
    }
    
    for(int i=1;i<n;i++){
        printf("%d\n",poi[i]);
    }
    printf("%d",poi[n]);
    return 0;
}

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

using namespace std;

int main()
{
    int N, T, A, H;
    double Temperature;
    cin >> N >> T >> A;
    vector<double> v;

    for (int i = 0; i < N; i++)
    {
        cin >> H;
        Temperature = T - (H * 0.006);
        Temperature = abs(A - Temperature);
        v.push_back(Temperature);
    }

    auto iter = min_element(v.begin(), v.end());

    for (int i = 0; i < v.size(); i++)
    {
        if (*iter == v[i])
        {
            cout << i + 1;
            break;
        }
    }
}

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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define MOD 1000000007LL

#define rep(i, n) for(ll (i) = 0LL;(i) < (ll)(n);(i)++)
#define rep2(i, s, e) for(ll (i) = (ll)(s);(i) < (ll)(e);(i)++)
#define repi(i, n) for(ll (i) = 0LL;(i) <= (ll)(n);(i)++)
#define repi2(i, s, e) for(ll (i) = (ll)(s);(i) <= (ll)(e);(i)++)
#define per(i, n) for(ll (i) = (ll)(n) - 1LL;(i) >= 0LL;(i)--)
#define per2(i, s, e) for(ll (i) = (ll)(s) - 1LL;(i) >= (ll)(e);(i)--)
#define peri(i, n) for(ll (i) = (ll)(n);(i) >= 0LL;(i)--)
#define peri2(i, s, e) for(ll (i) = (ll)(s);(i) >= (ll)(e);(i)--)
#define iter(i, it) for(auto &(i): (it))

template<typename T, typename U> ostream& operator<<(ostream &s, const pair<T, U> m) {
    cout << "(" << m.first << ", " << m.second << ")";
    return s;
}
template<typename T, typename U> ostream& operator<<(ostream &s, const map<T, U> m) {
    ll c = 0;
    cout << "{ ";
    iter(i, m) cout << i << (c++ == m.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
    cout << "{ ";
    rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const list<T> &v) {
    ll c = 0;
    cout << "{ ";
    iter(i, v) cout << i << (c++ == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}

int main(void) {
    ll A, B, X;
    cin >> A >> B >> X;
    if(A <= X && A + B >= X) cout << "YES";
    else cout << "NO";
    cout << endl;
    return 0;
}


Measured memory_bytes: 3572
#include<bits/stdc++.h>
using namespace std;
#define rep(i, l, r) for (int i = l; i<r;i++)
#define dec(i, l, r) for (int i = l; i>=r;i--)
#define vi vector<int>
#define all(v) v.begin(),v.end()
#define pb(c) push_back(c)
#define vii vector<pair<int,int>>
#define ii pair<int,int>
#define mp(i, j) make_pair(i,j)
#define ull unsigned long long int
#define ll  long long int
#define pie 3.141592653589793238
#define inf ((ll)1e18)
#define eps 1e-14
#define mod ((int)1e9+7)
#define maxlg 18
#define maxn 1000002
#define left(i) ((i)<<1)
#define right(i) (((i)<<1)+1)
int dsuPar[maxn];
int rnk[maxn];
int find(int x) {
    if (dsuPar[x]==x)return x;
      return find(dsuPar[x]);
}

int merge(int x,int y) {
    int parx =  find(x);
    int pary = find(y);
    if (rnk[parx]==rnk[pary]) {
        dsuPar[pary] = parx;
        rnk[parx]++;
    } else if (rnk[parx]<rnk[pary]) {
        dsuPar[parx] = pary;
    } else {
        dsuPar[pary] = parx;
    }
}
vii x,y;
ii point[maxn];
struct s{
    int diff,i,j;
};
bool comp(s a,s b) {
    if (a.diff==b.diff && a.i==b.i)
        return a.j<b.j;
    if (a.diff==b.diff) {
        return a.i<b.i;
    }
    return a.diff<b.diff;
}
set<s,bool(*)(s,s)> q(comp);
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#ifndef ONLINE_JUDGE
 #endif
     int n;
    cin>>n;
    rep (i,0,n) {
        int a,b;
        dsuPar[i]=i;
        cin>>a>>b;
        point[i] = mp(a,b);
        x.push_back(mp(a,i));
        y.push_back(mp(b,i));
    }
    sort(all(x));
    sort(all(y));
    rep (i,0,n-1) {
        s t= {abs(x[i].first-x[i+1].first),x[i].second,x[i+1].second};
        s t1 = {abs(y[i].first-y[i+1].first),y[i].second,y[i+1].second};

        q.insert(t);
        q.insert(t1);
    }
    ll ans=0;

    while (!q.empty()) {
        s top = *q.begin();
        q.erase(q.begin());
        if (find(top.i)!=find(top.j)) {
            merge(top.i,top.j);
            ans+=top.diff;
        }
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 21228
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

int main(){

    int n;
    cin >> n;
    int ans = 0;
    if(n < 105){
        ans = 0;
    }else if(n >= 105 && n < 135){
        ans = 1;
    }else if(n >= 135 && n < 165){
        ans = 2;
    }else if(n >=165 && n < 189){
        ans = 3;
    }else if(n>= 189 && n <195){
        ans = 4;
    }else{
        ans = 5;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
        using namespace std;
   #define int long long
    const int MAX =200002;
const int MOD =1000000007;

     signed main(){
int h,w;
cin>>h>>w;
string s[h];
for(int i=0;i<h;i++)cin>>s[i];
int ans=w;
int x[w];fill(x,x+w,1);
stack<pair<int,int>> t;
for(int i=1;i<h;i++){
    x[0]++;
    t.push({x[0],0});
    for(int j=1;j<w;j++){
        if((s[i][j]==s[i-1][j])==(s[i][j-1]==s[i-1][j-1]))x[j]++;
        else x[j]=1;
        //cerr<<i<<' '<<j<<' '<<x[j]<<endl;
        int k=j-1;
        while(!t.empty()&&t.top().first>=x[j]){
            ans=max(ans,t.top().first*(j-t.top().second));
  
            k=t.top().second;
            t.pop();
        }
        t.push({x[j],k});
    }
    while(!t.empty()){
        ans=max(ans,t.top().first*(w-t.top().second));
  
        t.pop();
    }
  //  cerr<<ans<<endl;
}
cout<<ans<<endl;


     }


 


 






    





      

        


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

int main(void){
  char s[1001];
  int len;

  scanf("%s", s);

  len=strlen(s);

  if(s[len-1]=='s'){
    printf("%ses\n", s);
  }

  else printf("%ss\n", s);

  return 0;

}


Measured memory_bytes: 1720
#define _CRT_SECURE_NO_WARNINGS
#include <vector>
#include <iostream>
#include <string.h>
#include <set>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <string>
using namespace std;

typedef double LD;
typedef long long LL;
typedef pair<int, int> PII;
#define MP make_pair
#define PB push_back
#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define RFOR(i,b,a) for(int i = (b) - 1; i >= (a); --i)
#define REP(i, t) FOR(i,0,t)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())

const LL MOD = 1000000007;
const int INF = 1e9;
const LL LINF = 1LL * INF * INF;
const int MAXN = 2007;
const LD EPS = 1e-7;

bitset <MAXN * MAXN> B;

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//freopen("In.txt", "r", stdin);
	int n, s = 0;
	cin >> n;
	B[0] = 1;
	REP(i, n)
	{
		int a;
		cin >> a;
		s += a;
		B |= B << a;
	}
	FOR(i, (s + 1) >> 1, MAXN * MAXN)
		if (B[i])
		{
			cout << i;
			return 0;
		}
	//cout << endl; system("pause");
	return 0;
}

Measured memory_bytes: 1792
/*
  AOJ 2103 
  Title:Battle Town
  @kankichi573
*/
#include <stdio.h>
#include <string.h>


int T,H,W,N;
int py,px;   //position
char map[20][21];
char map2[20][21];
char op[101];
int dir;
int diffx[4]={1,0,-1,0};
int diffy[4]={0,-1,0,1};
char sensha[4]=">^<v";

int in_range(int y,int x)
{
        return(y>=0 && y<H && x>=0 && x<W);
}
void dispatch(char ins)
{
        int dx,dy;

        if(ins=='U')
        {
                dir=1;
                if(py>0   && map[py-1][px]=='.')
                        py--;
        }
        if(ins=='D')
        {
                dir=3;
                if(py<H-1 && map[py+1][px]=='.')
                        py++;
        }
        if(ins=='L')
        {
                dir=2;
                if(px>0   && map[py][px-1]=='.')
                        px--;
        }
        if(ins=='R')
        {
                dir=0;
                if(px<W-1 && map[py][px+1]=='.')
                        px++;
        }
        if(ins=='S')
        {
                dy=py;dx=px;
                while(in_range(dy,dx) && (map[dy][dx]=='.' || map[dy][dx]=='-'))
                {
                        dy+=diffy[dir];
                        dx+=diffx[dir];
                        //printf("DYX=%d %d\n",dy,dx);
                }
                if(in_range(dy,dx) && map[dy][dx]=='*')
                        map[dy][dx]='.';
        }
}
void write_map(int cr)
{
        int i;
        
        memcpy(map2,map,20*21);
        map2[py][px]=sensha[dir];

        for(i=0;i<H;i++)
                printf("%s\n",&map2[i][0]);

        if(cr)
                printf("\n");
}
int search_pos(int * y,int * x)
{
        int i,j;
        char *p;

        for(i=0;i<H;i++)
                for(j=0;j<W;j++)
                        if((p=strchr(sensha,map[i][j])))
                        {
                                *y=i;*x=j;return(p-sensha);
                        }
        return(-1);
}
void solve()
{
        int i;
        char ins;

        dir=search_pos(&py,&px);

        //printf("YX=%d %d (%d)\n",py,px,dir);

        map[py][px]='.';

        for(i=0;i<N;i++)
        {
#ifdef DEBUG
                write_map(1);
#endif
                ins=op[i];
#ifdef DEBUG
                printf("INS=%c\n",ins);
#endif
                dispatch(ins);
        }
}
main()
{
        int i,j,ret;

        scanf("%d",&T);
        for(i=0;i<T;i++)
        {
                scanf("%d %d",&H,&W);
                for(j=0;j<H;j++)
                        scanf("%s",&map[j][0]);
                scanf("%d",&N);
                scanf("%s",&op[0]);
                solve();
                write_map((i<T-1));
        }
        return(0);
}

Measured memory_bytes: 592
#include <bits/stdc++.h>
#define meow(args...) fprintf(stderr, args)
typedef unsigned u32;
typedef long long s64;
typedef unsigned long long u64;
template<class T1, class T2> inline bool cmin(T1 &a, const T2 &b) {return b<a?(a=b, true):false;}
template<class T1, class T2> inline bool cmax(T1 &a, const T2 &b) {return a<b?(a=b, true):false;}
template<class Type> Type read() {
	Type a;
	bool b;
	unsigned char c;
	while(c=getchar()-48, (c>9)&(c!=253));
	for(a=(b=c==253)?0:c; (c=getchar()-48)<=9; a=a*10+c);
	return b?-a:a;
}
int (*rd)()=read<int>;

struct Item {
	int y, z;
	s64 x;
	bool operator<(const Item &o) const {return x*o.y<y*o.x;}
};
const int N=51;
int p[N];
Item item[N];
s64 f[N*N*N];
int main() {
	int n, x, d, vol=0;
	s64 ans=0, cur=0;
	n=rd(), x=rd(), d=rd();
	for(int i=1; i<=n; ++i) {
		item[i].x=rd();
		item[i].y=1;
		if(i>1) p[i]=rd();
	}
	for(int i=n; i>1; --i) {
		item[p[i]].x+=item[i].x;
		item[p[i]].y+=item[i].y;
		item[i].z=d;
	}
	item[1].z=x/item[1].x;
	std::sort(item+1, item+n+1);
	memset(f, 63, sizeof(f));
	f[0]=0;
	for(int i=1; i<=n; ++i) {
		int t=std::min(item[i].z, n), y=item[i].y;
		item[i].z-=t;
		for(int j=1; j<t; j*=2) {
			vol+=j*y;
			for(int k=vol; k>=j*y; --k) cmin(f[k], f[k-j*y]+j*item[i].x);
			t-=j;
		}
		vol+=t*y;
		for(int k=vol; k>=t*y; --k) cmin(f[k], f[k-t*y]+t*item[i].x);
	}
	for(int i=vol; i--; ) cmin(f[i], f[i+1]);
	while(f[vol]>x) --vol;
	for(int i=vol, j=1; i>=0; --i) {
		x-=f[i];
		for(; j<=n&&item[j].z<=x/item[j].x; ++j) {
			cur+=(s64)item[j].y*item[j].z;
			x-=item[j].x*item[j].z;
		}
		if(j<=n) {
			int t=x/item[j].x;
			cur+=(s64)item[j].y*t;
			item[j].z-=t;
			x%=item[j].x;
		}
		cmax(ans, i+cur);
		x+=f[i];
	}
	printf("%lld\n", ans);
	return 0;
}


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

int main(){
    long long l, r;
    cin >> l >> r;
    long long res = 2019;
    bool flag = false;
    for(long long i = l;i < r;i++){
        for(long long j = i + 1;j <= r;j++){
            res = min(res, i * j % 2019);
            if(res == 0){
                flag = true;
                break;
            }
        }
        if(flag){
            break;
        }
    }
    cout << res << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
 
int main(){
  long long n, k; cin >> n >> k;
  long long res = n;
  long long a = n/k;
  res = n - a*k;
  while(res > 0){
    long long front = res;
    res = min(res, abs(res - k) );
    if(front == res) break;
  }
  cout << res << endl;
}

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

int main() {

    int N , L;
    cin >> N >> L;

    vector<string> V;

    string str;

    while(N--) {
        cin >> str;

        V.push_back(str);
    }

    sort( V.begin() , V.end() );

    for(int i = 0 ; i < V.size() ; i++ ) {
        cout << V[i] ;
    }

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <math.h>
#include <string>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <stdlib.h>
#include <time.h> 
#include <assert.h>

#define nmax 500010
#define eps 1e-8
#define MOD 1000000007

#define P1 25671
#define P2 191
#define MOD1 666013
#define MOD2 1000000007
#define B_SIZE 315

#define SZ(x) ((int)(x.size()))

#define fst first
#define snd second
#define pb push_back
#define mp make_pair

using namespace std;

int gcd(int a, int b) { if (b == 0) return a; else return gcd(b, a % b); }

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

int n, m;
int dp[1010][1010];
char s[1010][1010];

int f(int x)
{
	if (x >= MOD) return x - MOD; else
		return x;
}

int main()
{
	scanf("%d %d", &n, &m);

	for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);

	dp[0][1] = 1;

	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= m; j++)
			if (s[i][j] == '.') dp[i][j] = f(dp[i - 1][j] + dp[i][j - 1]);

	printf("%d", dp[n][m]);

	return 0;
}

Measured memory_bytes: 5248
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace __gnu_pbds;
using namespace std;
 
typedef   long long int ll;
typedef unsigned long long int sll;
typedef  double ld;
#define A 1000000007ll
#define B 998244353ll
#define C 1000000000000000000ll
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define pb push_back
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define ve vector
#define br break
#define PI 3.14159265358979323

int main() 
{
    FAST;
    ll s,w;
    cin>>s>>w;
    if(s>w)
        cout<<"safe";
    else
        cout<<"unsafe";
    return 0;
}

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

int main() {
	int N, K;
	cin >> N >> K;
	int x[110];
	int c = 0;
	for (int i = 1; i < N+1; ++i) cin >> x[i];

	int res = 0;
	for (int i = 0;i < N+1;i++) {
		if (i > 0) {
			int a, b;
			a = x[i];
			b = K - x[i];
			if (a >= b) {
				c += 2 * (K - x[i]);
			}
			else {
				c += 2 * x[i];
			}

		}

	}
	cout << c << endl;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main () {
  int n, k, q;
  cin >> n >> k >> q;
  int A[q];
  int score[n] = {0};
  for (int i = 0; i < q; i++) {
    cin >> A[i];
    score[A[i]-1]++;
  }
  for (int i = 0; i < n; i++) {
    int score2 = k - (q - score[i]);
    if (score2 < 1) {
      cout<<"No"<<endl;
    } else {
      cout<<"Yes"<<endl;
    }
  }
  
  return 0;
}


Measured memory_bytes: 1408
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;


const int MAX=100;



int main()
{
    int N,L;
    string S[MAX];
    
    cin >> N >> L ;
    
    for(int i=0; i<N ; i++)
    {
        cin >> S[i];
    }
    
    sort(S,S+N);
    string res="";
    
    for(int i=0; i<N ; i++)
    {
        res+=S[i];
    }
    cout <<  res << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < (int)b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

ll gcd(ll x, ll y) {
    if (x < y) swap(x, y);
    while(y > 0) {
        ll tmp = x % y;
        x = y;
        y = tmp;
    }
    return x;
}

map<ll, ll> factorize(ll n) {
    map<ll, ll> ret;
    for (ll i = 2; i * i <= n; i++) {
        while (n % i == 0) {
            ret[i]++;
            n /= i;
        }
    }
    if (n != 1) ret[n]++;
    return ret;
}

int main() {
    ll a, b;
    cin >> a >> b;
    ll g = gcd(a, b);
    auto mp = factorize(g);
    cout << mp.size() + 1 << endl;
    return 0;
}


Measured memory_bytes: 256
//84104971101048411497 - Can you guess what does this mean?
using namespace std;
#include <bits/stdc++.h>
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i, r, l) for(int i = (r); i >= (l); --i)
#define fto(i, l, r) for(int i = (l); i <= (r); ++i)
#define forit(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define forrit(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define ll long long
#define maxN 200005

template <class T>
T min(T a, T b, T c) {
    return min(a, min(b, c));
}

template <class T>
T max(T a, T b, T c) {
    return max(a, max(b, c));
}

int n;
string s;

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

    int ans = 1;
    fto(i, 1, n-1) {
        if (s[i] != s[i-1]) ++ans;
    }

    cout << ans-1;

    return 0;
}


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

int main() {
  int sx, sy, tx, ty, H, W;
  cin >> sx >> sy >> tx >> ty;
  W=tx-sx;
  H=ty-sy;
  for(int i=0 ; i<H ; i++)
    cout << "U";
  for(int i=0 ; i<W ; i++)
    cout << "R";
  for(int i=0 ; i<H ; i++)
    cout << "D";
  for(int i=0 ; i<W+1 ; i++)
    cout << "L";
  for(int i=0 ; i<H+1 ; i++)
    cout << "U";
  for(int i=0 ; i<W+1 ; i++)
    cout << "R";
  cout << "DR";
  for(int i=0 ; i<H+1 ; i++)
    cout << "D";
  for(int i=0 ; i<W+1 ; i++)
    cout << "L";
  cout << "U" << endl;
}

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

int main(){
    int n,k,ans;
    string s,t;
    cin >> s >> t;
    vector<int> a(n);
    if(s.at(0)==t.at(0))ans++;
    if(s.at(1)==t.at(1))ans++;
    if(s.at(2)==t.at(2))ans++;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var S string
	var num int
	fmt.Scan(&S)
	
	for i := 0; i < len(S); i++ {
		if S[i] == '+' {
			num++
		} else if S[i] == '-' {
			num--
		}
	}
	fmt.Println(num)
}

Measured memory_bytes: 512
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author tatsumack
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(12)

using namespace std;

typedef pair<int, int> P;

class CHAndV {
public:
    void solve(std::istream& cin, std::ostream& cout) {
        int H, W, K;
        cin >> H >> W >> K;
        vector<vector<char>> c(H, vector<char>(W));
        REP(i, H) REP(j, W) cin >> c[i][j];

        int res = 0;
        REP(si, 1 << H) {
            REP(sj, 1 << W) {
                int num = 0;
                REP(i, H) {
                    REP(j, W) {
                        if ((si >> i) & 1) continue;
                        if ((sj >> j) & 1) continue;
                        if (c[i][j] == '#') num++;
                    }
                }
                if (num == K) res++;
            }
        }
        cout << res << endl;
    }
};


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    std::istream& in(std::cin);
    std::ostream& out(std::cout);

    CHAndV solver;
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 3580
#ifdef __APPLE__
#include <iostream>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <set>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <iomanip>
#include <cmath>
#include <ctgmath>
#include <math.h>
#else
#include <bits/stdc++.h>
#endif

using namespace std;
#define io ios_base::sync_with_stdio(false), cin.tie(NULL)
#define GFOR(i,a,n) for (i=a;i<n;i++)
#define FOR(i,a,n) for (int i=a;i<n;i++)
#define RFOR(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define tc(t) for (int tc=1; tc<=t; tc++)
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<long long int> VLL;
typedef vector<pair<int, int> > VPI;
typedef long long ll;
typedef pair<int,int> PII;
typedef pair<ll, ll> PLL;
mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll modInverse (ll a) {ll p = mod - 2; return powmod(a, p);}
// head

int main() {
    io;
    int h1, h2, m1, m2, k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    cout << h2*60 + m2 - h1*60 - m1 - k << "\n";
}



Measured memory_bytes: 3664