akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
 
public class Main {
	private static  BufferedReader  br = null;

	static {
		br = new BufferedReader(new InputStreamReader(System.in));
	}

	/**
	* @param args
	*/
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int cnt = parseNum();
		while (cnt-- > 0) {
			parseSnake();
		}
	}

	private static void parseSnake() {
		int     typ = 0;
		String  str = null;

		if ((str = parseStdin()) != null) {
			int	len = str.length();
			if (len > 2 && len%2 == 0) {
				if (str.charAt(0) == '>') {
					if (str.charAt(1) == '\'' && len > 3) {
						if (str.charAt(len-1) == '~' && str.charAt(len-2) == '=') {
							if (str.charAt(2) == '=') {
								char	stc = 0;
								int		mid = 2+(len-4)/2;
								for (int i = 2; i < len-1; i++) {
									stc = str.charAt(i);
									typ = (i == 2) ? 1 : typ;
									if ((stc != '=' && stc != '#') || (stc == '#' && i != mid) || (stc != '#' && i == mid)) {
										typ = 0;
										break;
									}
								}
							}
						}
					}
					else if (str.charAt(1) == '^' && len > 4) {
						if (str.charAt(len-1) == '~' && str.charAt(len-2) == '~' && str.charAt(len-3) == '=') {
							char	sc1 = 0;
							char	sc2 = 0;
							for (int i = 2; i+1 < len-2; i += 2) {
								typ = (i == 2) ? 2 : typ;
								sc1 = str.charAt(i);
								sc2 = str.charAt(i+1);
								if (sc1 != 'Q' || sc2 != '=') {
									typ = 0;
									break;
								}
							}
						}
					}
				}
			}
		}

		switch (typ) {
		case	1:
			System.out.println("A");
			break;
		case	2:
			System.out.println("B");
			break;
		default:
			System.out.println("NA");
			break;
		}
	}

	private static int parseNum() {
		int     num = 0;
		String  str = null;

		if ((str = parseStdin()) != null) {
			num = Integer.parseInt(str);
		}

		return num;
	}

	private static String parseStdin() {
		String  stdin = null;

		try {
			String  tmp = br.readLine();
			if (tmp != null) {
				if (!tmp.isEmpty()) stdin = tmp;
				}
			}
		catch (IOException e) {}

		return stdin;
	}
}

Measured memory_bytes: 22428
N, M = map(int,input().split())
L = []
R = []
for i in range(M):
  l, r = map(int,input().split())
  L.append(l)
  R.append(r)

max_l = max(L)
min_r = min(R)
print(max(min_r - max_l + 1, 0))
    

Measured memory_bytes: 11052
#include<stdio.h>
int main(void)
{
	int a,b,d,r;
	scanf("%d",&a);
	scanf("%d\n",&b);
	printf("%d\n",a/b);
	printf("%d\n",a%b);
	printf("%.6lf\n",1.00000*a/b);
	return 0;
}
		

Measured memory_bytes: 644
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;

#ifdef LOCAL
#define Gene template< class
#define Rics printer& operator,
Gene c> struct rge{c b, e;};
Gene c> rge<c> range(c i, c j){ return {i, j};}
struct printer{
    ~printer(){cerr<<endl;}
    Gene c >Rics(c x){ cerr<<boolalpha<<x; return *this;}
    Rics(string x){cerr<<x;return *this;}
    Gene c, class d >Rics(pair<c, d> x){ return *this,"(",x.first,", ",x.second,")";}
    Gene ... d, Gene ...> class c >Rics(c<d...> x){ return *this, range(begin(x), end(x));}
    Gene c >Rics(rge<c> x){
        *this,"["; for(auto it = x.b; it != x.e; ++it)
            *this,(it==x.b?"":", "),*it; return *this,"]";}
};
#define debug() cerr<<"LINE "<<__LINE__<<" >> ", printer()
#define dbg(x) "[",#x,": ",(x),"] "
#define bits(x) bitset<22>(x)
#define tham getchar()
#endif

#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define eq(x, y) (fabs((x)-(y))<error)
#define bt(i) (1LL<<(i))

mt19937_64 rng((unsigned)chrono::system_clock::now().time_since_epoch().count());
//const ll mod = ;
//const ld error = ;
const ld PI = acosl(-1);

//inline ll MOD(ll x, ll m = mod){
//    ll y = x % m;
//    return (y >= 0) ? y: y+m;
//}

//const int/ll inf = ;
//const int nmax = 2e5+10;
///===========================================  template  =======================================================

vector<ll> divisors;
void factorize(ll n){

    for(ll i = 1; i*i <= n; i++){
        if(n % i != 0) continue;
        divisors.push_back(i);
        if(i != n/i)
            divisors.push_back(n/i);
    }
}

ll egcd(ll a, ll b, ll &x, ll &y){
    if(a == 0) {x = 0, y = 1; return b;}

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

int main(){
    FASTIO;

    ll n;
    cin>>n;

    if(n == 1){
        cout<<1<<endl;
        return 0;
    }

    n*= 2;

    factorize(n);

    ll ans = n-1;
    for(ll d : divisors){
        ll e = n/d;

        ll x, y;
        if(egcd(d, e, x, y) != 1) continue;
//        debug(), dbg(d), dbg(e), dbg(x), dbg(y);
//        tham;

        if(x == 0 || y == 0) continue;

        if(x < 0){
            x += e;
            y -= d;
        }

        assert(x > 0 && y < 0);

        ans = min(ans, -y*e);
    }

    cout<<ans<<endl;

    return 0;
}


Measured memory_bytes: 3780
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Practice
{
    class Program
    {
        private static int ReadAndParseInt()
        {
            return int.Parse(Console.ReadLine());
        }
        private static int[] ReadAndParseIntArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
        }
        private static long ReadAndParseLong()
        {
            return long.Parse(Console.ReadLine());
        }
        private static long[] ReadAndParseLongArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);
        }
        static void Main(string[] args)
        {
            //SolveA(args);
            SolveB(args);
            //SolveC(args);
            //SolveD(args);


        }
        
        private static void SolveB(string[] args)
        {
            int[] xy = ReadAndParseIntArr();
            int val = gcd(xy[0], xy[1]);
            Console.WriteLine(val);
        }
        private static int gcd(int x, int y)
        {
            if( y > x)
            {
                int tmp = y;
                y = x;
                x = tmp;
            }

            while(y > 0)
            {
                int r = x % y;
                x = y;
                y = r;
            }
            return x;
        }
    }
}



