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

int aa[105][105];
int r=0;
void prt(int a,int b,int flag){
    if(flag==1){
        int rows=(b+50)/50;
        while(rows--){
            for(int i=0;i<100;i++){
                aa[r][i]=1;
            }
            r++;
            for(int i=0;i<100;i++){
                if(b==0){
                    aa[r][i]=1;
                    continue;
                }
                if(i%2==0){
                   aa[r][i]=1;
                }else{
                    aa[r][i]=0;
                    b--;
                }
            }
            r++;
        }
        for(int i=0;i<100;i++){
            aa[r][i]=1;
        }
        r++;
    }else{
        int rows=(a+50)/50;
        while(rows--){
            for(int i=0;i<100;i++){
                aa[r][i]=0;
            }
            r++;
            for(int i=0;i<100;i++){
                if(a==0){
                    aa[r][i]=0;
                    continue;
                }
                if(i%2==0){
                    aa[r][i]=0;
                }else{
                    aa[r][i]=1;
                    a--;
                }
            }
            r++;
        }
        for(int i=0;i<100;i++){
            aa[r][i]=0;
        }
        r++;
    }
}

int main()
{
    int a,b;
    scanf("%d%d",&a,&b);
    if(a==1){
        prt(a,b,1);
    }else if (b==1){
        prt(a,b,0);
    }else{
        prt(1,b-1,1);
        prt(a-1,1,0);
    }
    printf("%d %d\n",r,100);
    for(int i=0;i<r;i++){
        for(int j=0;j<100;j++){
            if(aa[i][j]==1){
                printf(".");
            }else{
                printf("#");
            }
        }
        printf("\n");
    }

}

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

int main(void) {
      int n, k;
      char s[12];

      if(scanf("%d %s %d", &n, s, &k) == 1);

      for(int i = 0; i < n; i++) {
            if(s[i] != s[k - 1]) {
                  s[i] = '*';
            }
            printf("%c", s[i]);
      }

      return 0;
}

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

int main(){
  int n,d,x;
  int a[105];
  cin >> n >> d >> x;
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  int j,a_0;
  int ans = 0;
  for(int i=0;i<n;i++){
    int a_0 = 1;
    int j = 0;
    while(1){
      if(d < a_0){
        break;
      }else{
        ans++;
        a_0 += a[i];
      }
    }
  }
  cout << x+ans << endl;
  return 0;
}


Measured memory_bytes: 256
use std::io::prelude::*;
use std::io::stdin;
use std::str::FromStr;

fn main() {
    let a: i32 = read();
    let b: i32 = read();
    let c: i32 = read();
    print!("{}", if a == b && b == c { "Yes" } else { "No" });
}

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|b| b.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}


Measured memory_bytes: 4352
#include<iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
#include<functional>
#include<iomanip>
#include<queue>
#include<cassert>
#include<tuple>
#include<set>
#include<map>
#include<list>
#include<bitset>

#define PB push_back
#define ALL(a)  (a).begin(),(a).end()
#define all(v) begin(v), end(v)
#define DWN(a)  (a).begin(),(a).end(), greater<int>()
#define rep(i, m) for (int i = 0; i < m; i++)
#define REP(i, n, m) for (int i = n; i < m; i++)

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
const int INF = (int)1e9;
const ll inf = (ll)1e18;
const ll MOD{ (ll)1e9 + 7 };

int main()
{
	int n, m;
	cin >> n >> m;
	ll a = 0, b = 0, x, y;
	rep(i, n) {
		cin >> x;
		(a += (2 * i - n + 1) * x) %= MOD;
	}
	rep(i, m) {
		cin >> y;
		(b += (2 * i - m + 1) * y) %= MOD;
	}
	cout << a * b % MOD << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#define rep(i,n) for(int i=0;i<(n);i++)
#define psortsecond(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.second<b.second;});
#define psortfirst(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.first<b.first;});
#define All(x) (x).begin(),(x).end()
using namespace std;
using pii  = pair<int,int>;
long long gcd(long long a, long long b){return (b == 0 ? a : gcd(b, a%b));}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
int ctoi(const char c){
  if('0' <= c && c <= '9') return (c-'0');
  return -1;
}
int BinarySearch(int key,int n,int S[]){
  int l=0,r=n;
  while(r-l>1){
    int mid=(l+r)/2;
    if(S[mid]>key)r=mid;
    else l=mid;
  }
  return S[l]==(key?1:0);
}
typedef long long ll;
#define MOD 1000000007
#define EPS 10e-8

int main() {
    ll N,K,L=1;cin>>N>>K;
    rep(i,N){
        if(L<K){
            L*=2;
        }
        else{
            L+=K;
        }
    }
    cout << L << endl;
}

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

using namespace std;
using ll = long long;

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

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

	int n;
	cin >> n;

	ll sum = 0;

	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			for (int k = 1; k <= n; k++) {
				sum += (ll)gcd(k,gcd(i,j));
			}
		}
	}

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

Measured memory_bytes: 3652
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>
#include <sstream>
#include <time.h>
using namespace std;
//#define int long long
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
typedef long long ll;
typedef pair<int, int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint, int> P1;
typedef pair<int, pint> P2;
typedef pair<pint, pint> PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD = 1000000007;
const ll INF = 1e18;
int ca[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };

ll n, cnt = 0;

