akhauriyash/Code-Regression huggingface dataset:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

index = 0
ans = 10**10
for i in range(N):
  tmp = T - 0.006*H[i]
  if ans > abs(A-tmp):
    ans = abs(A-tmp)
    index = i+1
print(index)


Measured memory_bytes: 9192
#include<set> 
#include<map> 
#include<ctime> 
#include<cmath> 
#include<cstdio> 
#include<queue> 
#include<vector> 
#include<cstring> 
#include<climits> 
#include<iostream> 
#include<algorithm> 
using namespace std; 
int read(){ 
    int f=1,x=0; 
    char c=getchar(); 
    while(c<'0'||'9'<c){if(c=='-')f=-1;c=getchar();} 
    while('0'<=c&&c<='9') x=x*10+c-'0',c=getchar(); 
    return f*x; 
} 
#define LL long long
#define MOD 100003 
#define MAXN 100000 
#define INF 0x3f3f3f3f
int main(){
	bool flag=0;
	LL a,b,n=read(),s1=0,s2=INF;
	for(int i=1;i<=n;i++)
	{
		a=read(),b=read(),s1+=a;
		if(a>b&&s2>b) s2=b;
		if(a!=b) flag=1;
	}
	printf("%lld\n",flag?(s1-s2):0);
    return 0; 
}

Measured memory_bytes: 256
n, k = map(int, input().split())
p_list = list(map(lambda x: (float(x) + 1) / 2, input().split()))

S_i = [0]
for i in range(n):
    S_i.append(S_i[i] + p_list[i])    

# print(S_i)
result_max = 0
for j in range(k, n+1):
    cad_max = S_i[j] - S_i[j-k]
    result_max = max(cad_max, result_max)

print(result_max)

Measured memory_bytes: 23588
#include <stdio.h>

int main(void)
{
	int N,num,h,l,array[10000],bangou=0;
	scanf("%d",&N);
	for(num=1;num<=N;num++){
		if(num%3==0||num%10==3||(num/10)%10==3||(num/100)%10==3||(num/1000)%10==3)
			{
			array[bangou]=num;
			bangou++;
			}
		}
	for(l=0;l<bangou;l++){
		printf(" %d",array[l]);
	}
	printf("\n");
	return 0;
}

Measured memory_bytes: 624
#include <iostream>
#include <vector>
int main(){
 int n;
 std::cin >> n; 
 std::vector<int> v(n);
 int sqsum, simsum;
 sqsum = 0;simsum = 0;
 for (size_t i=0; i < n; i++){
   std::cin >> v[i];
   sqsum += v[i] * v[i];
   simsum += v[i];
 }
 double m = simsum * 1.0 / n;
 int c, f;
 c = sqsum - 2 * simsum * ceil(m) + n * ceil(m) * ceil(m);
 f = sqsum - 2 * simsum * floor(m) + n * floor(m) * floor(m);
 std::cout << (c < f ? c : f) << std::endl;
}

Measured memory_bytes: 3208
#include <bits/stdc++.h>
using namespace std;
string rokuketa(int x) {
    string ans = "";
    int keta = 0;
    int y = x;
    while(y>0) {
        y /= 10;
        keta++;
    }
    for(int i = 0; i < 6-keta; i++) {
        ans += '0';
    }
    ans += to_string(x);
    return ans;
}
int main() {
    int N, M;
    cin >> N >> M;
    vector<tuple <int, int, int>> PYi(M);
    for(int i = 0; i < M; i++) {
        int P, Y;
        cin >> P >> Y;
        PYi.at(i) = make_tuple(P, Y, i);
    }
    sort(PYi.begin(), PYi.end());
    
    int now_P = -1, now_rank = 1;
    vector<pair<int, string>> i_ID(M);
    for(int i = 0; i < M; i++) {
        if(get<0>(PYi.at(i)) == now_P) {
            i_ID.at(i) = make_pair(get<2>(PYi.at(i)), rokuketa(now_P) + rokuketa(now_rank));
            now_rank++;
        }
        else {
            now_P = get<0>(PYi.at(i));
            now_rank = 1;
            i_ID.at(i) = make_pair(get<2>(PYi.at(i)), rokuketa(now_P) + rokuketa(now_rank));
            now_rank++;
        }
    }
    sort(i_ID.begin(), i_ID.end());
    for(int i = 0; i < M; i++) {
        cout << i_ID.at(i).second << endl;
    }
}


Measured memory_bytes: 10496
using System;

class Program
{
    static void Main(string[] args)
    {
        var ab = Console.ReadLine().Split();
        var a = int.Parse(ab[0]);
        var b = int.Parse(ab[1]);

        var ans = Math.Max(Math.Max(
            a + a - 1,
            b + b - 1),
            a + b);

        Console.WriteLine(ans);
    }
}


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

static const int MAX_H = 50;
static const int MAX_W = 50;

int H, W;
int grid[MAX_H][MAX_W + 1];
bool reached[MAX_H][MAX_W];

#define OCTAS
#ifdef OCTAS
static const int dh[]{-1, -1, -1, 0, 0, +1, +1, +1};
static const int dw[]{-1, 0, +1, -1, +1, -1, 0, +1};
#else
static const int dh[]{-1, 0, 0, +1};
static const int dw[]{0, -1, +1, 0};
#endif

void initialize() {
//  memset(reached, 0, sizeof(reached));
  fill_n(reached[0], MAX_H * MAX_W, false);
}

void dfs(int h, int w) {
  reached[h][w] = true;

  for (int i{}; i < sizeof(dh) / sizeof(int); ++i) {
    int nh = h + dh[i];
    if (nh < 0 || nh >= H)
      continue;
    int nw = w + dw[i];
    if (nw < 0 || nw >= W)
      continue;
    if (grid[nh][nw] == 0 || reached[nh][nw])
      continue;
    dfs(nh, nw);
  }
}