Measured memory_bytes: 15972
#include<cstdio>
#include<bits/stdc++.h>
typedef long long int ll;
#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOR_IN(i, a, b) for(int i = (a); i < (b); i++)
#define BETWEEN(x, a, b) ((x) >= (a) && (x) <= (b))

using namespace std;

/*

 */

char s[1001], t[1001];
int dp[1001][1001];

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

  int ls = strlen(s);
  int lt = strlen(t);
  
  REP(i,ls+1)
    dp[i][0] = i;

  REP(j,lt+1)
    dp[0][j] = j;

  REP(i,ls){
    REP(j,lt){
      if(s[i]==t[j])
        dp[i+1][j+1] = dp[i][j];
      else
        dp[i+1][j+1] = min(dp[i][j]+1, min(dp[i+1][j]+1, dp[i][j+1]+1));
    }
  }

  cout << dp[ls][lt] << endl;

  return 0;
}


Measured memory_bytes: 7016
#include <iostream>
#include <cmath>
#include <string>
#include <map>
#include <queue>

using namespace std;
const int N = 3;
const int N2 = 9;

struct Puzzle{
    int f[N2];
    int space;
    string path;

    bool operator < (const Puzzle &p) const{
        for (int i = 0; i < N2 ; ++i) {
            if (f [i] == p.f[i])continue;
            return f[i] > p.f[i];
        }
        return false;
    }
};

static const int dx[4] = {-1,0,1,0};
static const int dy[4] = {0,-1,0,1};
static const char dir[4] ={'u','l','d','r'};

bool isTarget(Puzzle p){
    for (int i = 0; i < N2 ; ++i)
        if (p.f[i] != (i + 1) ) return false;
    return true;
}

string bfs(Puzzle s){
    queue<Puzzle> Q;
    map<Puzzle,bool> V;
    Puzzle u,v;
    s.path = "";
    Q.push(s);
    V[s] = true;

    while(! Q.empty()){
        u = Q.front();Q.pop();
        if(isTarget(u)) return u.path;
        int sx = u.space / N;
        int sy = u.space % N;
        for (int r = 0; r < 4 ; ++r) {
            int tx = sx + dx[r];
            int ty = sy + dy[r];
            if( tx < 0 or ty < 0 or tx >= N or ty >= N ) continue;
            v = u;
            swap(v.f[u.space],v.f[tx * N + ty]);
            v.space = tx * N +ty;
            if (!V[v]){
                V[v] = true ;
                v.path += dir[r];
                Q.push(v);
            }
        }
    }
    return "unsolvable";
}

int main(){
    Puzzle in;
    for (int i = 0; i < N2 ; ++i) {
        cin >> in.f[i];
        if (in.f[i] == 0){
            in.f[i] = N2;
            in.space = i;
        }
    }
    string ans = bfs(in);
    cout << ans.size () << endl;
    return 0 ;
}

Measured memory_bytes: 28676
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC066A
{
	class Program
	{
		static void Main(string[] args)
		{
			int a, b, c ,s;

			string[] word = Console.ReadLine().Split(' ');

			a = int.Parse(word[0]);
			b = int.Parse(word[1]);
			c = int.Parse(word[2]);

			// a,b,cの最大値を求める
			int m = a;
			if (b > m) m = b;
			if (c > m) m = c;
//最大値を除いている
			s = a + b + c - m;

					
			 
			Console.WriteLine(s);

			//Console.ReadKey();
		}
	}
}


Measured memory_bytes: 27080
#include<cstdio>
#include<iostream>
#include<algorithm>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;

int main() {
	int a[3];
	int n;
	cin >> n;
	while (n--) {
		rep(i, 3)cin >> a[i];
		sort(a, a + 3);
		if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) {
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}
	return 0;
}

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

int main() {
  int B, R;
  cin >> B;
  map<string,int>data;
  for(int i=0;i<B;i++){
    string s;
    cin >> s;
    if(data.count(s)) data.at(s)++;
    else data[s]=1;
  }
  cin >> R;
  for(int i=0;i<R;i++){
    string s;
    cin >> s;
    if(data.count(s)) data.at(s)--;
    else data[s]=-1;
  }
  int count=0;
  int a=data.size();
  for(auto p:data){
    auto value=p.second;
    count=max(value,count);
  }
  cout << count << endl;
}


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