int func(string s) {

	//cout << "s->" << s << endl;
	

	if (s.length() >= 3 && stoll(s) > n) {
		//cout << "stoi->" << stoi(s) << endl;
		return 0;
	}

	//vector<bool>flag(10, false);
	bool flag[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

	for (int i = 0; i < s.length(); i++) {
		flag[s[i] - 48] = true;
	}

	//if (flag[7] == true && flag[5] == true && flag[3] == true) {
	if ( !(flag[7] == false || flag[5] == false || flag[3] == false)) {
		cnt++;
	}

	func(s + '3');
	func(s + '5');
	func(s + '7');


	return 0;
}

int main() {
	int i, j;

	//clock_t start = clock();

	cin >> n;
	
	string s;
	func(s);

	//clock_t end = clock();
	//std::cout << "duration = " << (double)(end - start) / CLOCKS_PER_SEC << "sec.\n";

	cout << cnt << endl;





	getchar();
	getchar();
	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#define inp 200005
#define check exit(0)
#define nl cout<<endl;
#define mod 1000000007 
#define ll long long int
#define trace(x) cerr<<#x<<" : "<<x<<endl;
#define deb(v) for(int i=0;i<v.size();i++) {cout<<v[i]; (i==v.size()-1) ? cout<<"\n":cout<<" "; }
#define jaldi ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ordered_set tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update>

using namespace __gnu_pbds;
using namespace std;

// Pick yourself up, 'cause...

int main()
{
    jaldi
    
    int n;
    cin>>n;
    int tmp=n%10;

    for(int x: {2,4,5,7,9})
    {
        if(x==tmp) { cout<<"hon"; return 0;}
    }
    for(int x:{0,1,6,8})
    {
        if(x==tmp) { cout<<"pon"; return 0;}
    }
    cout<<"bon";
    return 0;
}


Measured memory_bytes: 3652
#include<iostream>
#include<string>
#include<algorithm>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <stdlib.h>
using namespace std;

int N,M;
int Map[55][55],a[55],b[55];
int visit[55];

int main(){

    cin>>N>>M;
    for(int i = 1;i<=M;i++){
        cin>>a[i]>>b[i];
        visit[a[i]]++;
        visit[b[i]]++;
        Map[a[i]][b[i]] = Map[b[i]][a[i]] = 1;
    }
    int sum = M;
    int xi;
    bool falg = true;
    while(1){
        falg = true;
        for(int i = 1;i<=N;i++){
            if(visit[i]==1){
                xi = i;
                falg = false;
                visit[i]--;
                break;
            }
        }
        if(falg) break;
        for(int i = 1;i<=N;i++){
            if(Map[xi][i]==1)
                visit[i]--;
        }
    }
    for(int i = 1;i<=N;i++){
        for(int j = i;j<=N;j++){
            if(Map[i][j]==1){
                if(visit[i]>0&&visit[j]>0)
                    sum--;
            }
        }
    }

    cout<<sum<<endl;

	return 0;
}


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


int main() {
    int N;
    int Alice = 0, Bob = 0;
    cin >> N;//2
    vector<int> vec(N);

    rep(i,N){
        cin >> vec.at(i);//3 1が入っている
    }
    sort(vec.begin(),vec.end());//配列のソート完了
    reverse(vec.begin(),vec.end());
    // cout << vec.at(0) << vec.at(1) << endl;
    for(int i = 0; i < N; i++){
        if(i %2 == 0){
            Alice += vec.at(i);
            // cout << Alice << endl;
        }else{
            Bob += vec.at(i);
            // cout << Bob << endl;
        }
    }
    cout << Alice - Bob << endl;
}


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

int main()
{
    ll n,r;
    cin>>n>>r;
    if(n<10)
    {
        ll a=r+(100*(10-n));
        cout<<a<<endl;
    }
    else
    {
        cout<<r<<endl;
    }

}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <codecvt>
#include <locale>
using namespace std;
using ll = long long;

int main() {
    int W, a, b;
    cin >> W >> a >> b;
    if(a <= b && b <= a+W || b <= a && a <= b+W) {
        cout << 0 << endl;
    } else {
        cout << min(abs(b-(a+W)), abs(a-(b+W))) << endl;
    }
}


Measured memory_bytes: 256
/* ***************************************
Author        :Scau.ion
Created Time  :2016/12/18 20:03:10 UTC+8
File Name     :ion.cpp
*************************************** */

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

#define LL long long
#define ULL unsigned long long
#define PB push_back
#define MP make_pair
#define PII pair<int,int>
#define VI vector<int>
#define VPII vector<PII>
#define X first
#define Y second
#define IOS ios::sync_with_stdio(0);cin.tie(0);
#define IN freopen("in", "r", stdin);
#define OUT freopen("out", "w", stdout);

const int maxn=100010;
const int mod=1e9+7;

int a[maxn];

int main()
{
    IOS;
    int n;
    cin>>n;
    for (int j=1;j<=n;++j)
        cin>>a[j];
    bool flag=1;
    sort(a+1,a+n+1);
    a[0]=0;
    for (int j=n;j>0;j-=2)
    {
        if (a[j]!=a[j-1]||a[j]!=j-1) flag=0;
    }
    if (flag==0) cout<<"0"<<endl;
    else
    {
        int cs=n/2;
        int ans=1;
        for (int j=1;j<=cs;++j)
            ans=ans*2%mod;
        cout<<ans<<endl;
    }
    return 0;
}


Measured memory_bytes: 640
#include <iostream>

using namespace std;

int main() {
  int n;
  while(cin >> n && n >= 0) {
    int res = 3130;    
    for(int i=11; i<=n; i++) {
      if(i<=20) res -= 125;
      else if(i<=30) res -= 140;
      else res -= 160;
    }
    cout << res << endl;
  }
  
  return 0;
}

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

int main() {
  int N;
  cin >> N;
  deque<int> dq;
  if(N%2 == 1){
    for(int i=0; i<N; i++){
      int x;
      cin >> x;
      if(i%2 == 0){
        dq.push_front(x);
      }
      else{
        dq.push_back(x);
      }
    }
  }
  else{
    for(int i=0; i<N; i++){
      int x;
      cin >> x;
      if(i%2 == 0){
        dq.push_back(x);
      }
      else{
        dq.push_front(x);
      }
    }
  }
  for(int i=0; i<N; i++){
    if(i == N-1){
      cout << dq[i] << endl;
      return 0;
    }
    else{
      cout << dq[i] << " ";
    }
  }
}

Measured memory_bytes: 4396
def sum_of_digits(n):
    sum = 0

    while(n>0):
        q,mod = divmod(n,10)

        sum += mod
        n = q
   
    return sum

N = int(input())

sum = sum_of_digits(N)

if N % sum == 0:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 38256
//
//  main.cpp
//  C-green_bin
//
//  Created by david chong on 8/14/19.
//  Copyright © 2019 david chong. All rights reserved.
//

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <cstring>
#include <algorithm>

using namespace std;

long long solve(int n, vector<string> inVec) {
    
//    string str;
    
    map<string, int> myMap;
    
    long long resultCount = 0;
    
    for(int i = 0; i < inVec.size(); i++) {
        myMap[inVec[i]]++;
    }
    
    map<string, int>::iterator it;
    
    long long x;
    
    for(it=myMap.begin(); it!=myMap.end(); it++) {
//        cout << it->second << endl;
        x = it->second;
        x = x * (x-1) / 2;
        resultCount += x;
        
    }
    
    return resultCount;
    
}

int main(int argc, const char * argv[]) {
    
//    freopen("input.in", "r", stdin);
    
    int n;
    string str;
    vector<string> inVec;
    
    cin >> n;
    
    for(int i = 0; i < n; i++) {
        cin >> str;
        sort(str.begin(), str.end());
        inVec.push_back(str);
    }
    
    cout << solve(n, inVec) << endl;
    
    return 0;
}


Measured memory_bytes: 12788
# -*- coding: utf-8 -*-
# m-solutions2019/m_solutions2019_b
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    S = i2s()
    win = 15 - len(S) + S.count('o')
    if win >= 8:
        print('YES')
    else:
        print('NO')
    return

main()


Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <cmath>
#include <limits>
#include <algorithm>

constexpr long long MOD = 1000000007;

int main()
{
  std::string S;
  std::cin >> S;
  switch (S[0])
  {
    case 'A':
      std::cout << "T";
      break;
    case 'T':
      std::cout << "A";
      break;
    case 'C':
      std::cout << "G";
      break;
    default:
      std::cout << "C";
      break;
  }
  std::cout << std::endl;
  return 0;
}



Measured memory_bytes: 256
import Control.Monad
import Data.List

matrixMultiplicate a b | length (head a) == length b =
    [[sum (zipWith (*) ai bj) | bj <- (transpose b)] | ai <- a]

putMatrix =
  mapM_ (putStrLn . unwords . map show)
readMatrix r c =
  replicateM r $ fmap (map read . words) getLine

main = do
  [n, m, l] <- fmap (map read . words) getLine
  a <- readMatrix n m
  b <- readMatrix m l
  putMatrix (a `matrixMultiplicate` b)

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

int main() {
    int n, k;
    cin >> n >> k;
    string ans = "NO";
    if ((n + 1) / 2 >= k) ans = "YES";
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repp(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
using namespace std;

signed main(){
    string s, t = "NSWE";
    cin >> s;
    int d[4] = {};
    rep(i, 0, s.size()){
        rep(j, 0, 4){
            if(s[i] == t[j]) d[j] = 1;
        }
    }
    bool f = true;
    if(d[0] != d[1] || d[2] != d[3]) cout << "No" << endl;
    else cout << "Yes" << endl;
}

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

using namespace std;

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

    s = "?" + s;
    t = "?" + t;

    vector<vector<int>> len(s.size(), vector<int>(t.size(),0));
    vector<vector<int>> par(s.size(), vector<int>(t.size(),1));

    // '1' is up
    // '2' is left
    // '3' is upleft

    for(int i = 1; i < s.size(); i++) {
        for(int j = 1; j < t.size(); j++) {

            if(len[i-1][j] > len[i][j]) {
                len[i][j] = len[i-1][j];
                par[i][j] = 1;
            }

            if(len[i][j-1] > len[i][j]) {
                len[i][j] = len[i][j-1];
                par[i][j] = 2;
            }

            if(len[i-1][j-1] + 1 > len[i][j] && s[i] == t[j]) {
                len[i][j] = len[i-1][j-1] + 1;
                par[i][j] = 3;
            }
        }
    }

    int x = s.size()-1;
    int y = t.size()-1;

    string ret = "";
    while(x > 0 && y > 0) {
        if(par[x][y] == 1) {
            x--;
        }
        else if(par[x][y] == 2) {
            y--;
        }
        else if(par[x][y] == 3) {
            ret.push_back(s[x]);
            x--;
            y--;
        }
    }

    reverse(ret.begin(),ret.end());
    cout << ret << endl;
}


Measured memory_bytes: 70784
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>
//#include <stdio.h>
//#include <stack>
//#include <queue>
//#include <cstdio>
#include <cmath>
#include <iterator>
#include <map>
#include <fstream>
//#include <list>
#include <iomanip>
//#include <stdlib.h>
//#include <cctype>

using namespace std;

const int MAX_N = 1000000;
#define IOS ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define prec std::cout << std::fixed << std::setprecision(15);
#define endl "\n"
#define MOD 1000000007
#define Int int64_t
#define PI 3.14159265358979
#define rep(i, n) for (int i = 0; i < int(n); i++)
#define ssort(z) sort(z.begin(), z.end())
#define rsort(z) sort(z.rbegin(), z.rend())
#define eerase(z) z.erase(unique(z.begin(), z.end()), z.end())
#define ccnt(z, w) count(z.begin(), z.end(), w)
template <typename T>
void printV(const std::vector<T>& v, const char * const separator = " ")
{
    if(!v.empty())
    {
        std::copy(v.begin(),
                  --v.end(),
                  std::ostream_iterator<T>(std::cout, separator));
        std::cout << v.back() << "\n";
    }
}


Int gcd(Int a, Int b) {
    return b != 0 ? gcd(b, a % b) : a;
}

Int lcm(Int a, Int b) {
    return a / gcd(a, b) * b;
    //a*bは64bit integer overflow
}

int Max(int a, int b, int c) {
    int temp = max(a, b);
    return max(temp, c);
}

int Min(int a, int b, int c) {
    int temp = min(a, b);
    return min(temp, c);
}

bool integer(double num) {
    return floor(num) == num;
}

Int fact(int num) {
    if (num == 0)
        return 1;
    else
        return num * fact(num - 1);
}

void y() {
    cout << "Yes" << endl;
    exit(0);
}

void n() {
    cout << "No" << endl;
    exit(0);
}

void Y() {
    cout << "YES" << endl;
    exit(0);
}

void N() {
    cout << "NO" << endl;
    exit(0);
}

Int yakusu(int n) {
    int cnt = 0;
    for (int i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            cnt++;
            if (i * i != n) cnt++;
        }
    }
    return cnt;
}

/*   kokomade  */

int cnt = 0;
bool is_prime[ 50000 + 1 ];
vector<int> P;
void Eratosthenes( const int N )
{
    for( int i = 0; i <= N; i++ )
    {
        is_prime[ i ] = true;//初期化
    }
    for( int i = 2; i <= N; i++ )
    {
        if( is_prime[ i ] )
        {
            for( int j = 2 * i; j <= N; j += i )
            {
                is_prime[ j ] = false;
            }
            P.emplace_back( i );
        }
    }
}

int main() {
    IOS;
    prec;
    int n,x;cin>>n>>x;
    vector<int>a(n);
    for (int i = 0; i < n; ++i) {
        cin>>a[i];
    }
    int ans=0;

    for (int j = 0; j < n; ++j) {
        if(a[j]>=x)ans++;
    }
    cout<<ans;




    cout<<endl;
    return 0;
}

/*
テレビも無ェ ラジオも無ェ
自動車もそれほど走って無ェ
ピアノも無ェ バーも無ェ
巡査 毎日ぐーるぐる
朝起ぎで 牛連れで
二時間ちょっとの散歩道
電話も無ェ 瓦斯も無ェ
バスは一日一度来る
俺らこんな村いやだ 俺らこんな村いやだ
東京へ出るだ 東京へ出だなら
銭コァ貯めで 東京でベコ(牛)飼うだ
*/


Measured memory_bytes: 640
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
		ArrayList<Integer> one = nextIntArray();
		int K = one.get(0);
		int X = one.get(1);
		ArrayList<String> output = new ArrayList<String>();
		for(int i = X - K + 1; i <= X + K - 1; i++){
			output.add(String.valueOf(i));
		}
		myout(myconv(output, 8));
	}
	//Method addition frame start




	//Method addition frame end
}