int main() {
  while (true) {
    scanf("%d%d", &W, &H);
    if (H == 0 && W == 0)
      break;
    initialize();
    for (int h = 0; h < H; ++h) {
      for (int w = 0; w < W; ++w) {
        scanf("%d", &grid[h][w]);
      }
    }

    int ans{};
    for (int h = 0; h < H; ++h) {
      for (int w = 0; w < W; ++w) {
        if (grid[h][w] == 1 && !reached[h][w]) {
          dfs(h, w);
          ++ans;
        }
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}



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

int n;
map<string, int> cnt;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> n;
	int mx = 0;
	for(int i = 0; i < n; i++){
		string str;
		cin >> str;
		cnt[str]++;
		mx = max(mx, cnt[str]);
	}
	for(auto i : cnt)
		if(i.second == mx) cout << i.first << "\n";
	return 0;
}

Measured memory_bytes: 23808
import std.stdio, std.string, std.conv, std.range;
import std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, std.random, core.bitop;

enum inf = 1_001_001_001;
enum infl = 1_001_001_001_001_001_001L;
enum mod = 1_000_000_007L;


void main() {
    int N;
    scan(N);
    auto a = readln.split.to!(int[]);
    auto c = new int[](4);
    foreach (ai ; a) {
        c[ai]++;
    }

    auto dp = new double[][][](N + 1, N + 1, N + 1);
    fillAll(dp, -1);

    double rec(int i, int j, int k) {
        if (i + j + k == 0) {
            return 0;
        }
        if (dp[i][j][k] != -1) {
            return dp[i][j][k];
        }
        dp[i][j][k] = 0;
        if (i > 0) dp[i][j][k] += i * rec(i - 1, j, k) / (i + j + k);
        if (j > 0) dp[i][j][k] += j * rec(i + 1, j - 1, k) / (i + j + k);
        if (k > 0) dp[i][j][k] += k * rec(i, j + 1, k - 1) / (i + j + k);
        dp[i][j][k] += 1.0 * N / (i + j + k);
        return dp[i][j][k];
    }

    auto ans = rec(c[1], c[2], c[3]);
    writefln("%.12f", ans);
}







void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}

void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

bool chmin(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x > arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}

bool chmax(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x < arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}


Measured memory_bytes: 367612
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i,n,k) for(int i=(n);i<(k);i++)
#define ALL(a)  (a).begin(),(a).end()
ll ans=0;
void Main(){
    int a;
    cin >> a;
    ans = a + a*a + a*a*a;
    cout << ans << endl;
}
int main(){
    Main();
    /*
    東方風神録は神が出てくるので当然神ゲー
    */
    return 0;
}

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

#ifdef DEBUG
#define debug(...) fprintf(stderr, __VA_ARGS__)
#else
#define debug(...)
#endif

#ifdef __WIN32
#define LLFORMAT "I64"
#define Rand() ((rand() << 15) + rand())
#else
#define LLFORMAT "ll"
#define Rand() (rand())
#endif

using namespace std;

int main(int argc, char *argv[]) {
	long long a, b, c, k;
	cin >> a >> b >> c >> k;
	if(k % 2 == 0) {
		cout << a - b;
	}
	else {
		cout << b - a;
	}
	return 0;
}



Measured memory_bytes: 256
n = int(input())
p = list(map(float, input().split()))

dp = [[0 for _ in range(n+1)] for _ in range(n+1)]

dp[0][0] = 1.0 


for i in range(n):
    for j in range(n):
        dp[i+1][j+1] += dp[i][j] * p[i]
        dp[i+1][j] += dp[i][j] * (1-p[i])


