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

using namespace std;



int main(){
    
    int N,K,Q;
    cin >> N >> K >> Q;
    
    vector<int> ss(N, 0);
    
    
    for (int i = 0; i < Q; i++) {
        int a;
        cin >> a;
        
        ss[a-1] += 1;
    }
    
    
    for (int i = 0; i < N; i++) {
        if (K - Q + ss[i] > 0) {
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }
    
    
    
}


Measured memory_bytes: 1024
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include<math.h>
#include<bitset>
using namespace std;

int memo[50] = { 0 };
int fib(int n) {
	if (n == 0 || n == 1)return 1;
	else if (memo[n - 1] != 0 && memo[n - 2] != 0) {}
	else if (memo[n - 1] != 0)memo[n - 2] = fib(n - 2);
	else {
		memo[n - 1] = fib(n - 1); memo[n - 2] = fib(n - 2);
	}
	return memo[n - 1] + memo[n - 2];
}

int main() {
	int n; cin >> n;
	cout << fib(n) << endl;
}


Measured memory_bytes: 3080
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<int,int> P;
 
const int INF = 1e9;
const int mod = 1e9+7;
const double EPS = 1e-10;
const double PI = acos(-1.0);

int main()
{
    int n;
    cin >> n;
    double ans = 0;
    for(int i = 0; i < n; i++){
        double x;
        string u;
        cin >> x >> u;
        if(u[0] == 'J') ans += x;
        else ans += x*380000;
    }
    cout << fixed << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define sz(x) int(x.size())
using ll = long long;
using P = pair<int,int>;
const ll LLINF = numeric_limits<long long>::max();
const int mod = 1000000007;
const int INF = 1001001001;

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

    sort(a.begin(),a.end());
    
    ll ans1 = a[0];
    ll ans2 = ans1; 
    for(int i=1;i<N;i++){
        ans1 *= a[i];
        
        if( ans1 < ans2 || ans1 > 1000000000000000000){
            cout << "-1";
            return 0;
        }
        ans2 = ans1;
    }

    
    
    cout << ans1;

    return 0;
}

Measured memory_bytes: 4052
n = int(input())

if n >= 1 and n < 10:
  print(n)
elif n >= 10 and n < 100:
  print(9)
elif n >= 100 and n < 1000:
  print(n - 90)
elif n >= 1000 and n < 10000:
  print(909)
elif n >= 10000 and n < 100000:
  print(n - 9090)
elif n == 100000:
  print(90909)

Measured memory_bytes: 3060
if __name__ == '__main__':
    H, W = map(int, input().split())
    S = [[None for _ in range(W+2)] for _ in range(H+2)]
    for h in range(H):
        S[h+1] = [None] + list(map(str, input())) + [None]
    flag = True
    for h in range(H+2):
        for w in range(W+2):
            if S[h][w] == '#':
                if '#' not in [S[h-1][w], S[h][w-1], S[h+1][w], S[h][w+1]]:
                    flag = False
    if flag:
        print('Yes')
    else:
        print('No')
                               

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>
#include <climits>
#include <set>
#include <map>
#include <stack>
#define ll long long
using namespace std;

int main()
{
    ll n,ans=0;
    cin >> n;
    vector<ll> a(n);
    ll left = 0,right = 0;
    for (ll i = 0; i < n;i++){
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    while(right<n){
        if(a[right]==a[left]){
            
            right++;            
        }
        else{
            if(a[left]<=right-left){
                ans += right - left-a[left];
                //cout << "ans" << ans << endl;
                left = right;
            }
            else if(a[left]>right-left){
                ans += right-left;
                //cout << "ans" << ans << endl;
                left = right;
            }
        }
    }
    if(a[left]<=right-left){
        ans += right - left - a[left];
        //cout << "ans" << ans << endl;
    }
    else if (a[left] > right - left)
    {
        ans += right-left;
        //cout << "ans" << ans << endl;
    }

    cout << ans << endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>
#include <math.h>
#include <string>
#include <algorithm>
#include <ctype.h>
#include <vector>
#include <numeric>
#include <map>
#include <queue>
#include <deque>
#include <bitset>
using namespace std;

#define ll long long int
#define rep(i, a, n) for (int i = a; i < n; i++)
#define INF 1e9
#define LINF 1e17
#define MOD (int)(1e9 + 7)
#define pi 3.141592653589
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vii vector<vector<int>>
#define vll vector<ll>
#define vllll vector<vector<ll>>
#define ALL(a) (a).begin(), (a).end()
#define sort_v(a) sort(a.begin(), a.end())
#define fi first
#define se second

void print(bool c)
{
    if (c)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

void Print(bool c)
{
    if (c)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
}

ll gcdll(ll a, ll b)
{
    while (1)
    {
        if (a < b)
            swap(a, b);
        if (b == 0)
            break;
        a %= b;
    }
    return a;
}

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

bool cmp(const pii &a, const pii &b)
{
    if (a.second != b.second)
        return a.second < b.second;
    return a.first < b.first;
}

int nine(int x, int d)
{
    int cnt = 0;
    while (1)
    {
        if (x < d)
            return cnt;
        cnt++;
        x /= d;
    }
}

int main()
{
    string s;
    int k;
    cin >> s >> k;
    rep(i, 0, k)
    {
        if (s[i] != '1')
        {
            cout << s[i] << endl;
            return 0;
        }
    }
    cout << 1 << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main () {
  int s, a, ans = 0, flag = 0;
  cin >> s;
  vector<int> data;
  data.push_back(s);
  a = s;
  while (true) {
      if (a % 2 == 1) {
          a = 3 * a + 1; 
      } else {
          a = a / 2;
      }
      data.push_back(a);
      for (int i = 0; i < (data.size() - 1); i++) {
          if (data.at(i) == a){
                flag = 1;
                ans = data.size();
                break;
            }
        }
        if (flag == 1) break; 
  }
    cout << ans << endl;
    return 0;
}


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

int main() {
	int n;cin>>n;
  	int count=1;
  	int k=1;
	for(int i=0;i<8;i++){
    	if(k*2>n){
        	cout<<k<<endl;
          	return 0;
        }else{
        	k=k*2;
          	count++;
        }
    }

}


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

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

    int a[N];
    int c[3] = {0};
    int S[3] = {0};
    for (int i=0; i<N; ++i)
    {
        cin >> a[i];
        c[a[i]-1]++;
        S[a[i]-1]++;
    }
    S[1] += S[2];
    S[0] += S[1];

//     cout << "S" << S[0] << ' ' << S[1] << ' ' << S[2] << endl;
//     cout << "c" << c[0] << ' ' << c[1] << ' ' << c[2] << endl;

    vector<vector<vector<double>>> dp(S[0]+1, vector<vector<double>>(S[1]+1, vector<double>(S[2]+1, 0.)));
    for (int C=1; C<=S[0]; ++C)
    for (int k=0; k<=S[2]; ++k)
    for (int j=0; j<=S[1] &&   j+k <= C; ++j)
    for (int i=0; i<=S[0] && i+j+k <= C; ++i)
    {
        if (i+j+k != C) continue;

        double nume[3] = {0};
        int deno = 0;
        double tmp[3] = {0};

        // search for i,j,k
        auto within = [S](int i, int j, int k) { return !(i<0||j<0||k<0||S[0]<i||S[1]<j||S[2]<k); };
        if (within(i-1,j,k))
        {
            nume[0] = i; deno += i; tmp[0] = dp[i-1][j][k];
        }
        if (within(i+1,j-1,k))
        {
            nume[1] = j; deno += j; tmp[1] = dp[i+1][j-1][k];
        }
        if (within(i,j+1,k-1))
        {
            nume[2] = k; deno += k; tmp[2] = dp[i][j+1][k-1];
        }

        dp[i][j][k] = static_cast<double>(N)/C;
//         cout << "(" << i << " " << j << " " << k << "): " << dp[i][j][k] << endl;
        dp[i][j][k] += (nume[0]*tmp[0] + nume[1]*tmp[1] + nume[2]*tmp[2]) / deno;
//         cout << "(" << i << " " << j << " " << k << "): " << dp[i][j][k] << endl;
    }

    cout.setf(ios::fixed);
    cout.precision(12);
    cout << dp[c[0]][c[1]][c[2]] << endl;
}


Measured memory_bytes: 216960
import Control.Monad
import Data.Array

main :: IO ()
main = do
  n <- readLn :: IO Int
  as <- replicateM n readLn :: IO [Int]
  let as' = listArray (0, n) $ map (\l -> l - 1) as
  print $ solve n as'

solve :: Int -> Array Int Int -> Int
solve n as = go 0 0
  where
    go m c
      | c == 1 = m
      | m > n = -1
      | otherwise =
          let next = as ! c in
            go (m+1) next


Measured memory_bytes: 31100
using System;

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

        var ta = Console.ReadLine().Split(' ');
        var t = int.Parse(ta[0]);
        var a = int.Parse(ta[1]);

        var s = Console.ReadLine().Split(' ');
        var h = new int[n];
        for (int i = 0; i < n; i++)
        {
            h[i] = int.Parse(s[i]);
        }

        var min = double.MaxValue;
        var min_i = 0;
        for (int i = 0; i < n; i++)
        {
            var m = Math.Abs(a - (t - h[i] * 0.006));
            if (m < min)
            {
                min = m;
                min_i = i;
            }
        }
        Console.WriteLine(min_i + 1);
    }
}

Measured memory_bytes: 11164
A=int(input())
B=int(input())
C=int(input())
X=int(input())
c=0 # 場合の数、これからインクリメント

for a in range(0,min(A+1,X//500+1)): # 500円玉
    resa=X-500*a # 100円玉、50円玉で払うべき金額

    for b in range(0,min(B+1,resa//100+1)): # 100円玉
        resb=resa-100*b # 50円玉で払うべき金額

        if resb/50<=C: # 残りを50円玉で払える場合OK
            # print("a, b, resb = ",a,b,resb)
            c+=1

print(c)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std ;
int main () {
	long long n , m , h=0 , res=0 ;
	cin>>n>>m;
	h=m/2;
	if(n>=h)
	res=h;
	else if(n<h)
	res=n+(h-n)/2;
	cout<<res<<"\n";
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
using ll = int64_t;

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

    vector<ll> s(N);
    for (ll i = 0; i < N; i++) {
        s[i] = i + 1 - b[i];
        if (s[i] < 0) {
            cout << -1 << endl;
            return 0;
        }
    }

    vector<ll> ans;
    for (ll slide = 0; slide < N; slide++) {
        bool add = false;
        for (ll i = N - 1; i >= 0; i--) {
            if (s[i] == slide) {
                ans.insert(ans.begin(), b[i]);
                for (ll j = i + 1; j < N; j++) {
                    s[j]--;
                }
                add = true;
                s[i] = -1;
                break;
            }
        }
        if (add) {
            slide--;
        }
    }

    for (auto e : ans) {
        cout << e << endl;
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
typedef long long ll;
const int Max = 1e6 + 7;
int lst[Max];

int main()
{
	int n, m;
	cin >> n >> m;
	while (m--)
	{
		int a, b;
		cin >> a >> b;
		lst[a]++;
		lst[b]++;
	}
	for (int i = 1; i <= n; i++)cout << lst[i] << endl;
}

Measured memory_bytes: 3112
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,sse3,sse4,popcnt,abm,mmx")

//#include<bits/stdc++.h>
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>

#define _USE_MATH_DEFINES
#define ll long long
#define ins Not Needed Thing
#define ull unsigned long long
#define ld long double
#define Accepted 0
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define sz(x) (int)(x.size())
#define all(x) x.begin(),x.end()
#define F first
#define S second
#define SORRY FUL Accepted 
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0)
#define Toktama Kazakhstan 

using namespace std;

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 3e5 + 123;                                          
const int PRI = 555557;
const int pri = 997;

int tests = 1;

string s;
int k;

int dp[333][333][333];
bool u[333][333][333];

int calc (int l, int r, int k) {
	if (l > r) return 0;
	if (l == r)
		return 1;
	if (u[l][r][k])
		return dp[l][r][k];

	u[l][r][k] = 1;
	int res = 0;

	if (s[l] != s[r] && k > 0)
		res = max(res, calc(l + 1, r - 1, k - 1) + 2);
   	
	if(s[l] == s[r])
		res = max(res, calc(l + 1, r - 1, k) + 2);

	res = max(res, calc(l + 1, r, k));
	res = max(res, calc(l, r - 1, k));
	
	return dp[l][r][k] = res;
}

inline void Solve () {
	//easy
	cin >> s >> k;
	cout << calc(0, s.size() - 1, k);
}

int main () {
	SpeedForce;
//	freopen(".in", "r", stdin);
//	freopen(".out", "w", stdout);	
	// cin >> tests;
	while(tests --) {
		Solve ();
		// Ee Zadrot
	}

	return Accepted; 
}

Measured memory_bytes: 163968
#include <stdio.h>
#define len 1000001

typedef struct process {
  char name[11];
  int time;
} P;

P origin[len];
int head, tail;

void push(P x) {
  origin[tail] = x;
  tail = (tail + 1) % len;
}

P pop() {
  P x = origin[head];
  head = (head + 1) % len;
  return x;
}

int ismin(int a, int b) {
  return a < b ? a : b;
}

int main() {
  int sum = 0, ptime;
  int n, q;
  int i;
  P quene;

  scanf("%d %d", &n, &q);

  for (i = 0; i < n; i++) {
    scanf("%s %d", origin[i].name, &origin[i].time);
  }

  head = 0;
  tail = n;

  while (head != tail) {
    quene = pop();
    ptime = ismin(q, quene.time);
    quene.time -= ptime;
    sum += ptime;
    if (quene.time > 0) {
      push(quene);
    } else {
      printf("%s %d\n", quene.name, sum);
    }
  }

  return 0;
}



Measured memory_bytes: 4688
#include <bits/stdc++.h>
#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long; using pint = pair<int, int>; using pll = pair<ll, ll>;
const long long MOD = 1000000007;

pll div2(ll H, ll W){
    ll S1 = H * (W / 2), S2 = H * (W - W / 2);
    ll T1 = (H / 2) * W, T2 = (H - H / 2) * W;
    if(abs(S1 - S2) < abs(T1 - T2)) return pll(S1, S2);
    else return pll(T1, T2);
}

ll div3(ll H, ll W){
    ll S1 = H * (W / 3), S2 = div2(H, W - W / 3).first, S3 = div2(H, W - W / 3).second;
    ll T1 = H * (W / 3 + 1), T2 = div2(H, W - W / 3 - 1).first, T3 = div2(H, W - W / 3 - 1).second;
    return min(max(S1, max(S2, S3)) - min(S1, min(S2, S3)), max(T1, max(T2, T3)) - min(T1, min(T2, T3)));
}

signed main(){
    ll H, W;
    cin >> H >> W;
    PRINT(min(div3(H, W), div3(W, H)));
    return 0;
}

Measured memory_bytes: 3520
S = input()
x = len(S)
y = 15 - x
z = ""
point = 0
for i in range(x):
  z = S[i]
  if (z == "o"):
    point += 1
  else:
    point += 0
    
y = y + point
if (y >= 8):
  print("YES")
else:
  print("NO")

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

using namespace std;

typedef long long ll;

const ll MD = 1e9 + 7;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n, ans = 1, sum = 0;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        int it;
        cin >> it;
        sum += it;
    }
    for (int i = 0; i < n / 2; i++)
        ans = (ans << 1) % MD;
    if (n % 2)
        cout << ((sum == 2LL * (n / 2LL) * ((n / 2LL) + 1LL)) ? ans : 0) << "\n";
    else
        cout << ((sum == 2LL * (n / 2LL) * (n / 2LL)) ? ans : 0) << "\n";
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
#define int ll
#define rep(i, n) for (int i = 0; i < n; i++)
#define loop(i, s, n) for (int i = s; i < n; i++)
#define erep(e, v) for (auto &&e : v)
#define all(in) in.begin(), in.end()
#define MP make_pair
#define INF (sizeof(int) == 4 ? (int) 1e9 : (int) 1e18)
#define EPS 0.0000000001
using namespace std;
template <class T, class S> auto cmin(T &a, const S &b) {
    return (a > b ? a = b, true : false);
}
template <class T, class S> auto cmax(T &a, const S &b) {
    return (a < b ? a = b, true : false);
}
template <typename Head, typename Value>
auto vectors(const Head &head, const Value &v) {
    return vector<Value>(head, v);
}
template <typename Head, typename... Tail> auto vectors(Head x, Tail... tail) {
    auto inner = vectors(tail...);
    return vector<decltype(inner)>(x, inner);
}
template <class T> void join(T a) {
    for (auto itr : a) {
        if (itr != *a.begin()) cout << " ";
        cout << itr;
    }
}
using ld   = long double;
using pii  = pair<int, int>;
using piii = pair<int, pii>;
int W, H;
int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0};
bool valid(int x, int y) { return (0 <= x && x < W) && (0 <= y && y < H); }
main() {
    int n, m;
    while (cin >> n >> m, n + m) {
        map<int, int> mp;
        rep(i, n) {
            int d, v;
            cin >> d >> v;
            cmax(mp[d], v);
        }
        int ans = 0;
        for (auto itr : mp) ans += itr.second;
        cout << ans << endl;
    }
}


Measured memory_bytes: 3092
#include <bits/stdc++.h>
#define ll long long
#define arena ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
 
ll mod=1e9+7;

ll power(ll a,ll b)
{
    if(b==0)
    return 1;
    
    ll x=0;
    if(b%2==0)
    {
        x=power(a,b/2)%mod;
        return ((x%mod)*(x%mod))%mod;
    }
    else
    {
        x=power(a,b-1)%mod;
        return ((a%mod)*(x%mod))%mod;
    }
}
 
int main()
{
    arena
    ll n,k;
    cin>>n>>k;
    ll dp[k+1];
    for(ll i=k;i>=1;i--)
    {
        dp[i]=power(k/i,n)%mod;
        for(ll j=2*i;j<=k;j=j+i)
        {
            dp[i]=dp[i]-dp[j];
        }
    }
    
    //cout<<
    
    ll sum=0;
    for(ll i=1;i<=k;i++)
    {
        sum=(sum%mod+(dp[i]%mod*i%mod)%mod)%mod;
    }
    cout<<sum;
}

Measured memory_bytes: 4416
code1 = int(input())
code2 = int(input())
if code1==1 and code2==2:
  print(3)
elif code1==1 and code2==3:
  print(2)
elif code1==2 and code2==3:
  print(1)
elif code1==2 and code2==1:
  print(3)
elif code1==3 and code2==1:
  print(2)
else:
  print(1)

Measured memory_bytes: 3060
using System;
using System.IO;
using System.Linq;
using System.Text;

namespace Contest
{
    class Program
    {
        private Scanner sc;

        public void Solve()
        {
            sc = new Scanner();
            int N = sc.NextInt();
            int cnt = 0;
            for (int i = 1; i <= N; i++)
            {
                if ((i.ToString().Length % 2 == 1))
                {
                    cnt++;
                }
            }
            Console.WriteLine(cnt);
        }

        static void Main() => new Program().Solve();
    }
}

class Scanner
{
    public Scanner()
    {
        _stream = new StreamReader(Console.OpenStandardInput());
        _pos = 0;
        _line = new string[0];
        _separator = ' ';
    }
    private readonly char _separator;
    private readonly StreamReader _stream;
    private int _pos;
    private string[] _line;
    #region get a element
    public string Next()
    {
        if (_pos >= _line.Length)
        {
            _line = _stream.ReadLine().Split(_separator);
            _pos = 0;
        }
        return _line[_pos++];
    }
    public int NextInt()
    {
        return int.Parse(Next());
    }
    public long NextLong()
    {
        return long.Parse(Next());
    }
    public double NextDouble()
    {
        return double.Parse(Next());
    }
    #endregion
    #region convert array
    private int[] ToIntArray(string[] array)
    {
        var result = new int[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = int.Parse(array[i]);
        }

        return result;
    }
    private long[] ToLongArray(string[] array)
    {
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = long.Parse(array[i]);
        }

        return result;
    }
    private double[] ToDoubleArray(string[] array)
    {
        var result = new double[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = double.Parse(array[i]);
        }

        return result;
    }
    #endregion
    #region get array
    public string[] Array()
    {
        if (_pos >= _line.Length)
            _line = _stream.ReadLine().Split(_separator);
        _pos = _line.Length;
        return _line;
    }
    public int[] IntArray()
    {
        return ToIntArray(Array());
    }
    public long[] LongArray()
    {
        return ToLongArray(Array());
    }
    public double[] DoubleArray()
    {
        return ToDoubleArray(Array());
    }
    #endregion
}

Measured memory_bytes: 13140
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


import numpy as np

a,b,h,m = mi()
h2 = h + m/60

ax = a * np.cos(h2/12 * 2*np.pi)
ay = a * np.sin(h2/12 * 2*np.pi)
bx = b * np.cos(m/60 * 2*np.pi)
by = b * np.sin(m/60 * 2*np.pi)


dist = np.sqrt((ax-bx)**2 + (ay-by)**2)

print(dist)

Measured memory_bytes: 27196
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;
using namespace std;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int main(){
   
    
    int x;
    cin>>x;
    cout<<(x<1200?"ABC":"ARC")<<endl;
    
    
return 0;
}

Measured memory_bytes: 256
# AOJ 0642
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0642

N = input()
A = list(map(int, input().split()))

A = [1] + A
for i in range(1, len(A)):
    if A[i] == 1:
        c = A[i - 1] + 1
    else:
        c = 1
    pre = A[i]
    A[i] = c

print(max(A))


Measured memory_bytes: 5600
import collections
n=int(input())
a=[]
for i in range(0,n):
    a.append(input())
d=collections.Counter(a)
flag=0
for i in a:
    if d[i]>1:
        flag=1
        break
if flag==1:
    print("No")
else:
    l=len(a[0])
    s=a[0]
    t=s[l-1]
    flag=0
    for i in range(1,n):
        s=a[i]
        m=s[0]
        if m!=t:
            flag=1
            break
        s=a[i]
        l=len(s)
        t=s[l-1]
    if flag==1:
        print("No")
    else:
        print("Yes")

Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5+5;
int main()
{
    int n;
    int num[maxn];
    int vis[maxn];
    //memset(vis,0,sizeof(vis));
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>num[i];
        if(i==0) vis[i]=1;
        else{
            if(num[i]<=num[i-1]) vis[i]=vis[i-1]+1;
            else vis[i]=1;
        }
    }
    int maxx=0;
    for(int i=0;i<n;i++) maxx=max(maxx,vis[i]);
    cout<<maxx-1<<endl;
    return 0;
}


Measured memory_bytes: 1024
import sys
def input(): return sys.stdin.readline().strip()

i  = lambda: int(input())
li = lambda: list(map(int, input().split()))

N = i()
A = li()

D = [0] * N

D[0] = sum(A)
for i in range(1, N , 2):
    D[0] -= A[i] * 2

for i in range(1, N):
    D[i] = A[i-1] * 2 - D[i-1]

print(' '.join(map(str, D)))

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

const int MX = 2000;
bool ab[20000], ac[20000], bc[20000]; // where not match

bool match(char c1, char c2) {
  return (c1 == '?' || c2 == '?' || c1 == c2);
}

int main () {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  
  string a, b, c;
  cin >> a >> b >> c;
  int la = a.length();
  int lb = b.length();
  int lc = c.length();
  
  rep(i, la) rep(j, lb) if(!match(a[i], b[j])) ab[10000-j+i] = true;
  rep(i, la) rep(j, lc) if(!match(a[i], c[j])) ac[10000-j+i] = true;
  rep(i, lb) rep(j, lc) if(!match(b[i], c[j])) bc[10000-j+i] = true;
  
  int ans = 3*MX;
  for (int i=-2*MX; i<=2*MX; ++i) {
    for (int j=-2*MX; j<=2*MX; ++j) {
      if (!ab[i+10000] && !ac[j+10000] && !bc[10000-i+j]) {
        int L = min(0, min(i, j));
        int R = max(la, max(lb+i, lc+j));
        ans = min(ans, R-L);
      }
    }
  }
  cout << ans << endl;
}

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

typedef unsigned long long ull;

#define REP(i, N) for (int i = 0; i < N; i++)
#define ANS(a) cout << a << endl;
#define SORT(V) sort(V.begin(), V.end())
#define RSORT(V) sort(V.rbegin(), V.rend())

#define DBG(V) for (auto v : V) cout << v << " "; cout << endl

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

  bool flg = true;
  REP(i, s.size() - 1) {
    if (s[i] == s[i+1]) { flg = false; break; }
  }

  if (flg) {
    ANS("Good");
  } else {
    ANS("Bad");
  }
  
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#define debug(x...) cout << #x << " = "; _print(x)
typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll;
#define rep(i,a,b) for (int i = (a); i < (b); ++i)
#define per(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define all(x) begin(x), end(x)
#define mp make_pair 
#define pb push_back
#define ff first
#define ss second
#define fast ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL) 
const int mod = 1e9 + 7, mxn = 1e5 + 1;

int solve(){
	int a, b;
	cin>> a>> b;
	cout<< a*b<< "\n";
	return 0;	
}
 
int main()
{
    fast;
    int t = 1;
    //cin>> t;
    while(t--){  
        solve();
    }
    return 0;
}
//v.clear(), vis.clear(); vis.resize(n + 1, 0), v.resize(n + 1);
 
/*  inv[1] = 1; // inv is ll
    for(int i=2; i<=mxn; ++i)
        inv[i]=mod-mod/i*inv[mod%i]%mod;*/
        
// lower bound   >=  
// upper bound   >
// vector<int>().swap(vec); //free memory from vec


Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int i = (int)(n); i >= 0; i--)
#define all(v) v.begin(),v.end()
typedef long long ll;

int main(){
    int N;
    cin >> N;
    vector<int> D1(N);
    vector<int> D2(N);
    rep(i,N){
        cin >> D1[i] >> D2[i];
    }
    int max_len = 0;
    int now_len = 0;
    rep(i,N){
        if (D1[i] == D2[i]){
            now_len++;
            max_len = max(max_len, now_len);
        }
        else{
            now_len = 0;
        }
    }
    if (max_len >= 3) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#include <array>
using namespace std;
typedef long long ll;
#define tr(container, it) \
	for (auto it = container.begin(); it != container.end(); it++)
#define scontains(c,x) ((c).find(x) != (c).end())   //O(log n) 
#define contains(c,x) (find((c).begin(),(c).end(),x) != (c).end()) //O(n)
#define Ichar(_x) char _x;scanf("%c",&_x);
#define Iint(_x) int _x;scanf("%d",&_x); 
#define Ill(_x)  ll _x;scanf("%lld",&_x);
#define inc(a,b,x)(x)>a && (x)<b	
#define incE(a,b,x)(x)>=a && (x)<=b	
//freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);

int main()
{
	Ill(a);
	Ill(b);
	if(a*b==0)std::cout << (b>a ? b - a : a - b + 1);
	else if(a*b<0)std::cout << abs(abs(a)-abs(b))+1;
	else 
	{
		std::cout << (b>a?b-a:a-b+2);
	}

	



}











Measured memory_bytes: 256
package main

import "fmt"
var N, M int
var u, w, v int
var dp, arr, pref []int
var DP, mat [][]int
var vis, dist []int
var bit []int
const (
	MaxInt = 1<<31 - 1
	MinInt = -MaxInt - 1
	MOD = int(1e9) + 7
)

func buildMatrix(mat *[][]int, size int) {
	for i := range *mat {
		(*mat)[i] = make([]int, size)
	}
}

func addSelf(a *int, b int) {
	*a += b
}

func subSelf(a *int, b int) {
	*a -= b
}

func addSelfMOD(a *int, b int) {
	addSelf(a, b)
	if *a > MOD {
		*a -= MOD
	}
}

func subSelfMOD(a *int, b int) {
	subSelf(a, b)
	if *a < 0 {
		*a += MOD
	}
}

func max(a, b int) int {
	if a > b { return a }
	return b
}

func min(a, b int) int {
	if a < b { return a }
	return b
}

func abs(a int) int {
	if a < 0 { return -a }
	return a
}

func count(i int) int {
	i++
	s := 0
	for i > 0 {
		s += bit[i]
		i-= i&(-i)
	}
	return s
}

func cnt(i, k int) int {
	return count(k) - count(i-1)
}

func update(i, v int) {
	i++
	for i < len(bit) {
		bit[i] += v
		i += i&(-i)
	}
}

func main() {
	_,e := fmt.Scanf("%d", &N)
	if e != nil { return }
	DP = make([][]int, N)
	buildMatrix(&DP, N)
	bit = make([]int, N+1)
	arr = make([]int, N)
	for i:=0; i<N; i++ {
		_,e = fmt.Scanf("%d", &arr[i])
		if e != nil { return }
	}
	for i:= range arr {
		DP[i][i] = arr[i]
		update(i, arr[i])
	}

	for cl:=2; cl<N+1; cl++ {
		for i:=0; i<N-cl+1; i++ {
			j := i+cl-1
			if i == j {
				DP[i][j] = arr[i]
			} else if j == i+1 {
				DP[i][j] = arr[i]+arr[j]
			} else {
				for k:=i; k<j; k++ {
					tmp := DP[i][k] + DP[k+1][j] + cnt(i,j)
					if k+1 == j { tmp -= arr[j] }
					if k == i { tmp -= arr[i] }
					//fmt.Println(i,k,j,ls/2, rs/2)
					if DP[i][j] == 0 {
						DP[i][j] = tmp
					}
					DP[i][j] = min(DP[i][j], tmp)
				}
			}
		}
	}
	fmt.Println(DP[0][N-1])
}


Measured memory_bytes: 3232
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print(*a, **dict(file=sys.stderr, **kw))

N, M = inm()


def solve():
    xs = []
    for i in range(M):
        a, b = inm()
        xs.append((a, True, i))
        xs.append((b, False, i))
    xs.sort()
    cut = 0
    opn = set()
    closed = set()
    for x, start, i in xs:
        if start:
            opn.add(i)
        elif i in closed:
            closed.remove(i)
        else:
            cut += 1
            opn.remove(i)
            closed |= opn
            opn = set()
    assert not opn
    assert not closed
    return cut


print(solve())


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

using namespace std;

const int mod = 1e9 + 7;

const int N = 1e5 + 10;

int f[N];

int n;

int qmi(int a,int b)
{
    int res = 1;

    while(b)
    {
        if(b & 1) res = 1ll * res * a % mod;
        a = 1ll * a * a % mod;
        b >>= 1;
    }

    return res;
}

int dp(int k)
{
    if(k <= 1) return k;

    if(f[k] != -1) return f[k];

    f[k] = qmi(k,n);

    for(int l=2,r;l<=k;l=r+1)
    {
        if(k / l == 0) break;
        r = min(k,k / (k / l));
        f[k] = ((f[k] - 1ll * (r - l + 1) * dp(k / l) % mod) % mod + mod) % mod;
    }

    return f[k];
}

int main(){

    //freopen("data.in","r",stdin);
    //freopen("data.out","w",stdout);
    
    int k;

    cin >> n >> k;

    memset(f,-1,sizeof f);

    int res = 0;

    for(int i=1;i<=k;i++)
        res = (res + 1ll * i * dp(k / i) % mod) % mod;

    cout << res << endl;


    return 0;
}

Measured memory_bytes: 4020
N = int(input())
before_t = before_x = before_y = 0
for _ in range(N):
  t, x, y = map(int, input().split())
  distance = abs(x-before_x) + abs(y-before_y)
  diff_t = t-before_t
  if diff_t < distance or (diff_t-distance)%2 != 0:
    print('No')
    exit()
  before_t = t
  before_x = x
  before_y = y
print('Yes')


Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			int A = scan.nextInt();
			int B = scan.nextInt();
			
			System.out.println(lcm((long)A,(long)B));
			
			
			
			
		}
		
		
	}
	
	
	private  static long lcm(long A,long B) {//最小公倍数
		return A*B/gcd(A,B);
	}
	
	private static long gcd(long A,long B){//最大公約数
		return B==0?A:gcd (B,A%B);
	}
	
		

}