Measured memory_bytes: 32500
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        x: usize,
        bounds: [usize; n],
    };
    let mut ans = 1;
    let mut current = 0;
    for bound in bounds {
        if current + bound > x {
            break;
        }
        ans += 1;
        current += bound;
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
// C++ program to illustrate Edge Coloring
#include <bits/stdc++.h>
using namespace std;
int clr = 0;


void colorEdges(int ptr, vector<vector<pair<int, int> > >& gra,
                vector<int>& edgeColors, bool isVisited[])
{
	queue<int> q;
	int c = 0;

	set<int> colored;

	// return if isVisited[ptr] is true
	if (isVisited[ptr])
		return;

	// Mark the current node visited
	isVisited[ptr] = 1;

	// Traverse all edges of current vertex
	for (int i = 0; i < (int) gra[ptr].size(); i++) {
		// if already colored, insert it into the set
		if (edgeColors[gra[ptr][i].second] != -1)
			colored.insert(edgeColors[gra[ptr][i].second]);
	}

	for (int i = 0; i < (int) gra[ptr].size(); i++) {
		// if not visited, inset into the queue
		if (!isVisited[gra[ptr][i].first])
			q.push(gra[ptr][i].first);

		if (edgeColors[gra[ptr][i].second] == -1) {
			// if col vector -> negative
			while (colored.find(c) != colored.end())

				// increment the color
				c++;

			// copy it in the vector
			edgeColors[gra[ptr][i].second] = c;

			// then add it to the set
			colored.insert(c);
			c++;
			clr = max(clr, c);
		}
	}

	// while queue's not empty
	while (!q.empty()) {
		int temp = q.front();
		q.pop();

		colorEdges(temp, gra, edgeColors, isVisited);
	}

	return;
}

// Driver Function
int main()
{
	vector<vector<pair<int, int> > > gra;

	vector<int> edgeColors;

	bool isVisited[100005] = { 0 };
	int ver;
	int edge;
	cin >> ver;
	edge = ver - 1;

	gra.resize(ver);
	edgeColors.resize(edge, -1);

	for (int i = 0; i < edge; i++) {
		int u, v;
		cin >> u >> v;
		--u;
		--v;
		gra[u].push_back(make_pair(v, i));
		gra[v].push_back(make_pair(u, i));
	}

	colorEdges(0, gra, edgeColors, isVisited);

	cout << clr << endl;
	for (int i = 0; i < edge; i++)
		cout << edgeColors[i] + 1 << "\n";

	return 0;
}


Measured memory_bytes: 60416
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>
#include <sstream>
#include <chrono>
#include <cstring>
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

#define ft first
#define sd second
#define flag bool fl=true

#define mod 1000000007
#define N 10000001
#define MX 1000000001
#define MXX 1000000000000000001

#define pb push_back
#define fa(n) for(int i=0;i<n;i++)
#define fa1(n) for(int i=1;i<=n;i++)
#define fab(i, a, b) for(int i=a;i<=b;i++)
#define cs cout<<"Case "<<qq<<": "
#define csl cout<<"Case "<<qq<<":"<<endl;
#define T int tt, qq=0; cin>>tt; while(qq++<tt)
#define fast ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)
#define ina(array, size) for(int i=0;i<size;i++) cin>>array[i];
#define outa(array, size) for(int i=0;i<size;i++) cout<<array[i]<<" ";
#define outla(array, size) for(int i=0;i<size;i++) cout<<array[i]<<endl;

#define deg(rad) (rad*180.0)/pi
#define pi acos(-1)
#define log(n) (int)log2(n)
#define logg(a)(b) log(b)/log(a)

int main()
{
    ll n, sum=0;
    cin>>n;

    ll a[n], cum[n]={};
    for(int i=0;i<n;i++) cin>>a[i];

    cum[0]=a[0]%mod;
    for(int i=1;i<n;i++) cum[i]=(a[i]+cum[i-1])%mod;

    for(int i=1;i<n;i++) sum+=(cum[i-1]*a[i])%mod;
    cout<<sum%mod;
}


/*

//----------useful_functions----------

long long extended_euclid(ll a, ll b, ll &x, ll &y) //ax+by=c
{
    if(b==0)
    {
        x=1, y=0;
        return a;
    }

    ll x1, y1;
    ll d=extended_euclid(b, a%b, x1, y1);
    x=y1;
    y=x1-y1*(a/b);
    return d;
}

long long bigMod(ll a, ll b) //(a^b)%mod
{
    ll ans=1;
    while(b)
    {
        if(b%2==1) ans=(ans*a)%mod;
        a=(a*a)%mod;
        b/=2;
    }
    return ans%mod;
}

long long modInverse(ll a, ll b) //a*x=1 mod b
{
    ll x, y;
    ll gcd=extended_euclid(a, b, x, y);

    if(gcd==1) return ((x%b)+b)%b;
    else return 1;
}

long long nCr(ll n, ll r) //n<=1e6
{
    //declare globally-> ll fact[1000001];
    fact[1]=1;
    for(ll i=2; i<1000001; i++)
        fact[i]=(i*fact[i-1])%mod;

    return (fact[n]*modInverse(fact[r], mod)*modInverse(fact[n-r], mod))%mod;
}

long long josephus(ll n, ll k) //k'th person is killed out of n in the circle
{
    if(n==1) return 1;
    else return (josephus(n-1, k)+k-1)%n+1;
}

bool fl[N+1];
vector<ll> sieve(ll n)
{
    vector<ll> primes;
    for(ll i=3; i*i<=n; i+=2)
        for(ll j=i*i; j<=n; j+=i+i)
            fl[j]=true;

    primes.pb(2);
    for(ll i=3; i<=n; i+=2) if(!fl[i]) primes.pb(i);
    return primes;
}
vector<ll> p=(sieve(N));

ll eulerTotient(ll x)
{
    db ans=x;
    for(int i=0; i<p.size() && p[i]*p[i]<=x; i++)
    {
        if(x%p[i]==0)
        {
            ans*=(1.0-(1/(db)p[i]));
            while(x%p[i]==0) x/=p[i];
        }
    }
    if(x>1) ans*=(1.0-(1/(db)x));

    return ans;
}

*/


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

public class Main {
	private static int[][] paper = new int[10][10];

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 128);
		String sLine;
		while ((sLine = reader.readLine()) != null) {
			droppingInk(sLine.charAt(0) & 0x0F, sLine.charAt(2) & 0x0F, sLine.charAt(4) & 0x0F);
		}
		calcResult();
	}

	private static void droppingInk(int x, int y, int size) {
		staining(x, y - 1);
		staining(x - 1, y);
		staining(x, y);
		staining(x + 1, y);
		staining(x, y + 1);
		if (size == 1) {
			return;
		}

		staining(x - 1, y - 1);
		staining(x + 1, y - 1);
		staining(x - 1, y + 1);
		staining(x + 1, y + 1);
		if (size == 2) {
			return;
		}

		staining(x, y - 2);
		staining(x - 2, y);
		staining(x + 2, y);
		staining(x, y + 2);
	}

	private static void staining(int x, int y) {
		if (x >= 0 && x < 10 && y >= 0 && y < 10) {
			paper[x][y]++;
		}
	}

	private static void calcResult() {
		int white = 0;
		int maxnoud = 0;
		for (int[] row : paper) {
			for (int colum : row) {
				if (colum == 0) {
					white++;
				} else if (colum > maxnoud) {
					maxnoud = colum;
				}
			}
		}
		System.out.println(white);
		System.out.println(maxnoud);
	}
}