ans = 1.0
for i in range((n+1)//2):
    ans -= dp[n][i]

print(ans)


Measured memory_bytes: 257800
N, M = map(int, input().split())
pos = []
mini = [float('inf') for _ in range(N)]
ret = [-1 for _ in range(N)]
for _ in range(N):
    pos.append((tuple(map(int, input().split()))))

for j in range(M):
    c, d = map(int, input().split())
    for i, s in enumerate(pos):
        diff = abs(c - s[0]) + abs(d - s[1])
        if mini[i] > diff:
            ret[i] = j + 1
            mini[i] = diff

for r in ret:
    print(r)


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

const int maxn = 2e5 + 5;
const int mod = 1e9 + 7;
 
int add(int x, int y) {
    int res = (x + y) % mod;
    res += mod;
    res %= mod;
    return res;
}
int mul(int x, int y) {
    return x * y % mod;
}
int pw(int a, int b) {
    int res = 1;
    while(b) {
    	if(b % 2)
    		res = (res * a) % mod;
    	a  = (a * a) % mod;
    	b /= 2;
	}
	return res;
}

int f[maxn];

int c(int n, int k) {
    int ret = f[n];
    ret = mul(ret, pw(f[k], mod - 2));
    ret = mul(ret, pw(f[n - k], mod - 2));
    return ret;
}
int32_t main() {
    int n, m, k;
    cin >> n >> m >> k;
    f[0] = 1;
    for (int i = 1; i < maxn; ++i)
        f[i] = mul(f[i - 1], i);
    int mm = c(n * m - 2, k - 2);
    int sum = 0, tmp = 0, cc = 0;
    for (int i = 1; i <= n; i++) {
        int x = add(mul(cc, i), -tmp);
        cc++;
        tmp = add(tmp, i);
        x = mul(x, mul(m, m));
        sum = add(sum, x);
    }
    cc = 0, tmp = 0;
    for (int i = 1; i <= m; i++) {
        int x = add(mul(cc, i), -tmp);
        cc++;
        tmp = add(tmp, i);
        x = mul(x, mul(n, n));
        sum = add(sum, x);
    }
    sum = mul(sum, mm);
    cout << sum;
    return 0;
}

Measured memory_bytes: 1792
#include<iostream>
using namespace std;
int n,m,c,flag=0;
int b[20],a[20][20];
void Solve(){
    cin>>n>>m>>c;
    for(int i=0;i<m;i++) cin>>b[i];
    int x=n;
    while(x){
        for(int i=0;i<m;i++) cin>>a[n-x][i];
        x--;
    }
    for(int i=0;i<n;i++){
        int sum=0;
        for(int j=0;j<m;j++){
            sum+=a[i][j]*b[j];
        }
        sum=sum+c;
        //cout<<sum<<endl;       
        if(sum>0) flag++;   
    }
    cout<<flag<<endl;
}
int main(){
    Solve();
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
int main(){
    int n, a, b;
    std::cin >> n;
    std::cin >> a >> b;
    int count = 0;

    for(int j = 1; j <= n; j++) {
        int sum_digits = 0;
        int num = j;

        for(int i = 0; i < 5; i++) {
            sum_digits += (num % 10);
            num /= 10;
        }

        if(a <= sum_digits && sum_digits <= b) count+= j;
    }
    std::cout << count << std::endl;

    return 0;
}

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

#define mid(l,r) ((l+r)/2)

using namespace std;

const int N = 2e5+7;
const int inf=1e9+7;

int h[N], b[N];
int n;
 

#define ll long long

void maxx(ll& a, ll b) {
    a = max(a, b);
}

int main() {
    cin >> n;
    
    int base = 1;
    while(base <= n) {
        base *= 2;
    }
   
    vector<ll> tree(2 * base);
       
    for(int i = 0; i < n; i++) {
        cin >> h[i];
    }
    
    for(int i = 0; i < n; i++) {
        cin >> b[i];
    }
    
    vector<ll> dp(n + 1);
  
    for(int flower = 0; flower < n; flower++) {
        int x = h[flower] + base;
        ll curr = 0;
        while(x > 1) {
            if(x % 2 == 1) {
                maxx(curr, tree[x-1]);
            }
            x /= 2;
        }
        dp[h[flower]] = curr + b[flower];
        
        for(int i = base + h[flower]; i >= 1; i /= 2) {
            maxx(tree[i], dp[h[flower]]);
        }
    }
    
    ll ans = 0;
    
    for(int i = 0; i <= n; i++){
        maxx(ans, dp[i]);
    }
    
    cout << ans << endl;
}


Measured memory_bytes: 7424
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	if((a==b && a!=c && b!=c)||(a==c && a!=b && c!=b)||(c==b && c!=a && b!=a))
	cout<<"Yes\n";
	else
	cout<<"No\n";
	return 0;
	
}

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

int main() {
    int h, a, count = 0;
    cin >> h >> a;
    while(h > 0){
        h -= a;
        count++;
    }
    cout << count << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define sz 100002
#define pb push_back
#define ff first
#define ss second
#define ll long long
#define P push
#define PQ priority_queue<double, vector<double>, greater<double> >q

#define VEC(n) ll int x; vector<ll int>v;for(int i=0;i<n;i++){cin>>x;v.pb(x);}
#define TEST() int test;cin>>test; while(test--)
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
//Upper_bound   auto x=upper_bound(v[a].begin(),v[a].end(),les);les=*x; if(x==v[a].end())break;
//ll int LCM(ll int a,ll int b) { ll int gcd=__gcd(a,b);ll int lcm=a*b/gcd;return lcm;}
//ll int bigmod(ll int b, ll int p, ll int m){if(p==0)return 1;if(p%2!=0) return b%m*fun(b,p-1,m)%m;if(p%2==0){ ll int res=fun(b,p/2,m);return (res%m*res%m)%m;}}
//void seive() { prime[np++]=2;for(i=3; i<=sz; i+=2){if(mark[i]==0){ prime[np++]=i;for(j=i*i; j<=sz; j+=i) mark[j]=1; } }}
//string add(string s1,string s2) {string s;int j=s1.size()-1,c=0,m; for(int i=s2.size()-1; i>=0; i--) {if(j>=0)m=s2[i]-'0'+s1[j]-'0'+c;else m=s2[i]-'0'+c; if(m>9) { s+=m%10+'0';c=m/10; } else {  c=0;s+=m+'0'; }j--; } if(c!=0) {s+=c+'0'; }reverse(s.begin(),s.end());return s;}
//int pos;string mul(int n) {string s;for(int i=0; i<pos; i++) { s+="0"; }pos++;int c=0,m; for(int i=s1.size()-1; i>=0; i--) { m=(s1[i]-'0')*n+c;if(m>9) { s+=m%10+'0';c=m/10;} else { c=0; s+=m+'0';} }while(c!=0) { s+=c%10+'0';c=c/10;}    reverse(s.begin(),s.end());return s;}
ll int n,k,l=1,r=1000000005;
vector<ll int>v;
int BS(ll int m)
{
    ll int cnt=0;
    for(ll int i=0; i<n; i++)
    {
        cnt+=v[i]/m;
        if(v[i]%m==0)
            cnt--;
    }
    if(cnt>k)
        return 1;
    return 0;
}
int main()
{
    FAST();

        cin>>n>>k;
        ll int m;

        for(int i=0; i<n; i++)
        {
            cin>>m;
            v.pb(m);
        }

        while(l<=r)
        {
            m=(l+r)/2;
            if(BS(m))
                l=m+1;
            else
                r=m-1;

        }
        cout<<l<<endl;

}



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

int main (void){
	int i,j=0;
	char in[1010],n[1010];
	scanf("%s",n);
	while(1){
		scanf("%s",in);
		if(!strcmp(in,"END_OF_TEXT")){
			break;
		}
		for(i=0;i<strlen(in);i++){
			in[i]=tolower(in[i]);
		}
		if(!strcmp(n,in)){
			j++;
		}
	}
	printf("%d\n",j);
	return 0;
}

Measured memory_bytes: 552
#include <stdio.h>

int dp[50];

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

int main(){
  int n, i;
  for(i=0; i<50; i++) dp[i] = -1;

  scanf("%d", &n);
  printf("%d\n", fib(n));

  return 0;
}



Measured memory_bytes: 2100
// finish date: 2018/01/11
#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <map>
#include <climits>

#define bigmod 1000000007
using namespace std;

#define FOR(i, a, b) for(int i=a;i<b;i++)
#define rep(i, n)  FOR(i,0,n)
#define ll long long

int mul(int a, int b) {
    return (int) (((ll) (a % bigmod) * (b % bigmod)) % bigmod);
}

int factorial(int n) {
    int ans = 1;
    FOR(i, 1, n + 1) {
        ans = ans * i;
    }
    return ans;
}

int main() {
    int A, B;
    cin >> A >> B;
    cout << (A + B) % 24 << endl;


    return 0;
}


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

int main(void) {
  long long n, t;
  cin >> n >> t;
  vector<long long> ts(n);
  for (long long &t : ts) cin >> t;

  long long result = n * t;
  for (int i = 1; i < n; i++) {
    result -= max(0LL, t - ts[i] + ts[i - 1]);
  }

  cout << result << endl;
  return 0;
}

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

int main() {
	int n;
	cin >> n;
	n = n % 10;
	if (n == 2 || n == 4 || n == 5 || n == 7 || n == 9)cout << "hon" << endl;
	else if (n == 0 || n == 1 || n == 6 || n == 8)cout << "pon" << endl;
	else cout << "bon" << endl;
}

Measured memory_bytes: 3632
#include<stdio.h>
int main (void)
{
  char s[5];
  char a[1],b[1];
  int i=0,j=0;
  
  scanf("%s",s);
  
  if(s[0]==s[1]&&s[1]==s[2]&&s[2]==s[3])
    printf("No");
  else
  {
    if((s[0]==s[1]&&s[2]==s[3])||(s[0]==s[2])&&s[1]==s[3]||(s[0]==s[3]&&s[1]==s[2]))
    printf("Yes");
  else
    printf("No");
  }
  
  return 0;
  
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,a,b) for(int i=a;i<b;i++)
#define each(it,v) for(auto it : v)
#define mod 1000000007
#define all(v) (v).begin(),(v).end()
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define vpii vector<pair<int,int>>
#define vv vector<vector<int>>
using namespace std;

int n,l;

main()
{
    cin>>n>>l;

    vector<string> v;
    rep(i,n)
    {
        string s;
        cin>>s;
        v.push_back(s);
    }

    sort(all(v));

    each(it,v)cout<<it;
    cout<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <numeric>
#include <functional>
#include <string> 
#include <vector>
#include <bitset>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>

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

#define REP(i,n) for(int i = 0; i < int(n); i++)
#define REREP(i,n) for(int i = int(n - 1); i >= 0; i--)
#define FOR(i, m, n) for(int i = int(m);i < int(n);i++)
#define REFOR(i, m, n) for(int i = int(n - 1);i >= int(m);i--)
#define ALL(obj) (obj).begin(),(obj).end()
#define fi first 
#define se second

#define VI vector<int>
#define VVI vector<vector<int>>
#define VVVI vector<vector<vector<int>>>
#define VD vector<double>
#define VVD vector<vector<double>>
#define VVVD vector<vector<vector<double>>>
#define VL vector<ll>
#define VVL vector<vector<ll>>
#define VVVL vector<vector<vector<ll>>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define VVVB vector<vector<vector<bool>>>
#define VS vector<string>
#define VVS vector<vector<string>>
#define VVVS vector<vector<vector<string>>>

#define PII pair<int,int>
#define PDD pair<double,double>
#define PLL pair<ll,ll>
#define VPII vector<pair<int,int>>
#define VVPII vector<vector<pair<int,int>>>
#define VVVPII vector<vector<vector<pair<int,int>>>>
#define VPLL vector<pair<ll,ll>>
#define VVPLL vector<vector<pair<ll,ll>>>
#define VVVPLL vector<vector<vector<pair<ll,ll>>>>

const ll HMOD = (ll)1e9 + 7;
const ll LMOD = 998244353;
const ll HINF = (ll)1e18;
const ll LINF = (ll)1e9;
const long double PI = 3.1415926535897932384626433;
const long double EPS = 1e-10;


void YN(bool flag) {
	cout << ((flag) ? "YES" : "NO") << endl;
}

void Yn(bool flag) {
	cout << ((flag) ? "Yes" : "No") << endl;
}

void yn(bool flag) {
	cout << ((flag) ? "yes" : "no") << endl;
}

int main() {
	ll X, Y; cin >> X >> Y;
	cout << ((abs(X - Y) < 2) ? "Brown" : "Alice");
	return 0;
}



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

// macro
#define rep(i,n) for(i=0;i<n;i++)
#define ll long long
#define all(v) v.begin(), v.end()

// code starts
int main()
{
  int h,w,k;
  cin >> h >> w >> k;
  vector<vector<char>> c(h,vector<char>(w));
  int i,j,l,m;
  rep(i,h)rep(j,w) cin >> c[i][j];
  int ans = 0;
  rep(i,1<<h)
  {
    rep(j,1<<w)
    {
      vector<vector<char>> cp(h,vector<char>(w));
      cp = c;
      int cnt = 0;
      rep(l,h)rep(m,w)
      {
        if((i & (1<<l))||(j & (1<<m)))
        {
          cp[l][m] = '@';
        }
      }
      rep(l,h)rep(m,w)
      {
        if(cp[l][m] == '#')
        {
          cnt++;
        }
      }
      if(cnt == k)
      {
        ans++;
      }
    }
  }
  cout << ans << "\n";
}


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

int main() {
  int N, X;
  int L[110];
  cin >> N >> X;
  int bound = 0, ans = 1;

  for (int k = 0; k < N; k++) { cin >> L[k]; }

  for (int k = 0; k < N; k++) {
    bound += L[k];
    if (bound > X) {
      cout << ans << endl;
      return 0;
    }
    ans++;
  }

  cout << ans << endl;
}


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

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

typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//定数
#define INF 1000000000 //10^9:極めて大きい値,∞
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

int main(){
    int n;
    cin>>n;
    int ans=n%1000;
    if(ans!=0)ans=1000-ans;
    cout<<ans<<endl;
    return 0;
}

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

using namespace std;
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORR(i,a,b) for(int i=(a);i>(b);--i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a))
#define mp make_pair
#define All(a) (a).begin(), (a).end()
template <typename T=long long>
inline T IN(){T x; cin>>x; return(x);}
inline void CIN(){}
template <class Head,class... Tail>
inline void CIN(Head&& head,Tail&&... tail){
    cin>>head;
    CIN(move(tail)...);
}
#define CINT(...) int __VA_ARGS__;CIN(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CIN(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CIN(__VA_ARGS__)
#define Yes(a) cout<<(a?"Yes":"No")<<"\n"
#define YES(a) cout<<(a?"YES":"NO")<<"\n"
 
typedef long long ll;
typedef vector<int> V;
typedef vector<ll> VL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
typedef priority_queue<int> PQ;
typedef priority_queue<int,V,greater<int>> PQG;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int N;
vector<int> A;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin>>N;
	A.resize(N);
	REP(i,N) cin>>A[i];
	int r=0;
	ll sum=0,count=0;
	REP(l,N){
		while(r<N && (sum^A[r])==sum+A[r]){
			sum+=A[r++];
		}
		count+=r-l;
		if(l==r)  r++;
		sum-=A[l];
	}
	cout<<count<<"\n";
	return 0;
}

Measured memory_bytes: 1024
cut_pat::String->[[String]]
cut_pat [] = [[]]
cut_pat (x:xs) = [ ((x:(head y)):tail y) | y <- cut_pat xs , y/= []]++[ [x]:y | y <- cut_pat xs]

calc::[[String]]->Int
calc []=0
calc (x:xs) = let nums = map read x  in  (sum nums) + (calc xs)

main::IO()
main=do
  st<-getLine
  print  (calc(cut_pat st))


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

#define deb(x) cout << #x << "=" << x << endl
#define ll long long

const int mod = 1000000007;
const int N = 3e5, M = N;

void solve() {
	ll  n;
	ll input;
	cin >> n;
	vector<ll> a(n);
	vector<ll> b(n);
	vector<ll> c(n);

	for (int i = 0; i < n; i++)
	{
		cin >> a[i] >> b[i] >> c[i];
	}

	vector<ll> dp(3);
	dp[0] = a[0];
	dp[1] = b[0];
	dp[2] = c[0];
	for (int i = 1; i < n; i++)
	{
		vector<ll> newdp(3);
		newdp[0] = a[i] + max(dp[1], dp[2]);
		newdp[1] = b[i] + max(dp[0], dp[2]);
		newdp[2] = c[i] + max(dp[1], dp[0]);
		dp = newdp;
	}
	int ans = *max_element(dp.begin(), dp.end());
	cout << ans << endl;









}



int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	srand(chrono::high_resolution_clock::now().time_since_epoch().count());
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ll t = 1;
	// cin >> t;
	while (t--) {
		solve();
	}

	return 0;
}