Measured memory_bytes: 21972
X = int(input())
import math
array = [2]
for i in range(3, 10**10, 2):
    if X == 2:
        break
    sosu = True
    for n in range(len(array)):
        if array[n] > math.sqrt(i):
            break
        if i % array[n] == 0:
            # これまで取得した素数で割る
            sosu = False
            break
    if sosu:
        array.append(i)
        if i >= X:
            break
print(array[-1])

Measured memory_bytes: 3368
# coding: utf-8
# Your code here!
import math

N,M=map(int,input().split())

if abs(N-M)==0:
    print(math.factorial(N)*math.factorial(M)*2%(10**9+7))
elif abs(N-M)==1:
    print(math.factorial(N)*math.factorial(M)%(10**9+7))
else:
    print(0)
    


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

struct work{
	int a;
	int b;
};

bool operator<(const work& left, const work& right){
	return left.b < right.b;
}

int main(){
	int n,i;
	cin >> n;
	vector<work> w(n);
	for(i=0;i<n;i++){
		cin >> w[i].a >> w[i].b;
	}

	int time=0;
	string ans="Yes";
	sort(w.begin(),w.end());
	for(i=0;i<n;i++){
		time+=w[i].a;
		if(time>w[i].b){
			ans="No";
			break;
		}
	}

	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1792
#coding:utf-8
a,b = (int(i) for i in input().split())
s = input()

a = int(a)
b = int(b)

if(len(s)==(a+b+1) and s[0:a].isdigit() and s[a]=="-" and s[a+1:].isdigit()):
    print("Yes")
else:
    print("No")


Measured memory_bytes: 2940
import math
N = int(input())
A = list(map(int, input().split()))

A.sort(reverse=True)
# print(A)

ans = A[0]
for i in range(1, N-1):
    # print(math.ceil(i/2), A[math.ceil(i/2)])
    ans += A[math.ceil(i/2)]
print(ans)


Measured memory_bytes: 104476
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<vector<P>> Graph;


int main(){

  int n;
  cin >> n;
  
  int a[100010],b[100010],c[100010];
  
  REP(i,n) cin >> a[i];
  REP(i,n) cin >> b[i];
  REP(i,n) cin >> c[i];
  
  sort(a,a+n);
  sort(b,b+n);
  sort(c,c+n);
  
  ll set[n] = {};
  
  int j = 0;
  REP(i,n){
    while(a[j] < b[i] && j < n){
      set[i]++;
      j++;
    }
    set[i+1] = set[i];
  }
  
  int k = 0; ll ans[n] = {};
  REP(i,n){
    while(b[k] < c[i] && k < n){
      ans[i] += set[k];
      k++;
    }
    ans[i+1] = ans[i];
  }
  
  ll sum = 0;
  REP(i,n) sum += ans[i];

  cout << sum << endl;
  
 return 0;
}

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
#define debug(x) cerr << #x << ": " << x << endl
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2017/10/04  Problem: Nagoya_univ_contest_17_a  / Link:   ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */

LL N,R,M;
int msvisit[10];
LL ans = 0LL;
LL d[202][202];
LL dp[1 <<10 ][10];
int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);

	cin >> N>>M>>R;
	FOR(i, 0, R) {
		cin >> msvisit[i];
		msvisit[i]--;
	}
	FOR(i, 0, 202) {
		FOR(j, 0, 202) {
			d[i][j] = LINF;
		}
		d[i][i] = 0;
	}
	FOR(i, 0, M) {
		int a, b, c;
		cin >> a >> b >> c;
		a--;
		b--;
		d[a][b] = min(d[a][b], (LL)c);
		d[b][a] = min(d[b][a], (LL)c);
	}
	FOR(k, 0, N) {
		FOR(i, 0, N) {
			FOR(j, 0, N) {
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
			}
		}
	}
	FOR(i, 0, (1 << R))FOR(j, 0, 10)dp[i][j] = LINF;
	FOR(i, 0, R) {
		dp[(1<<i)][i] = 0;
	}
	//うめる
	FOR(i, 0, (1 << R)) {
		FOR(j, 0, R) {
			if(i&(1<<j))
			FOR(k, 0, R) {
				if (i&(1 << k))continue;
				dp[i | (1 << k)][k] = min(dp[i | (1 << k)][k],dp[i][j]+d[msvisit[j]][msvisit[k]] );
			}
		}
	}


	ans = LINF;
	FOR(i, 0, R) {
		ans = min(ans, dp[(1<<R)-1][i]);
	}

	cout << ans << "\n";

	return 0;
}