Measured memory_bytes: 15012
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using ll = long long;
using namespace std;

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

    cout << min(n * a, b) << endl;
}

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

#define mem(f, v) memset(f,v,sizeof(f))
#define file(x) freopen(x".in","r",stdin);freopen(x".out","w",stdout);

typedef long long ll;
const int maxn = 100010;
const int inf = ~(1u << 31u);
const ll linf = ~(1llu << 63u);

using namespace std;

int n, m, p;
int s[12];

int main() {
    ios::sync_with_stdio(false);
    cin >> n >> m;
    for(int i = 1; i <= m; i ++){
        int k;
        cin >> k;
        for(int j = 1; j <= k; j ++){
            int t;
            cin >> t;
            s[t] |= (1 << (i - 1));
        }
    }
    for(int i = 1; i <= m; i ++){
        int t;
        cin >> t;
        p |= (t << (i - 1));
    }
    int ans = 0;

    for(int i = 0; i < (1 << n); i ++){
        int res = 0;
        for(int j = 0; j < n; j ++){
            if(i & (1 << j)){
                res ^= s[j + 1];
            }
        }
        if(res == p) ans ++;
    }
    cout << ans << endl;
    return 0;
}

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

int main() {
  char c;
  cin >> c;
  if(c=='a' || c=='e' || c=='i' || c=='o' || c=='u'){
    cout << "vowel" << endl;
  }
  else{
    cout << "consonant" << endl;
  }
}

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