Measured memory_bytes: 5564
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <math.h>

using namespace std;

int main(void){
    int n;
    cin >> n;
    double yen;
    string str;
    double res = 0.0;
    for(int i = 0; i < n; i++){
        cin >> yen >> str;
        if(str == "JPY"){
            res += yen;
        } else{
            double ex = yen * 380000;
            res += ex;
        }
    }

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
import math
n=int(input())
x=list(map(int,input().split(" ")))
y=list(map(int,input().split(" ")))

def minkowski(x,y,p):
    tmp=[math.fabs(x[i]-y[i])**p for i in range(len(x))]
    return sum(tmp)**(1/p)

ans=[minkowski(x,y,i) for i in range(1,4)]
ans.append(max([math.fabs(x[i]-y[i])for i in range(len(x))]))
for i in ans:
    print(i)


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

typedef long long ll;
#define repd(i,a,b) for (ll i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)

ll mod=1e9+7;

using namespace std;


ll inputValue(){
	ll a;
	cin >> a;
	return a;
};

void inputArray(int * p, ll a){
	rep(i, a){
		cin >> p[i];
	}
};

template<typename T>
void inputVector(vector<T>& p, ll a){
	rep(i, a){
		T input;
		cin >> input;
		p.emplace_back(input);
	}
}


template <typename T>
void output(T a) {
    cout << a << "\n";
}

int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
	// source code
    string s;
    cin >> s;
    vector<ll> m(s.length(),0);
    ll r=0;
    ll l=0;
    rep(i,s.length())
    {
        if(s[i]=='R')
        {
            r++;   
        }else{
            if(r>=2&&i>1){
                if(r%2==0){
                    m[i]+=r/2;
                    m[i-1]+=r/2;
                }else{
                    m[i]+=r/2;
                    m[i-1]+=r/2+1;
                }
            }else{
                m[i-1]+=r;
            }
            r=0;
        }
    }
    reverse(s.begin(),s.end());
    reverse(m.begin(),m.end());

    rep(i,s.length())
    {
        if(s[i]=='L')
        {
            l++;   
        }else{
            if(l>=2&&i>1){
                if(l%2==0){
                    m[i]+=l/2;
                    m[i-1]+=l/2;
                }else{
                    m[i]+=l/2;
                    m[i-1]+=l/2+1;
                }
            }else{
                m[i-1]+=l;
            }
            l=0;
        }
    }
    
    reverse(m.begin(),m.end());
    
    for(auto c : m){    
        cout << c << " ";
        
    }
    cout << endl;

	return 0;
}