Measured memory_bytes: 640
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

var (
	readString func() string
	stdout     *bufio.Writer
)

func init() {
	readString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = readInt()
	}
	return b
}

func readLengthAndSlice() []int {
	n := readInt()
	return readIntSlice(n)
}

func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(stdout, f, args...)
}

func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(stdout, args...)
}

func minInt(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func minUint(a, b uint) uint {
	if a < b {
		return a
	}
	return b
}

func minInt64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func minUint64(a, b uint64) uint64 {
	if a < b {
		return a
	}
	return b
}

func maxInt(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func maxUint(a, b uint) uint {
	if a < b {
		return b
	}
	return a
}
func maxInt64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}

func maxUint64(a, b uint64) uint64 {
	if a < b {
		return b
	}
	return a
}

func absInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func absInt64(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

// readString() string
// readInt() int
// readIntSlice(n int) []int
// readLengthAndSlice() []int
func main() {
	defer stdout.Flush()
	rot := func(s string) string {
		b := []byte(s)
		b1 := append(b[1:], b[0])
		return string(b1)
	}

	s := readString()
	t := readString()
	if len(s) != len(t) {
		println("No")
		return
	}
	for i, u := 0, s; i <= len(s); i, u = i+1, rot(u) {
		if u == t {
			println("Yes")
			return
		}
	}
	println("No")
}


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

int main(){
    ll N; cin >> N;
    string S; cin >> S;
    set<char> st1; 
    set<string> st2, st3;
    rep(i, 0, N){
        for(auto e: st2){
            string str(1, S[i]);
            if(st3.find(e + str) ==  st3.end()){
                st3.insert((e + str));
            }
        }
        for(auto e: st1){
            string str1(1, e);
            string str2(1, S[i]);
            if(st2.find(str1 + str2) ==  st2.end()){
                st2.insert((str1 + str2));
            }
        }

        if(st1.find(S[i]) == st1.end()){
            st1.insert(S[i]);
        }
    }
    /* for(auto e: st3){
        cout << e << endl;
    } */
    int ans = st3.size();
    cout << ans << endl;
}

Measured memory_bytes: 384
#include<cstdio>
#include<algorithm>

using namespace std;
int x,y,s;

int solve(){
  int res=0;
  for(int i=1;i<s;i++){
    for(int j=1;j<s;j++){
    if(i*(100+x)/100+j*(100+x)/100==s){
      res=max(i*(100+y)/100+j*(100+y)/100,res);
    }

    }
  }
  return res;
}



int main(){
  while(1){
    scanf("%d%d%d",&x,&y,&s);
    if(x==0) break;
    printf("%d\n",solve());
  }
  return 0;
}

Measured memory_bytes: 1028
//INCLUDE
//------------------------------------------
#include <iostream>
#include <functional>
#include <algorithm>
#include <math.h>
#include <iomanip>
#include <string>
#include <cstring>
#include <vector>
//DEFINE
//------------------------------------------
#define ll long long
#define ALLv(a)  (a).begin(),(a).end()
#define ALL(a,n)  (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vector<string>
//CONST
//------------------------------------------
#define INF 1010000000000000017LL
#define MOD 1000000007LL
#define EPS 1e-12
#define PI 3.14159265358979323846
//REPEAT
//------------------------------------------
#define FOR(i,m,n) for(ll(i)=(m);(i)<(n);(i)++)
#define REP(i,n) for(ll(i)=0;(i)<(n);(i)++)
#define REPS(i,x) for(ll(i)=1;(i)<=(x);(i)++)
#define RREP(i,x) for(ll(i)=(x)-1;(i)>=0;(i)--)
#define RREPS(i,x) for(ll(i)=(x);(i)>0;(i)--)
#define WREP(i,in,j,jn) REP(i,in)REP(j,jn)
using namespace std;
//-------------------------------------------

int main(void){
  int A[3][3];
  REP(i,3)REP(j,3){cin>>A[i][j];}
  int N;cin>>N;
  bool flag[3][3];REP(i,3)REP(j,3){flag[i][j]=false;}
  int tmp;
  REP(n,N){
    cin>>tmp;
    REP(i,3)REP(j,3){
      if(A[i][j]==tmp)
	flag[i][j]=true;
    }
  }
  bool ret=false;
  if(flag[0][0]){
    if(flag[0][1]&&flag[0][2])ret=true;
    if(flag[1][0]&&flag[2][0])ret=true;
    if(flag[1][1]&&flag[2][2])ret=true;
  }
  if(flag[0][1]){
    if(flag[1][1]&&flag[2][1])ret=true;
  }
  if(flag[0][2]){
    if(flag[1][2]&&flag[2][2])ret=true;
    if(flag[1][1]&&flag[2][0])ret=true;
  }
  if(flag[1][0]){
    if(flag[1][1]&&flag[1][2])ret=true;
  }
  if(flag[2][0]){
    if(flag[2][1]&&flag[2][2])ret=true;
  }
  cout<<(ret?"Yes":"No");
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(a)-1;i>=b;i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define printV(_v) for(auto _x:_v){cout<<_x<<" ";}cout<<endl
#define printVS(vs) for(auto x : vs){cout << x << endl;}
#define printVV(_vv) for(auto _v:_vv){for(auto _x:_v){cout<<_x<<" ";}cout<<endl;}
#define printP(p) cout << p.first << " " << p.second << endl
#define printVP(vp) for(auto p : vp) printP(p);

typedef long long ll;
typedef pair<int, int> Pii;
typedef tuple<int, int, int> TUPLE;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<Pii> vp;
const int inf = 1e9;
const int mod = 1e9 + 7;

typedef complex<double> P;
typedef vector<P> G;
#define here(g, i) g[i]
#define next(g, i) g[(i + 1) % g.size()]
#define prev(g, i) g[(i - 1 + g.size()) % g.size()]
const double EPS = 1e-8;
const double INF = 1e12;
const double PI = acos(-1);

P centroidG(G g) {
    int n = g.size();
    double x = 0, y = 0;
    rep(i, n) {
        x += g[i].real();
        y += g[i].imag();
    }
    return P(x / n, y / n);
}

// rot p around q by theta (counter-clockwise)
P rotP(P p, P q, double theta) {
    p -= q;
    double x = p.real(), y = p.imag();
    p = P(x * cos(theta) - y * sin(theta), x * sin(theta) + y * cos(theta));
    p += q;
    return p;
}

G rotG(G g, P p, double theta) {
    rep(i, g.size()) {
        g[i] = rotP(g[i], p, theta);
    }
    return g;
}

P readP() {
    double x, y;
    cin >> x >> y;
    return P(x, y);
}

G readG() {
    int n;
    cin >> n;
    G g(n);
    rep(i, n) g[i] = readP();
    return g;
}

bool EQ(double a, double b) {
    return abs(a - b) < EPS;
}

bool EqP(P p, P q) {
    return EQ(p.real(), q.real()) && EQ(p.imag(), q.imag());
}

bool EqG(G g, G h) {
    if (g.size() != h.size()) return false;
    rep(k, g.size()) {
        bool flag = true;
        rep(i, g.size()) {
            if (!EqP(g[(i + k) % g.size()], h[i])) {
                flag = false;
                break;
            }
        }
        if (flag) {
            return true;
        }
    }
    return false;
}

// void printG(G g) {
//     rep(i, g.size()) {
//         cout << g[i].real() << " " << g[i].imag() << endl;
//     }
//     cout << endl;
// }

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

    G g = readG();
    P c = centroidG(g);
    // cout << fixed << setprecision(10) << c.real() << " " << c.imag() << endl;
    // cout << endl;

    G h = rotG(g, c, PI);
    // printG(g);
    // printG(h);

    if (EqG(g, h)) {
        cout << fixed << setprecision(10) << c.real() << " " << c.imag() << endl;
    } else {
        cout << "NA" << endl;
    }
}

Measured memory_bytes: 3680
/*
Author: CNYALI_LK
LANG: C++
PROG: d.cpp
*/
#include<bits/stdc++.h>
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define all(x) x.begin(),x.end()
using namespace std;
const double eps=1e-8;
const double PI=acos(-1.0);
typedef long long ll;
template<class T>void chkmin(T &a,T b){a=a<b?a:b;}
template<class T>void chkmax(T &a,T b){a=a>b?a:b;}
template<class T>T sqr(T a){return a*a;}
template<class T>T mmin(T a,T b){return a<b?a:b;}
template<class T>T mmax(T a,T b){return a>b?a:b;}
template<class T>T aabs(T a){return a<0?-a:a;}
#define min mmin
#define max mmax
#define abs aabs
int a[1024][1024];
int n,m,d;
int chk(int x,int y){
	for(int i=0;i<=d;++i){
		if(x-i>=1&&y-d+i>=1&&a[x-i][y-d+i]==a[x][y])return 0;
		if(x-i>=1&&y+d-i<=m&&a[x-i][y+d-i]==a[x][y])return 0;
		if(x+i<=n&&y-d+i>=1&&a[x+i][y-d+i]==a[x][y])return 0;
		if(x+i<=n&&y+d-i<=m&&a[x+i][y+d-i]==a[x][y])return 0;
	}
	return 1;
}
void out(){
	for(int i=1;i<=n;++i){
		for(int j=1;j<=m;++j){
			printf("%d",a[i][j]);
		}
		putchar('\n');
	}
	exit(0);
}
void dfs(int x,int y){
	for(a[x][y]=0;a[x][y]<4;++a[x][y]){
		if(chk(x,y)){
			if(y-m)dfs(x,y+1);
			else if(x-n)dfs(x+1,1);
			else out();
		}
	}
}
int main(){
#ifdef cnyali_lk
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
#endif
	scanf("%d%d%d",&n,&m,&d);
	for(int i=1;i<=n;++i){
		for(int j=1;j<=m;++j){
			int t=0;
			if(((i+j)/d)&1)++t;
			if((((n+1-i+j)/d)&1))t+=2;
			switch(t){
				case 0:putchar('R');break;
				case 1:putchar('Y');break;
				case 2:putchar('G');break;
				case 3:putchar('B');break;
			}
		}
		putchar('\n');
	}
	return 0;
}



Measured memory_bytes: 512