#ifdef LOCAL
#include "../../dump.hpp"
#else
#define dump(...)
#endif

#define int ll
#define rep(i,n) for(int i=0,i##_cond=(n);i<i##_cond;++i)
#define FOR(i,a,b) for(int i=(a),i##_cond=(b);i<i##_cond;++i)
#define ROF(i,a,b) for(int i=(a)-1,i##_cond=(b);i>=i##_cond;--i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend() //sortで降順
#define pb push_back
#define fst first
#define snd second
using ll  = long long;
using vi  = vector<int>;
using vvi = vector<vi>;
using vs  = vector<string>;
using pii = pair<int,int>;
constexpr ll inf = 1ll<<61;
constexpr ll mod = 1e9+7;
template<class T>bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T>T add(const T &a, const T &b){return (a+b)%mod;}

// rank無しなのでlog n
class UnionFind{
public:
  vi data;
  int s; // 成分数

  UnionFind(int size){
    data.resize(size,-1);
    s = size;
  }

  bool unite(int x,int y){
    x = root(x);
    y = root(y);
    if(x != y){
      if(data[y] < data[x]) swap(x,y);
      data[x] += data[y];
      data[y] = x;
      s--;
    }
    return x != y;
  }

  bool find(int x, int y){
    return root(x) == root(y);
  }