int main() {
	int N;
	int F[100][10];
	int P[100][11];
	cin >> N;
	for(int i=0; i<N; ++i) {
		for(int j=0; j<10; ++j) {
			cin >> F[i][j];
		}
	}
	for(int i=0; i<N; ++i) {
		for(int j=0; j<11; ++j) {
			cin >> P[i][j];
		}
	}
	long long ans = -(1LL << 60);
	for(int s=1; s<(1<<10); ++s) {
		int C[100] = {0};
		for(int i=0; i<N; ++i) {
			for(int j=0; j<10; ++j) {
				if((s >> j) & F[i][j]) ++C[i];
			}
		}
		long long tmp = 0;
		for(int i=0; i<N; ++i) {
			tmp += P[i][C[i]];
		}
		ans = max(ans,tmp);
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main{ 
  
  	static long min=-1;
  	static int n, m, x;
	public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
       n =sc.nextInt();
       m=sc.nextInt();
       x=sc.nextInt();
      
      int skill[]=new int[m+1];
      int grid[][]=new int[n+1][m+1];
      for(int i=1;i<=n;i++){
      	for(int j=0;j<=m;j++){
        	grid[i][j]=sc.nextInt();       
        }
      }
      
      rec(1,skill,grid,0);
      System.out.println(min);
    }
  
  	static void rec(int i,int skill[],int grid[][],long cost){
    	if(i>n) return;
      	int skill2[]=new int[m+1];
      	boolean flag1=true;
      	for(int j=1;j<=m;j++){
          skill2[j]=skill[j]+grid[i][j];
          if(skill2[j]<x) flag1=false;
        }
      	if(flag1){
        	if(min == -1 || cost+grid[i][0] < min) min=cost+grid[i][0];
        }
      	//if i select this book
      	rec(i+1,skill2,grid,cost+grid[i][0]);
      
      	//don't select
      	rec(i+1,skill,grid,cost);    
    }
}

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

using namespace std;
int main(){
    int N;

    cin >> N;
    int a[N];
    double gu;
    for(int i = 0; i < N;i++){ 
        cin >> a[i];
    }
    sort(a,a+N);//,greater<int>());
    for(int i = 0; i < N;i++){ 
        if(i==0){
            gu = a[0];
            continue;
        } 

        gu = (gu+a[i])/2.0;
    }
    cout << gu << endl;
}

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

long long r,d,x;

int main(){

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin>>r>>d>>x;
    for(int i=1;i<=10;i++){
        x=r*x-d;
        cout<<x<<endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
using namespace std;
int main(){
    int n,cnt=0,ans=0;
    bool flag;
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;i++)    cin >> a[i];
    flag = false;
    for(int i=1;i<n;i++){
        if(a[i]==a[i-1]){
            flag = true;
            cnt++;
        }
        else{
            if(flag){
                flag = false;
                ans+=(cnt+1)/2;
                cnt=0;
            }
        }
    }
    if(flag)    ans+=(cnt+1)/2;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstring>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int main(){

	int w,h;
	while(cin>>h>>w&&!(w==0&&h==0)){
		vector<string> field;
		string str;
		for(int i = 0; i < h; i++){
			cin>>str;
			field.push_back(str);
		}
		bool isPassed[200][200];
		memset(isPassed,0,sizeof(isPassed));
		int sy,sx;
		sy=sx=0;
		bool f=true;
		while(1){
			if(isPassed[sy][sx]){
				f=false;
				break;
			}
			isPassed[sy][sx]=true;
			if(field[sy][sx]=='>'){
				sx++;
			}
			else if(field[sy][sx]=='<'){
				sx--;
			}
			else if(field[sy][sx]=='v'){
				sy++;
			}
			else if(field[sy][sx]=='^'){
				sy--;
			}
			else
				break;
		}
		if(!f){
			cout<<"LOOP"<<endl;
		}
		else
			cout<<sx<<" "<<sy<<endl;
	}

	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#define MOD 1e9+7
using namespace std;
#define  pp push_back
#define  po pop_back
#define  mp make_pair
#define clr(a) memset(a,0,sizeof(a))
#define neg(a) memset(a,-1,sizeof(a))
#define fas(a) memset(a,false,sizeof(a))
#define debug(x) cout<<#x<<": "<<x<<endl
#define debug1(x) cout<<#x<<": "<<x<<" "
#define rev(x) reverse(x.begin(), x.end())
#define int long long 
#define F first
#define S second
//int a[2000];
void printvector(std::vector<int> v){  for (int i = 0; i < v.size(); ++i){cout<<v[i]<<" ";}cout<<""<<endl;}
void printarray(int a[],int n){for (int i = 0; i < n; ++i){cout<<a[i]<<" ";}cout<<""<<endl;}
 


int check(string s)
{
    char x='@';
    int ans=0;
    int l=0;
    for(auto it:s)
    {
       if(it!=x)
       {
          ans+=l/2;
          l=0;
          x=it;
       }

       l++;
    }
    ans+=l/2;
    return ans;
} 

 

void  solve()
{
   string s;cin>>s;
   bool al=true;
   for(int i=1;i<s.length();i++)if(s[i]!=s[i-1])al=false;
   int k;cin>>k;
   if(al)cout<<(s.length()*k)/2<<endl;
   else cout<<check(s)+(k-1)*(check(s+s)-check(s));

  
}




 int32_t main() 
{

 
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
    
   solve();

return 0;

}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

ll dp[3003][3003][5];
int items[3000][3000];

int main() {
    // dp、行が変わるところに注目
    int R, C, K;
    cin >> R >> C >> K;
    --R; --C;
    rep(i, K) {
        int r, c, v;
        cin >> r >> c >> v;
        --r; --c;
        items[r][c] = v;
    }
    dp[0][0][1] = items[0][0];
    for (int i = 0; i <= R; i++) {
        for (int j = 0; j <= C; j++) {
            for (int k = 0; k <= 3; k++) {
                dp[i][j+1][k] = max(dp[i][j+1][k], dp[i][j][k]);
                dp[i][j+1][k+1] = max(dp[i][j+1][k+1], dp[i][j][k] + items[i][j+1]);

                dp[i+1][j][0] = max(dp[i+1][j][0], dp[i][j][k]);
                dp[i+1][j][1] = max(dp[i+1][j][1], dp[i][j][k] + items[i+1][j]);
            }
        }
    }
    ll ans = 0;
    // show(dp[R][C]);
    // cout << "--------" << '\n';
    // show(dp[0][2]);
    // show(dp[4][1]);
    rep(i, 4) ans = max(ans, dp[R][C][i]);
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 390620
#include <cstdio>

int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  int x = 4 * a - b, y = b - 2 * a;
  if (x < 0 || y < 0) return puts("No"), 0;
  if (x & 1 || y & 1) return puts("No"), 0;
  puts("Yes");
  return 0;
}

Measured memory_bytes: 1664
#include <iostream>
#define MAXCARD 201
using namespace std;

int t_card[MAXCARD];
int numt;
int h_card[MAXCARD];
int numh;
int turn;//1??????????????????????????±???
int temp,n;
int main(){
	while(1){
		cin >>n;
		if(n==0)break;
		for(int i=1;i<=2*n;i++){
			t_card[i]=0;
			h_card[i]=0;
		}
		for(int i=0;i<n;i++){
			cin >> temp;
			t_card[temp]=1;
		}
		for(int i=1;i<=2*n;i++){
			if(t_card[i]==0)h_card[i]=1;
		}

		numt=numh=n;
		turn=1;
		while(1){
			if(numt==0||numh==0)break;
			for(int i=1;i<=2*n;i++){
				if(turn==1&&t_card[i]==1){
					turn=2;
					t_card[i]=0;
					numt--;
				}else if(turn==2&&h_card[i]==1){
					turn=1;
					h_card[i]=0;
					numh--;
				}
				if(numt==0||numh==0)break;
			}
			if(turn==1){
				turn=2;
			}else{
				turn=1;
			}
		}
		cout << numh<<endl;
		cout << numt<<endl;

	}
	return 0;
}

Measured memory_bytes: 3036
#n=int(input())
#L=list(map(int,input().split()))
a,b=map(int,input().split())
#A=[[0 for i in range()] for j in range()]
#l = [int(input()) for i in range(N)]
b-=1
a-=1
if b%a!=0:
  print(b//a+1)
else:
  print(b//a)

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

#define pb push_back
#define mp make_pair
#define sqr(a) ((a) * (a)) 
#define io() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

typedef long long int li;
typedef long double ld;

li po(li x,li y) 
{ 
    li mod=1e9+7;
    li res = 1;    
    x = x % mod;  
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % mod; 
        y = y>>1; 
        x = (x*x) % mod; 
    } 
    return res; 
}

int main()
{
    io();
    li m,n;
    cin>>n;
    li i,j,ans=0;
    for(i=-200;i<=200;++i)
    {
        for(j=-200;j<=200;++j)
        {
            if(i*i*i*i*i - j*j*j*j*j ==n)
            {
                cout<<i<<" "<<j;
                return 0;
            }
        }
    }
     cout<<"\n";
}    

Measured memory_bytes: 3656
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define Rep(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll,vector<ll>,greater<ll>> SMALLPQ;
using vi=vector<ll>;
using vvi=vector<vector<ll>>;
using vc=vector<char>;
using vvc=vector<vector<char>>;
const int inf=1000000007;
const int mod=1000000007;
void chmin(auto &a,auto b){if(b<a)a=b;}
void chmax(auto &a,auto b){if(a<b)a=b;}
//abc129e 桁dp
int main(){
  string s;cin>>s;
  int n=s.size();
  vvi dp(2,vi(n));
  //0は確定,1は一致
  dp[0][0]=1;
  dp[1][0]=2;
  Rep(i,1,n){
    if(s[i]=='0'){
      dp[0][i]=dp[0][i-1]*3%mod;
      dp[1][i]=dp[1][i-1];
    }
    else{
      dp[0][i]=(dp[0][i-1]*3+dp[1][i-1])%mod;
      dp[1][i]=dp[1][i-1]*2%mod;
    }
  }
  cout<<(dp[0][n-1]+dp[1][n-1])%mod<<endl;
}


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

using namespace std;

int main(){
    string input;
    while(cin >> input){
        int ans = 0;
        for(int i=0; i < input.size(); i++){
            string n = input.substr(i, 1);
            if(n == "I") ans++;
            else if(n == "V") ans+=5;
            else if(n == "X") ans+=10;
            else if(n == "L") ans+=50;
            else if(n == "C") ans+=100;
            else if(n == "D") ans+=500;
            else if(n == "M") ans+=1000;
            if(i != 0){
                if(input.substr(i-1, 1) == "I"){
                    if(n == "V" || n == "X") ans-=2;
                }
                else if(input.substr(i-1, 1) == "X"){
                    if(n == "L" || n == "C") ans-=20;
                }
                else if(input.substr(i-1, 1) == "C"){
                    if(n == "D" || n == "M") ans-=200;
                }
            }
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 1192
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b;
  cin >> a >> b;
  if(a+b == 15){
  	cout << "+" << endl;
  }else if(a*b == 15){
  	cout << "*" << endl;
  }else{
  	cout << "x" << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>

using namespace std;

typedef long long ll;
typedef pair <int , int> ii ;
typedef vector <int> vi ;
typedef vector <ii> vii ;

#define all(v) v.begin(), v.end()

const int mod = 1e9 + 7 ;

map <char , int> mp[13] ;

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

    mp[1]['d'] = 2 ;
    mp[2]['r'] = 3 ;
    mp[3]['e'] = 4 ;
    mp[4]['a'] = 5 ;
    mp[5]['m'] = 6 ;

    mp[1]['e'] = 7 ;
    mp[7]['r'] = 8 ;
    mp[8]['a'] = 9 ;
    mp[9]['s'] = 10 ;
    mp[10]['e'] = 11 ;
    mp[11]['r'] = 12 ;

    mp[6]['d'] = 2 ;
    mp[6]['e'] = 11 ;

    mp[11]['e'] = 7 ;
    mp[11]['d'] = 2 ;

    mp[12]['a'] = 9 ;
    mp[12]['e'] = 7 ;
    mp[12]['d'] = 2 ;

    int st = 1 ;
    string s ;
    cin >> s ;

    for (int i = 0 ; i < s.size() ; i++) {
        st = mp[st][s[i]] ;
        //cout << st << endl ;
        if (st) {

        }
        else {
            cout << "NO\n" ;
            return 0 ;
        }
    }

    if (st == 6 or st == 11 or st == 12)
        cout << "YES\n" ;
    else
        cout << "NO\n" ;
    return 0 ;
}

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


int main()
{
  string n;
  cin >> n;
  if(n[2] == n[3] && n[4] == n[5])
  {
   cout << "Yes" << endl; 
  }
  else
  {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
 
using namespace std;
 
typedef long long ll;
 
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;
 
#define MOD 1000000007

int main() {
	string s;
	cin>>s;
	ll flag = 1;
	rep(i,0,s.sz-1){
		if(s[i]==s[i+1])flag=0;
	}
	if(flag==1){
	    cout << "Good" << endl;
	}
	else{
	    cout << "Bad" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
  
int main() {
  int X,Y;
  cin >> X >> Y;
  int ans = 0;
  ans += max(0,4-X) * 100000;
  ans += max(0,4-Y) * 100000;
  if(X == 1 && Y == 1) {
    ans += 400000;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  int n=s.size();
  int k=0;
  for(int i=0;i<(n+1)/2;i++){
    if(s.at(i)!=s.at(n-1-i)){k++;}
  }
  cout<<k<<endl;    
}

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

// int/long:		-2,147,483,648 - 2,147,483,648 (-2^31 <= int < 2^31)
// long/long long:	-9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 (-2^63 <= long < 2^63)

#define	INF (1<<29)
//536,870,912

// lower_bound(A.begin(), A.end(), N)
// upper_bound(...

// A.erase(unique(A.begin(), A.end()), A.end())

// bit: &/and, |/or, ^/xor, ~/not

// getline(cin, String)

// Graph
// Warshall-Floyd: Distance between each node, N^3
// Dijkstra: Distance from the start node, N^2
// DFS(Depth-First Search)

#define	MOD 1000000007

int	main() {
	string O, E;
	cin >>O >>E;
	for (int i=0; i<E.size(); i++)
		cout <<O.at(i) <<E.at(i);
	if (E.size()!=O.size())
		cout <<O.back();
	cout <<endl;
	return 0;
}



Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <cmath>
#include <iostream>
#include <limits>
#include <queue>
#include <set>
#include <vector>

using namespace std;

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

template <class T>
using nm = numeric_limits<T>;

using i64 = int64_t;
using i32 = int32_t;
using u64 = uint64_t;
using u32 = uint32_t;

template <class T>
struct mat : public vector<vector<T>> {
  mat(size_t h, size_t w) : vector<vector<T>>(h) {
    for (auto& row : *this) row.resize(w);
  }
  size_t h() const { return this->size(); }
  size_t w() const { return this->back().size(); }
};

template <class T>
ostream& operator<<(ostream& os, vector<T> const& v) {
  rep(i, v.size() - 1) os << v[i] << ' ';
  if (!v.empty()) os << v.back();

  return os;
}

template <class T>
ostream& operator<<(ostream& os, mat<T> const& m) {
  rep(y, m.size() - 1) os << m[y] << endl;
  if (!m.empty()) os << m.back();
}

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

  vector<i64> ruiseki(N);
  rep(i, N) {
    i64 in;
    cin >> in;
    if (i == 0)
      ruiseki[i] = in;
    else
      ruiseki[i] = in + ruiseki[i - 1];
  }

  i64 ans = nm<i64>::max();
cerr << ruiseki[0] << ' ' << ruiseki[1] << endl;
cerr << ruiseki[N-1] - ruiseki[0]<< endl;
  rep(i, N - 1) {
   cerr << "i: " << i << ", ruiseki[i]: " << ruiseki[i] << endl;
   auto mx =  max(ruiseki[i], (ruiseki[N - 1] - ruiseki[i]));
   auto mi =  min(ruiseki[i], (ruiseki[N - 1] - ruiseki[i]));
    cerr << mx << ' ' << mi << endl;
   auto v = mx - mi;
    ans = ans < v ? ans : v;
  }
  cout << ans << endl;

  return 0;
}



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

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)

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


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
const int dx[]={1,0,-1,0,1,-1,-1,1,2,0,-2,0};
const int dy[]={0,1,0,-1,1,1,-1,-1,0,2,0,-2};
const int INF = 1<<30;
const double EPS = 1e-8;
#define PB push_back
#define mk make_pair
#define fr first
#define sc second
#define ll long long
#define reps(i,j,k) for(int i = (j); i < (k); i++)
#define rep(i,j) reps(i,0,j)
#define MOD 1000000007
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
typedef pair<int,int> Pii;
typedef pair<Pii,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
int Y[100];
int X[100];
int T[100];
int SZ;
int n;
bool F;
bool checkS(int stage[10][10],int y,int x,int type){
	int cy = y + 1;
	int cx = x;
	if(type < 0){
		if(stage[cy][cx] == 0)return false;
		rep(i,4){
			if(stage[cy+dy[i]][cx+dx[i]] == 0)return false;
		}
	}
	stage[cy][cx] += type;
	rep(i,4){
		stage[cy+dy[i]][cx+dx[i]] += type;
	}
	return true;
}
bool checkM(int stage[10][10],int y,int x,int type){
	int cy = y + 1;
	int cx = x + 1;
	if(type < 0){
		if(stage[cy][cx] == 0)return false;
		rep(i,8){
			if(stage[cy+dy[i]][cx+dx[i]] == 0)return false;
		}
	}
	stage[cy][cx] += type;
	rep(i,8){
		stage[cy+dy[i]][cx+dx[i]] += type;
	}
	return true;	
}
bool checkL(int stage[10][10],int y,int x,int type){
	int cy = y + 2;
	int cx = x;
	if(type < 0){
		if(stage[cy][cx] == 0)return false;
		rep(i,12){
			if(stage[cy+dy[i]][cx+dx[i]] == 0)return false;
		}
	}
	stage[cy][cx] += type;
	rep(i,12){
		stage[cy+dy[i]][cx+dx[i]] += type;
	}
	return true;
}
void solve(int y,int x,int len,int stage[10][10]){
	if(F)return ;
	if(x == 10){
		y++;
		x = 0;
	}
	if(y == 10){
		if(len == n){
			SZ = len;
			rep(i,SZ){
		    	printf("%d %d %d\n",X[i],Y[i],T[i]);
		    }
			F = true;
		}
		return ;
	}
	if(stage[y][x] == 0){
		solve(y,x+1,len,stage);
	}
	if(checkS(stage,y,x,-1)){
		Y[len] = y+1;
		X[len] = x;
		T[len] = 1;
		solve(y,x+1,len+1,stage);
		solve(y,x,len+1,stage);
		checkS(stage,y,x,1);
		Y[len] = 0;
		X[len] = 0;
		T[len] = 0;
	}
	if(checkM(stage,y,x,-1)){
		Y[len] = y+1;
		X[len] = x+1;
		T[len] = 2;
		solve(y,x+1,len+1,stage);
		solve(y,x,len+1,stage);
		checkM(stage,y,x,1);
		Y[len] = 0;
		X[len] = 0;
		T[len] = 0;
	}
	if(checkL(stage,y,x,-1)){
		Y[len] = y+2;
		X[len] = x;
		T[len] = 3;
		solve(y,x+1,len+1,stage);
		solve(y,x,len+1,stage);
		checkL(stage,y,x,1);
		Y[len] = 0;
		X[len] = 0;
		T[len] = 0;
	}
	return ;
}
int main(){
    int stage[10][10]={{0}};
    scanf("%d",&n);
    rep(i,10){
        rep(j,10){
            scanf("%d",&stage[i][j]);
        }
    }
    solve(0,0,0,stage);
    return 0;
}

Measured memory_bytes: 1196
#include<stdio.h>

main(void)
{
  int a,b;
  int gokei=0;
  
  scanf("%d %d",&a,&b);
  
  if(((a>=3)&&(a<=20))&&((b>=3)&&(a<=20)))
  {
    if(a>=b)
    {
      gokei = a;
      a = a - 1;
    }
    else
    {
      gokei = b;
      b = b - 1;
    }
    
    if(a>b)
      gokei = gokei + a;
    else
      gokei = gokei + b;
  }
  printf("%d",gokei);
  
  return 0;
}

Measured memory_bytes: 128
using System;
class Program
{
    static void Main()
    {
        string beta;
        char[] delta = new char[250];
        string[] epsilon = new string[30];
        int w = 0;
        int gamma;

        while (true)
        {
            beta = Console.ReadLine();
            if (beta == "-") break;
            delta = beta.ToCharArray();
            int times = int.Parse(Console.ReadLine());
            for (int i = 0; i < times; i++)
            {
                gamma = int.Parse(Console.ReadLine());
                if (epsilon[w] != null)
                {
                    delta = new char[250];
                    delta = epsilon[w].ToCharArray();
                    epsilon[w] = "";
                }
                for (int j = gamma; j < delta.Length; j++)
                { epsilon[w] += delta[j].ToString(); }
                for (int j = 0; j < gamma; j++)
                { epsilon[w] += delta[j].ToString(); }

            }
            w++;
        }
        for (int i = 0; i < w; i++)
        { Console.WriteLine(epsilon[i]); }
    }
}



Measured memory_bytes: 20072
#include <stdio.h>
 
int  main(void){
         int h,w,i,j;
          while(1){
          scanf("%d %d",&h,&w);
           if( h==0 && w==0)
              break;
           for(i=1; i<=h; i++){
            for(j=1; j<=w; j++){
              if((i+j)%2 == 0)
              printf("#");
             else
              printf(".");
             }printf("\n");
            }printf("\n");
           }
            return 0;
}

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

int main() {
	// your code goes here
	int k;cin>>k;
	string s;cin>>s;
	int n=s.size();
	if(n>k)
	{
	    for(int i=0;i<k;i++) cout<<s[i];
	    cout<<"...";
	}
	else cout<<s;
	return 0;
}


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

int main() {
    string n; cin >> n;
    ll x = 0;
    for (auto &num: n) {
        x += (int)num-'0';
        x %= 9;
    }
    cout << (x % 9 == 0 ? "Yes" : "No") << endl;
}


Measured memory_bytes: 3708
//保留所有权利。
#include<iostream>
#include<stdio.h>//printするよ
#include<vector>
#include<algorithm>//辞書順はnext_permutationだよ
#include<set>
#include<string>
#include<string.h>
#include<time.h>
#include<random>
#include<cmath>
#include<math.h>
#include<queue>
#include<time.h>
#include<iomanip>
#include<utility>//swapで数値交換するよ
//END OF LIBRARIES.
#define rt "\n"//改行を最速化させるよ
#define rep(i,n) for(int i=0;i<n;i++)
#define rop(i,n) for(int i=1;i<=n;i++)
#define drep(i,n) for(int i=n-1;0<=i;i--)
#define yes(ans) if(ans)cout<<"yes"<<rt;else cout<<"no"<<rt;
#define Yes(ans) if(ans)cout<<"Yes"<<rt;else cout<<"No"<<rt;
#define YES(ans) if(ans)cout<<"YES"<<rt;else cout<<"NO"<<rt;
#define vsort(data) sort(data.begin(),data.end(),greater<int>());
#define vcin(v) for (int i = 0; i < (v).size(); i++) { cin >> (v)[i]; }
#define reve(s) reverse(s.begin(),s.end())
#define sort(s) sort(s.begin(),s.end())
#define asas int ans=0
#define cncn int cnt=0
#define smsm int sum=0
#define str srting
#define nn int n=0
#define please return
#define AC 0//おまじないだよ
#define Rapid cin.tie(0);ios::sync_with_stdio(false)
//END OF DEFINE.
using namespace std;
typedef vector<int> vint;
typedef long long ll;
typedef vector<string> vstr;
typedef vector<char> vcha;
typedef vector<double> vdou;
typedef long long int llint;
typedef pair<int, int> pint;
typedef pair<llint, llint> pllint;
typedef vector<llint> vllint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pair<llint, llint>> vpllint;
typedef vector<vector<int>> vvint;
typedef vector<vector<llint>> vvllint;
typedef vector<vector<pint>> vvpint;
typedef vector<bool> vbool;
//END OF TYPEDEF.

//最大公約数（GCD）を求めるよ
//最小公倍数（LCM）は＜＜　A × B ÷ GCD　 ＞＞で求まるよ

long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}
long long LCM(long long a, long long b) {
	return a * b / GCD(a, b);
}
int x = 0, y = 0;
//BEGIN OF CODE.
int main(void) {
	llint n, k;
	cin >> n >> k;
	vllint h((int)n);
	rep(i, n)cin >> h[i];
	sort(h);
	reve(h);
	llint cnt = 0;
	int i = 0;
	while(i<n){
		if (k == 0) {
			cnt += h[i];
		}
		else {
			if (k != 0)k--;
			h[i] = 0;
		}
		i++;
	}
	cout<<cnt<<endl;
	please AC;
}
//THE END.

Measured memory_bytes: 1792
use proconio::input;

#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars, Usize1};
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
#[allow(unused_imports)]
use std::ops::*;

#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord)]
struct Struct;

#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord)]
struct Status {
    neg_time: i64,
    pos: usize,
    silver: usize,
}

//解説を見て作成
//#[proconio::fastout]
fn main() {
    input! {
        n: usize,
        m: usize,
        mut silver: usize,
        u_v_cost_time:[(Usize1,Usize1,usize,i64);m],
        xchg_silver_time:[(usize,i64);n],
    }

    let mut e = vec![Vec::new(); n];
    for (u, v, cost, time) in u_v_cost_time {
        e[u].push((v, cost, time));
        e[v].push((u, cost, time));
    }

    let max_silver = 50 * n;
    silver = min(silver, max_silver);

    const MAX_TIME: i64 = 1000_000_000_000_000_000i64;
    let mut dp = vec![vec![MAX_TIME; max_silver + 1]; n]; // dp[pos][silver] = time

    let mut q = BinaryHeap::new();
    q.push(Status {
        neg_time: 0,
        pos: 0,
        silver,
    });
    dp[0][silver] = 0;

    let mut ans = vec![MAX_TIME; n];
    ans[0] = 0;
    let mut ct = 1;

    while let Some(s) = q.pop() {
        //println!("{} {} {}", s.neg_time, s.pos, s.silver);
        if ans[s.pos] == MAX_TIME {
            ans[s.pos] = -s.neg_time;
            ct += 1;
            if ct == n {
                break;
            }
        }

        let mut ff = |time: i64, pos: usize, silver| {
            if dp[pos][silver] > time {
                dp[pos][silver] = time;
                q.push(Status {
                    neg_time: -time,
                    pos,
                    silver,
                });
            }
        };

        // 移動した場合
        for (pos, cost, time) in &e[s.pos] {
            if *cost <= s.silver {
                ff(-s.neg_time + *time, *pos, s.silver - *cost);
            }
        }

        // 両替した場合
        let new_time = -s.neg_time + xchg_silver_time[s.pos].1;
        let new_silver = min(s.silver + xchg_silver_time[s.pos].0, max_silver);
        ff(new_time, s.pos, new_silver);
    }

    for i in 1..n {
        println!("{}", ans[i]);
    }
}


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

ll gcd(ll a,ll b){ return (b == 0) ? a : gcd(b,a%b); }
ll lcm(ll a,ll b){ return a / gcd(a,b) * b; }

signed main() {
  ll n; cin >> n;
  ll ans = 1;
  rep(i,n) {
    ll t; cin >> t;
    ans = lcm(ans, t);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
// Begin Header {{{
#define all(x) (x).begin(), (x).end()
#define rep(i, s, n) for (i64 i = (s), i##_limit = (n); i < i##_limit; ++i)
#define repr(i, s, t) for (i64 i = (s), i##_limit = (t); i >= i##_limit; --i)
#define var(type, ...) \
    type __VA_ARGS__;  \
    read(__VA_ARGS__);
#ifndef DBG
#define dump(...)
#endif
using namespace std;
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T, class U>
inline bool chmax(T &a, const U &b) {
    return b > a && (a = b, true);
}
template <class T, class U>
inline bool chmin(T &a, const U &b) {
    return b < a && (a = b, true);
}
constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;

template <class T>
inline vector<T> makeV(const T &initValue, size_t sz) {
    return vector<T>(sz, initValue);
}

template <class T, class... Args>
inline auto makeV(const T &initValue, size_t sz, Args... args) {
    return vector<decltype(makeV<T>(initValue, args...))>(
        sz, makeV<T>(initValue, args...));
}

template <class T>
inline istream &operator>>(istream &is, vector<T> &vec) {
    for (auto &e : vec) is >> e;
    return is;
}

inline void read() {}

template <class Head, class... Tail>
inline void read(Head &head, Tail &... tail) {
    cin >> head;
    read(tail...);
}

inline void print() { cout << "\n"; }

template <class Head, class... Tail>
inline void print(Head &&head, Tail &&... tail) {
    cout << head;
    if (sizeof...(tail)) cout << ' ';
    print(forward<Tail>(tail)...);
}

template <class T>
inline ostream &operator<<(ostream &os, const vector<T> &vec) {
    static constexpr const char *delim[] = {" ", ""};
    for (const auto &e : vec) os << e << delim[&e == &vec.back()];
    return os;
}

template <class Container>
struct Rev {
    Container &x_;
    inline Rev(Container &x) : x_(x) {}
    inline auto begin() { return rbegin(x_); }
    inline auto end() { return rend(x_); }
};
// }}} End Header

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    var(int, N, K);
    i64 ans = K;
    rep(i, 0, N - 1) ans *= (K - 1);
    print(ans);

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a,long long b){
  if(b==0){
    return a;
  }
  return gcd(b,a%b);
}
int main(){
  int n;
  cin >> n;
  vector<long long> a(n);
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  long long lcm=a[0];
  for(int i=1;i<n;i++){
    lcm=lcm/gcd(lcm,a[i])*a[i];
  }
  cout << lcm << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#ifdef _DEBUG
#define dlog(str) cout << "====" << str << endl;
#else
#define dlog(str)
#endif
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(int i = 0, i##_l = (n); i < i##_l; i++)
#define FOR(i, s, e) for(int i = s, i##_l = (e); i < i##_l; i++)
#define LLI long long int
#define _min(a, b) ((a < b) ? a : b)
#define _max(a, b) ((a < b) ? b : a)
#define chmax(a, b) a = _max(a, b)
#define chmin(a, b) a = _min(a, b)
#define bit(a, shift) ((a>>shift)&1))
#define pm(a) ((a) ? 1 : -1)
#define SORT(v) sort(v.begin(), v.end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
// int 2.14E±9    lli 9.2E±18    double 1.7E±380

int main() {
    cout << fixed << setprecision(10);
    int H, W, N;
    cin >> H >> W >> N;
    int m = max(H, W);
    int cnt=0;
    REP(i,N){
        cnt+=m;
        if(N<=cnt){
            cout<<i+1;
            return 0;
        }
    }
    return 0;
}

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

using namespace std;

int main(){
    long long int N,K,ans=0;
    cin >> N >> K;
    vector<long long int> mn(N+1),mx(N+1);
    mn[0] = 0;
    for(int i=1;i<=N;i++){
        mn[i] = mn[i-1] + i;
    }

    mx[N] = N;

    for(int i=N-1;0<=i;i--){
        mx[i] = mx[i+1] + i;
    }

    for(int i=K-1;i<=N;i++){
        ans += mx[N-i]-mn[i]+1;
        ans %= 1000000007;
    }

    cout << ans << endl;
}

Measured memory_bytes: 6348
#include <bits/stdc++.h>
#define pb push_back
#define X first
#define Y second
#define ld long double 
//#define int long long 
using namespace std;

const int N = 333;

int dp[N][N][N] ; 

int32_t main()
{
	ios::sync_with_stdio(0), cin.tie(0);
	string s ; 
	cin >> s ;
	int n = s.size() ; 
	int _k ;
	cin >> _k ; 
	for(int i = 0 ; i < n ; i ++ ) for(int j = 0 ; j <= _k ; j ++ ) dp[i][i+1][j] = 1 ; 
	for(int l = 2 ; l <= n ; l ++ ) for(int i = 0 ; i + l <= n ; i ++ ) for(int k = 0 ; k <= _k ; k ++ ) 
	{
		int j = i + l ;
		dp[i][j][k] = max(dp[i+1][j][k],dp[i][j-1][k]) ; 
		if(s[i]==s[j-1]) dp[i][j][k] = max(2+dp[i+1][j-1][k],dp[i][j][k]) ; 
		else if(k) dp[i][j][k] = max(dp[i][j][k],2+dp[i+1][j-1][k-1]) ; 
	}
	cout << dp[0][n][_k] << endl ; 
}

Measured memory_bytes: 131200
import numpy as np
N, D = map(int, input().split())
X = []
count = 0
for i in range(N):
    x = list(map(int, input().split()))
    X.append(x)
for j in range(N-1):
    X1 = X[j]
    for k in X[j+1:]:
        X2 = k
        XXX = 0
        for l in range(D):
            XX = (X1[l]-X2[l])**2
            XXX += XX
        XXXX = np.sqrt(XXX)
        if XXXX.is_integer() == True:
            count += 1
print(count)

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

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

    int N;
    cin >> N;
    int ans = 0;
    for (int i = 1; i <= N; i += 2) {
        int cnt = 0;
        for (int x = 1; x * x <= i; ++x) {
            if (i % x == 0) {
                cnt += (x * x == i) ? 1 : 2;
            }
        }
        if (cnt == 8) ans++;
    }
    cout << ans << endl;

    return 0;
}

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

int main(){

    int n;
    cin >> n;

    int out = 0;

    for(int i = 1;i <= n; i += 2){

        int divisor = 0;

        for(int j = 1; j <= i; ++j){

            if(i % j == 0)++divisor;

        }
        
        if(divisor == 8)++out;

    }

    cout << out << endl;

    return 0;

}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
# sys.setrecursionlimit(10**6)
# buff_readline = sys.stdin.buffer.readline
buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


class Mod:
    def __init__(self, m):
        self.m = m

    def add(self, a, b):
        return (a + b) % self.m

    def sub(self, a, b):
        return (a - b) % self.m

    def mul(self, a, b):
        return ((a % self.m) * (b % self.m)) % self.m

    def div(self, a, b):
        return self.mul(a, pow(b, self.m-2, self.m))

    def pow(self, a, b):
        return pow(a, b, self.m)


class Bisect:
    def __init__(self, func):
        self.__func = func

    def bisect_left(self, x, lo, hi):
        while lo < hi:
            mid = (lo+hi)//2
            if self.__func(mid) < x:
                lo = mid+1
            else:
                hi = mid
        return lo

    def bisect_right(self, x, lo, hi):
        while lo < hi:
            mid = (lo+hi)//2
            if x < self.__func(mid):
                hi = mid
            else:
                lo = mid+1
        return lo


@mt
def slv(S):
    memo = [0] * 13
    memo[0] = 1
    mod = 10**9 + 7
    for c in S:
        nm = [0] * 13
        if c == '?':
            r = range(10)
        else:
            r = [int(c)]
        for d in r:
            for i in range(13):
                nm[(i*10+d) % 13] += memo[i]
                nm[(i*10+d) % 13] %= mod
        memo = nm
    return memo[5]


def main():
    S = read_str()
    print(slv(S))


if __name__ == '__main__':
    main()


Measured memory_bytes: 42600
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cstring>
#include <cmath>
#include <climits>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <array>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define io() ios_base::sync_with_stdio(false); cin.tie(nullptr)
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define fi first
#define se second
#define IN(i,l,r) (l<i&&i<r)
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define v(T) vector<T>
#define p(T, N) pair<T, N>
#define ii p(int, int)
#define vi v(int)
#define vii v(p(int, int))
#define vvi v(v(int))
#define vl v(long long)
#define vll v(p(long long, long long))
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define qsort(a) sort(all(a))
#define qsortd(a) sort(all(a), greater<>())
#define qsortf(a, f) sort(all(a), f)
#define qsortsi(v) sort(v.begin(), v.end(), [](pair<int, int> aoeui, pair<int, int> boeui){return aoeui.se < boeui.se;})
#define pb(n) push_back(n)
#define eb(n) emplace_back(n)
#define pp(a, b) emplace_back(make_pair(a, b))
#define elif else if
#define fori(i, n) for(ll i = 0; i < n; i++)
#define foris(i, a, b) for(ll i = a; i < b; i++)
#define forise(i, a, b) for(ll i = a; i <= b; i++)
#define ford(i, n) for(ll i = n; i >= 0; i--)
#define fords(i, a, b) for(ll i = a; i >= b; i--)
#define fordse(i, a, b) for(ll i = a; i > b; i--)
#define forr(i, a) for (auto &i: a)
#define rev(a) reverse(a.begin(), a.end())
#define revf(a, b, c) (reverse(a.begin() + b, a.begin() + c))
#define digits(i) (int)((log(i)/(log(10))+1)
#define umap unordered_map
#define nl '\n'
#define fileio(in, out) freopen(in, "r", stdin); freopen(out, "w", stdout)
const int mod = 1000000007;

bool areOpps(ll a, ll b) {
  if(a < 0 && b > 0) return true;
  elif(a > 0 && b < 0) return true;
  else return false;
}

int main() {
  io();
  
  ll o, t;
  cin >> o >> t;
  
  if(o == 0 || t == 0) {
    cout << "Zero";
  }
  elif(o < 0 && t < 0) {
    if((o + t) % 2 == 0) cout << "Negative";
    else cout << "Positive";
  }
  elif(areOpps(o, t)) {
    cout << "Zero";
  }
  else {
    cout << "Positive";
  }
  
  return 0;
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() string {
	sc.Scan()
	return sc.Text()
}
func main() {
	weather := map[string]string{
		"Sunny":  "Cloudy",
		"Cloudy": "Rainy",
		"Rainy":  "Sunny",
	}

	s := nextInt()

	fmt.Println(weather[s])
}


Measured memory_bytes: 640