Measured memory_bytes: 1488
#include<bits/stdc++.h>                                                                          
using namespace std;
int main()
{
  int N,M;
  cin >> N >> M;
  vector<string> A(N);
  vector<string> B(M);
  for(int i=0; i<N; i++){
    cin >> A.at(i);
  }
  for(int i=0; i<M; i++){
    cin >> B.at(i);
  }
  int check=0;
  for(int i=0; i<N-M+1; i++){
    for(int j=0; j<N-M+1; j++){
      for(int k=0; k<M; k++){
        for(int l=0; l<M; l++){
          if(A.at(i+k).at(j+l)==B.at(k).at(l)){
            check++;
          }
        }
      }
      if(check==M*M){
        cout << "Yes" << endl;
        return 0;
      }
      else{
        check=0;
      }
    }
  }
  cout << "No" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long s[200005];
set<long long>ss;
map<long long,int>m;
vector<long long>v;
int seg[800005];
void up(int st,int ed,int lv,int po)
{
    int md=(st+ed)/2;
    if(st>po || ed<po)
    return;
    if(st==po && ed==po)
    {
        seg[lv]++;
        return;
    }
    seg[lv]++;
    up(st,md,lv*2,po);
    up(md+1,ed,lv*2+1,po);
}
int sm(int st,int ed,int lv,int l,int r)
{
    int md=(st+ed)/2;
    if(st>r || ed<l)
    return 0;
    if(st>=l && ed<=r)
    return seg[lv];
    return sm(st,md,lv*2,l,r)+sm(md+1,ed,lv*2+1,l,r);
}
main()
{
	int t;
    long long req;
    scanf("%d%lld",&t,&req);
    for(int i = 1;i <= t;i++)
    {
        scanf("%lld",&s[i]);
        s[i]+=s[i-1]-req;
        ss.insert(s[i]);
    }
    int co=0;
    set<long long>::iterator sp;
    for(sp=ss.begin();sp!=ss.end();sp++)
    {
        m[*sp]=co;
        v.push_back(*sp);
        co++;
    }
    long long f=0;
    for(int i = 1;i <= t;i++)
    {
        if(s[i]>=0)
        f++;
        f+=sm(0,t,1,0,m[s[i]]);
        up(0,t,1,m[s[i]]);
    }
    printf("%lld",f);
}


Measured memory_bytes: 28400
{-# LANGUAGE BangPatterns #-}
import           Control.Monad
import           Control.Monad.ST
import           Control.Monad.State
import           Data.Array.IArray
import           Data.Array.ST
import           Data.Array.Unboxed    (UArray)
import qualified Data.Array.Unboxed    as U
import           Data.Bits
import           Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as BS
import           Data.Char
import           Data.Graph
import           Data.Int              (Int64)
import           Data.List
import           Data.Maybe
import           Data.Proxy
import qualified Data.Set              as S
import           Data.STRef
import           Data.Vector.Unboxed   (Vector)
import qualified Data.Vector.Unboxed   as V
import           Numeric

getAsInt :: IO [Int]
getAsInt =  unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine

getAsIntLine :: Int -> IO [[Int]]
getAsIntLine n = replicateM n getAsInt

getAsIntArray1Dr :: Int -> IO (UArray Int Int)
getAsIntArray1Dr n = U.listArray (1,n) <$> getAsInt

getAsIntVec1Dr :: IO (Vector Int)
getAsIntVec1Dr = V.fromList <$> getAsInt

getAsIntArray1Dc :: Int -> IO (UArray Int Int)
getAsIntArray1Dc n = U.listArray (1,n) . concat <$> getAsIntLine n

getAsIntVec1Dc :: Int -> IO (Vector Int)
getAsIntVec1Dc n = V.fromList . concat <$> getAsIntLine n

-- n: number of lines
-- m: number of values per a line
getAsIntArray2D :: Int -> Int -> IO (UArray (Int,Int) Int)
getAsIntArray2D n m = U.listArray ((1,1),(n,m)) . concat <$> getAsIntLine n

getAsString :: IO [String]
getAsString = map BS.unpack . BS.words <$> BS.getLine

getAsCharArray1DWithLength :: IO (Int, UArray Int Char)
getAsCharArray1DWithLength = BS.getLine >>= \cs ->
  let n = BS.length cs
      ary = (U.listArray (1,n) $ unfoldr BS.uncons cs) :: UArray Int Char
  in return (n, ary)

-- n: number of lines
-- m: number of chars per a line
getAsCharArray2D :: Int -> Int -> IO (UArray (Int,Int) Char)
getAsCharArray2D n m = U.listArray ((1,1),(n,m)) . unfoldr BS.uncons . BS.concat <$> replicateM n BS.getLine

main :: IO ()
main = do
  [n,x,y] <- getAsInt
  let ary = solve n x y
  forM_ [1..n-1] $ \i -> print $ ary U.! i

solve :: Int -> Int -> Int -> UArray Int Int
solve n x y = runSTUArray $ do
  cu <- newArray (1,n-1) 0
  forM_ [1..n-1] $ \i ->
    forM_ [i+1..n] $ \j -> let a = j - i
                               b = abs (x - i) + 1 + abs (j - y)
                               c = abs (y - i) + 1 + abs (j - x)
                               m = min a $ min b c
                           in readArray cu m >>= \t -> writeArray cu m (t + 1)
  return cu


Measured memory_bytes: 1020
# pdf解法（隣接行列でグラフを管理して、DFSで連結判定する）
def dfs(x):
    if visited[x]:
        return
    visited[x] = True
    for i in range(N):
        # xに繋がっている頂点をたどっていく
        if graph[x][i]:
            dfs(i)


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

edge = []
graph = [[False for _ in range(N)] for _ in range(N)]   # 隣接行列
visited = [False for _ in range(N)]

for i in range(M):
    a, b = map(int, input().split())
    edge.append((a, b))
    graph[a-1][b-1] = True
    graph[b-1][a-1] = True

ans = 0
for i, e in enumerate(edge):
    # 辺を取り除く
    graph[e[0]-1][e[1]-1] = False
    graph[e[1]-1][e[0]-1] = False

    # 初期化（全ての頂点を未訪問にする）
    for j in range(N):
        visited[j] = False

    # 任意の１つの頂点からDFS
    dfs(0)

    # 連結判定（訪問していない頂点がある＝非連結）
    bridge = False
    for j in range(N):
        if not visited[j]:
            bridge = True
    if bridge:
        ans += 1

    # 取り除いた辺を戻す
    graph[e[0]-1][e[1]-1] = True
    graph[e[1]-1][e[0]-1] = True

print(ans)


Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main(void){

    int n;
    int a, b, count = 0, bc = 0;

    cin >> n;

    vector<int> d(n);

    for(int i = 0;i < n;i++){
        cin >> d[i];
    }

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

    a = d[n/2 - 1];
    b = d[n/2];

    cout << b-a << endl;


    return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <numeric>
#include <cmath>
#include <cctype>
#include <unordered_map>

using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define FILL(a,x); REP(i,sizeof(a)){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define FILL2(a,n,m,x); REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define Liny "Yes\n"
#define Linn "No\n"
#define LINY "YES\n"
#define LINN "NO\n"

#define umap unordered_map
//cout << setfill('0') << right << setw(4) << 12; // "0012"
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
int __stoi(string s){ return atoi(s.c_str()); }
ll sum(ll a[],ll N){ return accumulate(a,a+N,0LL);}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a/gcd(a,b)*b;}

int main(){
  int N; cin>>N;
  umap<int,int> mp;
  for(int i=2;i<=N;++i){
    int temp = i;
    while(temp>1){
      for(int x=2;x<=temp;++x){
        if(temp%x==0){
          ++mp[x];
          temp /= x;
          break;
        }
      }
    }
  }
  int over74 = 0;
  int over24 = 0;
  int over14 = 0;
  int over4 = 0;
  int over2 = 0;
  for(int i=2;i<N;++i){
    if(mp[i]>=74){++over74;}
    if(mp[i]>=24){++over24;}
    if(mp[i]>=14){++over14;}
    if(mp[i]>=4){++over4;}
    if(mp[i]>=2){++over2;}
  }
  int ans = 0;
  ans += over74; // 75
  ans += over24*(over2-1); //25*3
  ans += over14*(over4-1); //15*5
  ans += over4*(over4-1)/2*(over2-2); //5*5*3
  cout << ans << "\n";
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>
#include<fstream>
#include<cstdio>
#include<deque>
#include<iomanip>
#include <numeric>

using namespace std;
#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);(i)--)
#define all(a) (a).begin(),(a).end()
#define reall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
const double pi = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef deque<ll> dll;
typedef pair<string, int> P;
#define mod 1e9 + 7;
ll gcd(ll x, ll y)
{
	ll r;
	while ((r = x % y) != 0)
	{
		x = y;
		y = r;
	}
	return y;
}
ll lcm(ll x, ll y)
{
	x /= gcd(x, y);
	y /= gcd(x, y);
	return (x * y);
}


int main()
{
	ios_base::sync_with_stdio(false);

	ll n, m, q, ans = 1;
	cin >> n;
	REP(i, 2, n) {
		ll ret = i;
		while (ret <= n) {
			ret *= i;
			if (ret <= n) ans = max(ans, ret);
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include<algorithm>
#include <math.h>
#include <string.h>
#include <map>
#define eps 1e-9
typedef long long int ll;
#define p1 3.1415926535898
using namespace std;
ll a[105];
ll sum;
ll mins=9999999999;
int main()
{
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
    }
    for(int i=1;i<=100;i++)
    {
        sum=0;
        for(int j=1;j<=n;j++)
        {
            sum+=(a[j]-i)*(a[j]-i);
        }
        mins=min(mins,sum);
    }
    cout<<mins;
    return 0;
}


Measured memory_bytes: 384
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef  unsigned long long int ull;
typedef pair<ll,ll> P;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
//const ll mod=998244353;
const ll mod=1000000007;
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
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 (a>b) { a=b; return 1; } return 0; }
class UF{
public:
	vector<int> par,num;
	int find(int v){
		return (par[v]==v)? v: (par[v]=find(par[v]));
	}
	explicit UF(int N):par(N),num(N,1){
		iota(all(par),0);
	}
	void unite(int u,int v){
		u=find(u),v=find(v);
		if(u==v)return;
		if(num[u]<num[v])swap(u,v);
		num[u]+=num[v];
		par[v]=u;
	}
	bool same(int u,int v){
		return find(u)==find(v);
	}
	bool ispar(int v){
		return v=find(v);
	}
	int size(int v){
		return num[find(v)];
	}
};
int main(){
int n,m,k;
cin>>n>>m>>k;
UF f(n),bl(n);
V<V<int>> block(n);
V<V<int>> fri(n);
V<P> dd(m);
for(int i=0;i<m;i++){
    int a,b;
    cin>>a>>b;
    a--;b--;
    fri[a].push_back(b);
    fri[b].push_back(a);
    dd[i]=P(a,b);
    f.unite(a,b);
}
V<int> cnt(n,0);
for(int i=0;i<k;i++){
    int a,b;
    cin>>a>>b;
    a--;b--;
    block[a].push_back(b);
    block[b].push_back(a);
    if(f.same(a,b)){
        cnt[a]++;
        cnt[b]++;
    }
}
for(int i=0;i<n;i++){
  //  cout<<fri[i].size()<<" ";
    int d=(f.size(i)-fri[i].size()-cnt[i]);
   cout<<max(0,d-1)<<" ";
}
cout<<"\n";
}

Measured memory_bytes: 15352
n = int(input())
t = []
for i in range(2,int(-(-n**0.5//1))+1):
    if(n%i == 0):
        cmp = 0
        while(n%i == 0):
            cmp += 1
            n //= i
        t.append([i,cmp])
    if(n == 1):
        break
if(n != 1):
    z = 1
else:
    z = 0
z -= len(t)
for i in range(len(t)):
    j = 1
    while(t[i][1] >= 0):
        t[i][1] -= j
        j += 1
        z += 1
print(z)

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

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine();

		switch (str) {
		case "SUN":
			System.out.println("7");
			break;
		case "MON":
			System.out.println("6");
			break;
		case "TUE":
			System.out.println("5");
			break;
		case "WED":
			System.out.println("4");
			break;
		case "THU":
			System.out.println("3");
			break;
		case "FRI":
			System.out.println("2");
			break;
		case "SAT":
			System.out.println("1");
			break;
		}
	}
}

Measured memory_bytes: 21332
/**
表計算を行う簡単なプログラムを作成します。

表の行数rと列数c、r × c の要素を持つ表を読み込んで、
各行と列の合計を挿入した新しい表を出力するプログラムを作成して下さい。

 */

/*sucannerクラス使うためにインポート*/
import java.util.Scanner;

class Main {
	// プログラムのエントリポイント
	public static void main(String[] args) {
		// 入力ストリームの生成
		Scanner sc = new Scanner(System.in);
		//行数、列数ふたつの値をうけとる
		int intR = sc.nextInt();
		int intC = sc.nextInt();
		//受け取った値の配列作成
		int Hyou[][] = new int[intR][intC];
		//変数の宣言
		int intYokogoukei = 0;
		int intTategoukei = 0;
		int intSaigo = 0;
		for (int i = 0; i < intR; i++) {

			for (int j = 0; j < intC; j++) {
				Hyou[i][j] = sc.nextInt();
				intYokogoukei += Hyou[i][j];
				intSaigo += Hyou[i][j];
				System.out.print(Hyou[i][j] + " ");

			}
			System.out.println(intYokogoukei);
			intYokogoukei = 0;
		}
		for (int k = 0; k < intC; k++) {
			for (int l = 0; l < intR; l++) {
				intTategoukei += Hyou[l][k];

			}
			System.out.print(intTategoukei + " ");
			intTategoukei = 0;
		}
		System.out.println(intSaigo);

	}
}

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

int main(){
	int n,p;
	while(cin >> n >> p, n|p){
		vector<int> v(n,0);
		int cup=p;
		int num=0;
		while(1){
			if(cup!=0){
				v[num]++;
				cup--;
			}
			else if(v[num]!=0){
				cup=v[num];
				v[num]=0;
			}
			if(v[num]==p)
				break;
			num++;
			num%=n;
		}
		cout << num << endl;
	}
	return 0;
}

Measured memory_bytes: 1196
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
#define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl

using namespace std;

typedef long long int lli;

template<typename T>
vector<T> make_v(size_t a, T b) {
    return vector<T>(a, b);
}

template<typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v(ts...))>(a, make_v(ts...));
}

int main() {
    int N;
    cin >> N;
    cout << (N % 2 ? 2 * N : N) << endl;
    return 0;
}


Measured memory_bytes: 256
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

S = list(sr())
K = ir()

unit = 0
cur = ''
T = S.copy()
for i in range(len(T)):
    if T[i] == cur:
        T[i] = '_'
        unit += 1
    cur = T[i]

if len(set(S)) == 1:
    answer = len(S) * K // 2
elif S[0] != S[-1]:
    answer = unit * K
else:
    #Sの先頭と末尾が同じで間に他の文字
    T = S.copy()
    head = 1; tail = 1
    for i in range(1, len(T)):
        if T[i] == T[0]:
            head += 1
        else:
            break
    for i in range(-2, -len(T)-1, -1):
        if T[i] == T[-1]:
            tail += 1
        else:
            break
    
    answer = unit * K - (head//2 + tail//2 - (head+tail)//2) * (K-1)

print(answer)
# 24


Measured memory_bytes: 3064
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
// #define int long long

template <class T>
bool INRANGE(T x, T a, T b) { return a <= x && x <= b; }
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define RREP(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for (int i = (a); i >= (b); --i)
#define ALL(v) (v).begin(), (v).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;

typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

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

    int x;
    cin >> x;

    if (x >= 30) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


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

struct edge{
	int64_t to, cost;
	edge(int64_t to, int64_t cost){
		this->to = to;
		this->cost = cost;
	}
};

void dfs(vector<vector<edge>> &v, vector<int64_t> &dist, int now, int par = -1){
	for(edge &e:v[now]) if(e.to != par && dist[e.to] < 0){
		dist[e.to] = dist[now] + e.cost;
		dfs(v, dist, e.to, now);
	}
}

int main(){
	int n;
	cin >> n;
	vector<vector<edge>> v(n);
	for(int i = 0; i < n - 1; i++){
		int64_t from, to, cost;
		cin >> from >> to >> cost;
		from--; to--;
		v[from].emplace_back(edge(to, cost));
		v[to].emplace_back(edge(from, cost));
	}
	int q, k;
	cin >> q >> k;
	vector<int64_t> dist(n, -1);
	dist[--k] = 0;
	dfs(v, dist, k);
	while(q--){
		int x, y;
		cin >> x >> y;
		cout << dist[--x] + dist[--y] << endl;
	}
}

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(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 (a>b) { a=b; return 1; } return 0; }

#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

#define INF 1e9

int n;
vi opp;
vector<bool> seen;
vi weight;

int dfs(int v){
    if (weight[v]!=-1) return weight[v];
    if (seen[v] && weight[v]==-1) return INF;
    int u = opp[v];
    seen[v]=seen[u]=true;
    int wv,wu;
    wv = (v%(n-1)==0) ? 1 : dfs(v-1)+1 ;
    wu = (u%(n-1)==0) ? 1 : dfs(u-1)+1 ;
    // if (v%(n-1)==0) wv=1; else wv=dfs(v-1)+1;
    // if (u%(n-1)==0) wu=1; else wu=dfs(u-1)+1;
    weight[v]=weight[u]=max(wv,wu);
    return weight[v];
}

//-------------------------------------------------

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin>>n;
    int N = n*(n-1);
    vector<vi> a(n, vi(n-1));
    vector<vi> rev(n, vi(n));
    rep(i,n)rep(j,n-1){
        cin>>a[i][j]; a[i][j]--;
        rev[i][a[i][j]] = j;
    }
    opp.resize(N);
    rep(i,n)rep(j,n-1){
        int id = (n-1)*i+j;
        opp[id] = (n-1)*a[i][j]+rev[a[i][j]][i];
    }
    weight.resize(N,-1);
    seen.resize(N,false);
    int ans=0;
    rep(i,N) chmax(ans,dfs(i));
    cout<<((INF>ans)?ans:-1)<<"\n";
    return 0;
}


Measured memory_bytes: 16384
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i=(a) ; i<=(b) ; ++i)
#define mp make_pair
#define pii pair<int, int>
#define PB push_back
#define F first
#define S second
#define Task ""
using namespace std;
const int N=200001;
int n, Q, q[N], Sz;
pair <pii, int > a[N];
vector <int > v;

struct intervaltree {
    int t[600001*4], lazy[600001*4];
    intervaltree() {
        rep(i, 0, 600001*4-1) {
            t[i]=(int)(1e9+2);
            lazy[i]=0;
        }
    }

    void down(int id) {
        if(!lazy[id]) return;
        t[id*2]=t[id*2+1]=lazy[id*2]=lazy[id*2+1]=lazy[id];
        lazy[id]=0;
    }

    void update(int l, int r, int id, int u, int v, int val) {
        if(r<u||v<l) return;
        if(u<=l&&r<=v) {
            if(t[id]>val) t[id]=val, lazy[id]=val;
            return;
        }
        int mid=(r+l)>>1;
        down(id);
        update(l, mid, id*2, u, v, val);
        update(mid+1, r, id*2+1, u, v, val);
        t[id]=min(t[id*2], t[id*2+1]);
    }

    int get(int l, int r, int id, int u) {
        if(l==r) return t[id];
        int mid=(r+l)>>1;
        down(id);
        if(u<=mid) return get(l, mid, id*2, u);
        return get(mid+1, r, id*2+1, u);
    }

} IT;

bool cmp(pair <pii, int > a, pair <pii, int > b) {
    return a.S>b.S;
}

void setup() {
    cin >> n >> Q;
    rep(i, 1, n) {
        int s, t, x; cin >> s >> t >> x;
        a[i]=mp(mp(s-x, t-1-x), x);
        v.PB(s-x); v.PB(t-1-x);
    }
    rep(i, 1, Q) {
        cin >> q[i];
        v.PB(q[i]);
    }
}

void Unique() {
    sort(v.begin(), v.end());
    v.resize(unique(v.begin(), v.end())-v.begin());
    Sz=v.size();
    sort(a+1, a+n+1, cmp);
    rep(i, 1, n) {
        int s=lower_bound(v.begin(), v.end(), a[i].F.F)-v.begin()+1;
        int f=lower_bound(v.begin(), v.end(), a[i].F.S)-v.begin()+1;
        IT.update(1, Sz, 1, s, f, a[i].S);
    }
}

void answer() {
    rep(i, 1, Q) {
        int idQ=lower_bound(v.begin(), v.end(), q[i])-v.begin()+1;
        int ans=IT.get(1, Sz, 1, idQ);
        if(ans>(int)(1e9)) ans=-1;
        cout << ans << '\n';
    }
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen(Task".inp", "r", stdin);
    //freopen(Task".out", "w", stdout);
    setup();
    Unique();
    answer();
    return 0;
}


Measured memory_bytes: 27888