  int root(int x){ // どの集合か
    return data[x] < 0 ? x : data[x] = root(data[x]);
  }

  int size(int x){
    return -data[root(x)];
  }

  void print(){
    cout << "i :\t";
    rep(i, data.size()) cout << i << "\t";
    cout << endl;
    cout << "data :\t";
    rep(i, data.size()) cout << root(i) << "\t";
    cout << endl;
  }
};

signed main(){
  int n; cin >> n;
  vi x(n), y(n); rep(i,n) cin >> x[i] >> y[i];
  if(n == 1){
    cout << 1 << endl;
    return 0;
  }
  int ans = inf;
  rep(i,n) rep(j,n){ // i, jの差をp, qとする
    if(i == j) continue;
    int p = x[i]-x[j], q = y[i]-y[j];
    UnionFind uf(n);
    rep(a,n) rep(b,n){
      if(x[a]-x[b]==p and y[a]-y[b]==q) uf.unite(a,b);
    }
    dump(uf.s);
    ans = min(ans, uf.s);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

N, M, X, Y = na()
x = na()
y = na()
miny = min(y)
maxx = max(x)
flag = False
for i in range(X + 1, Y + 1):
    if maxx < i and miny >= i:
        flag = True

print("No War" if flag else "War")

Measured memory_bytes: 3064
N,M,C=list(map(int,input().split()))
ans=0
B_list=list(map(int,input().split()))
for i in range(N):
    l=0
    A_list=list(map(int,input().split()))
    for j,k in zip(A_list,B_list):
        l+=j*k
    l+=C
    if l > 0:
        ans+=1
print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;

double a, b;

int main(void){
	
	scanf("%lf %lf", &a, &b);
	double n = (a + b) / 2;
    printf("%.0f\n", ceil(n));
    
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	int W, H, x, y, r;
	if (scanf("%d%d%d%d%d", &W, &H, &x, &y, &r) != 5) return 1;
	puts(0 + r <= x && x <= W - r && 0 + r <= y && y <= H - r ? "Yes" : "No");
	return 0;
}



Measured memory_bytes: 2140
s = input()
k = 'keyence'

if k in s:
  print('YES')
  exit()
if s[0] == 'k' and s[-1] == 'e':
  for i in range(len(s)):
    if s.startswith(k[:i]) and s.endswith(k[i:]):
      print('YES')
      exit()
print('NO')

Measured memory_bytes: 9120
# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;
std::chrono::system_clock::time_point  __start, __end;
double elapsed;

int Score(int D, const vector<int>& c, const vector<vector<int>>& s, const vector<int>& t) {
    vector<int> last(26);
    int value = 0;
    rep (d, D) {
        int i = t[d];
        value += s[d][i];
        last[i] = d+1;
        rep (k, 26) value -= c[k] * (d+1 - last[k]);
    }
    return value;
}

int main() {
    __start = chrono::system_clock::now();

    /////////////////////////////////////
    //
    //  入力
    //
    /////////////////////////////////////
    int D; cin >> D;
    vector<int> c(26); rep (i, 26) cin >> c[i];
    vector<vector<int>> s(D, vector<int>(26));
    rep (d, D) rep (i, 26) cin >> s[d][i];
    
    /////////////////////////////////////
    //
    //  乱数器の生成
    //
    /////////////////////////////////////
    static random_device rnd;
    static mt19937 mt(rnd());
    static uniform_int_distribution<> rand_day(0, D-1);
    static uniform_int_distribution<> rand_type(0, 25);

    /////////////////////////////////////
    //
    //  ランダムな初期解を得る
    //
    /////////////////////////////////////
    vector<int> t(D); rep (d, D) t[d] = rand_type(mt);
    
    /////////////////////////////////////
    //
    //  局所探索法をする
    //
    /////////////////////////////////////
    bool changed = true;
    int old_score, new_score;
    vector<int> backup;
    while (elapsed < 1800) {
        int day = rand_day(mt);
        int type = rand_type(mt);
        int backup = t[day];
        if (changed) old_score = Score(D, c, s, t);  // tが変わっていたらスコアを再計算する
        t[day] = type;
        new_score = Score(D, c, s, t);
 
        if (old_score >= new_score) {
            t[day] = backup;
            changed = false;
        }
        else {
            changed = true;
        }
 
        __end = chrono::system_clock::now();
        elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(__end - __start).count();
    }
    
    /////////////////////////////////////
    //
    //  最終的な答えを出力
    //
    /////////////////////////////////////
    rep (d, D) cout << t[d] + 1 << "\n";  // 1-indexにする
 
    return 0;
}


Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
#define lld long long
#define N 200005
#define INF 1e18
#define INF2 1e16
#define mod 998244353
lld power(lld a,lld b,lld c){
  lld ans=1;
  while(b){
    if(b&1){
      ans=ans*a%mod;
    }
    a=a*a%mod;
    b=b/2;
  }
  return ans;
}
int main() {
	unsigned long long h,w; cin>>h>>w;
	unsigned long long  ans;
	if(w==1||h==1)
	{
		ans=1;
		cout<<ans;
		return 0;
	}
	if(w%2==0)ans=h*w/2;
	else
	{
		ans=w;
		ans=ans*(h/2);
		if(h%2!=0)
			ans=ans+w/2+1;
	}
	cout<<ans;
}

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

#define rep(i, x, n) for (int i = x; i < n; i++)
typedef long long ll;

const int INF = 1e9 + 7;

using namespace std;

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

  int n;
  cin >> n;

  vector<int> a(n);
  rep (i, 0, n)
    cin >> a[i];

  ll res = 0;
  int min_v = INT_MAX;
  int count = 0;
  for (int tmp : a) {
    if (tmp < 0) {
      count = ++count % 2;
    }
    min_v = min(min_v, abs(tmp));
    res += abs(tmp);
  }

  if (count)
    res -= (min_v * 2);

  cout << res << endl;

	return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define pb push_back
#define pi acos(-1.0)

int main()
{
    ll i, j, a, b, k, n, m, cnt = 0;
    string s;

    cin >> a >> b;

    ll lcm = (a * b) / __gcd(a, b);

    cout << lcm << endl;

    return 0;
}


Measured memory_bytes: 3608
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
    char S[11];
    int i,N,K;
    char target;
    scanf("%d",&N);
    scanf("%s",S);
    scanf("%d",&K);
    target = S[K-1];
    //printf("%c\n",target);
    //printf("%d\n",strlen(S));
    for(i=0;i<strlen(S);i++){
        if(S[i] != target){
            S[i] = '*' ;
        }
    }
    printf("%s\n",S);
    return 0;
    
}

Measured memory_bytes: 128
n,l = gets.chomp.split(' ').map(&:to_i)
i = 1
s = []
while i <= n
  s << l+i-1
  i += 1
end
max = s.sum # 20
basic = (max-s[0]).abs # 18
i = 0
while i < n
  if (max-(max-s[i])).abs <(max-basic).abs
    basic = max-s[i]
  end
  i += 1
end
p basic

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

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define SORT(v, n) sort(v, v+n)
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define vi vector<int>
#define ddvi vector<vector<int>>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;

int main(){
cin.tie(0);
ios::sync_with_stdio(false);
// ここに処理を記述

    vi card(9,0);
    REP(i,3){
        cin >> card[i*3] >> card[i*3 + 1] >> card[i*3 + 2];
    }

    int N;
    cin >> N;

    int temp = 0;
    for(int i=0; i<N; i++){
        cin >> temp;
        REP(j,9){
            if(temp == card[j]){
                card[j] = 0;
            }
        }
    }

    // ビンゴチェック
    string ans = "No";
    REP(i,3){
        if(card[i*3] == card[i*3 + 1] && card[i*3 + 1] == card[i*3 + 2]) ans = "Yes";
        else if(card[i] == card[i + 3] && card[i + 3] == card[i + 6]) ans = "Yes"; 
    }
    if(card[0] == card[4] && card[4] == card[8]) ans = "Yes";
    else if(card[2] == card[4] && card[4] == card[6]) ans = "Yes";

    cout << ans << endl;

return 0;
}

Measured memory_bytes: 256
N = int(input())
H = list(map(int, input().split()))

for i in range(N):
    H[i] -= 1

for j in range(N-1):
    if H[j] > H[j+1]:
        H[j+1] += 1

if H == sorted(H):
    print('Yes')
else:
    print('No')

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

int main() {
  map<string, int> days{{"SUN", 7}, {"MON", 6}, {"TUE", 5}, {"WED", 4},
                        {"THU", 3}, {"FRI", 2}, {"SAT", 1}};
  string S;
  cin >> S;
  cout << days[S] << endl;
}


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

int main() {
  ll a, b, n;
  cin >> a >> b >> n;
  
  if (n < b-1) cout << a * n / b << endl;
  else cout << a * (b-1) / b << endl;
}

Measured memory_bytes: 3636
//　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　＿,,...　 ...,,_ 　 　 　 　 ,r‐､ 
//　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　　,. -''" : : : : : : : : : :`丶､ 　 ,ｲ: : :| 
//　　, '´￣`丶､　 　 　 　 　 　 　 　 　 　 　 　 　f: : : : : : :_,,..　--――--::;,.ｲ: : :/_,,.　_ 
//　 / 　 　 　 　 `　ー　--――-　､　 　 　 　 　 ゝ __,.r''"　 　 　 　_,,. -―‐‐ﾒｿ´: :_ : :.） 
//　 !　 　 　 　 　 　 　 　 　 　 　 　'´￣´ ´ 丶､　 　｜　 　 　,. -'"　 　 　.／: |ヽ‐''"´ 
//　丶.　 　 　 　 　 　 　 　,r''　 　 　 　 　 　 　 　丶、丶 ..,r'"　 　 　 　.／: : :/　| i 
//　 　 丶 .　 　 　 　 　_,./　 　 ,;;;;,　 　 　 　 　 　 　 ヽ. _ ｛　 　 　 　／: : : :/ 　 !　l 
//　 　 　 　 ￣ ´´ ￣　 { .....　 :;;;;:　 　 　 　 　 　 　 　 丶`ゝ .＿ ／: : : : :.,.'　 　!　 l 
//　 　 　 　 　 　 　 　 　l :::::::::　 　 　 　 　 　 　 　 　 　 　 ／／{: : : : : :／　 　/　｜ 
//　 　 　 　 　 　 　 　 　丶.　 　 　 　(__ 　 ,　 　 ,;;;;;, 　 ／／　 丶､__.／　 　 /　 　i 
//　 　 　 　 　 　 　,. -- ..　 ＞, -‐-, 　 `'''ﾞ 　 　:;;;;;: ／／!　 　 　 　{ 　 　 ／　 　/ 
//　 　 　 　 　 　,.'´ 　 _　ﾞ／ 　 　 /‐- ..,__ 　 　 .／／　｜　 　 　 　ゝ ._／　 　 ./ 
//　 　 　 　 　 　{ 　 f´　/　 　 　 'ﾞ 　 ,f´,-'γ⌒ヽ '::::: ノ丶　 　 　 　 　 {.　 　.／、 
//　 　 　 　 　 　ゝ　丶./ 　 　 　 　 　 {. '‐'"ゝ- ノ´￣　 　 ヽ. 　 　 　 　 ` ー'ﾞ 　 ! 
//　 　 　 　 　 　 　`ー 〉　 　 　 　 　 　￣´ 　イ 　 　 　 　 　 丶､　 　 　 　 　 　ﾉ 
//　 　 　 　 　 　 　 　　{ 　 ､　 　 　 　 　 　 　 | 　 　 　 　 　 　 　 ` ‐-　..... 　‐'" 
//　 　 　 　 　 　 　 　 　`ー'ﾞ` ‐-　...＿＿. 　 / ,.'´´,`!Ｏ ,-v-､,-v-､, - ､,-v-v-､., -, ,-v-、, -, ｲ´lｲ´l 
//　 　 　 　 　 　 　 　 　 　 　 　 　 　 　（__ノ´　{　 ｛-i|´.l1　i　l1 .i　|>┘.l1 i　i　 |　t `! .r-ｲ t `;|　{|　{. 
//　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　ゝ ＿人_]ー'--'ｰ'--'ｰ゜-'-┴┴‐ゝ- ｲ._）　ゝ- ﾍ.._人__） 
//　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　warm　heart，　wagging　tall， 
//　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　 　　and　ａ　smile　just　for　you！ ///
//
//　,.'´´,`!Ｏ ,-v-､,-v-､, - ､,-v-v-､., -, ,-v-、, -, ｲ´lｲ´l 
//　{　 ｛-i|´.l1　i　l1 .i　|>┘.l1 i　i　 |　t `! .r-ｲ t `;|　{|　{. 
//　ゝ ＿人_]ー'--'ｰ'--'ｰ゜-'-┴┴‐ゝ- ｲ._）　ゝ- ﾍ.._人__） 
//　 　 　 　warm　heart，　wagging　tall， 
//　 　 　 　 and　ａ　smile　just　for　you！

#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
#define INF 1LL<<50
#define fst first
#define sec second
#define pb push_back
#define int long long
#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ITR(itr,mp) for(int itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(int itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define debug(x)  cout << #x << " = " << (x) << endl;
typedef long long ll;
typedef pair<ll,ll> P;

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

  ll a,b,x;
  cin >> a >> b >> x;
  
  cout << b/x - (a==0?-1:(a-1)/x) << endl;

  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double w = sc.nextDouble();
        double h = sc.nextDouble();
        double x = sc.nextDouble();
        double y = sc.nextDouble();
        if (x == w / 2 && y == h / 2) {
            System.out.print(h * w / 2 + " " + 1);
        } else {
            System.out.print(h * w / 2 + " " + 0);
        }
    }

}

Measured memory_bytes: 23252