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

int main()
{
  int W, H, x, y, r;
  cin >> W >> H >> x >> y >> r;
  
  if (x > 0 && y > 0) {
    /* code */
    
    if (x + r <= W && x - r >= 0 && y + r <= H && y - r >= 0) {
      cout << "Yes" << endl;
    }
    else
    {
      cout << "No" << endl;
    }
  }
  else
  {
    cout << "No" << endl;
  }
  
  
  return 0;
}



Measured memory_bytes: 3124
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
#define YN(a) if(a){cout<<"Yes"<<endl;}else cout<<"No"<<endl;//条件によってYes、Noを出力する
int main(){
    string s;
    cin>>s;
    bool ans = false;
    if(s[2]==s[3] && s[4]==s[5]){
        ans = true;
    }
    YN(ans);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP0(i, n) for (ll i = 0; i < n; i++)
#define REP1(i, n) for (ll i = 1; i <= n; i++)
#define ARRSET(name, i) memset(name, i, sizeof(name))
#define Cn2(i) ((i)*((i)-1)>>1)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> llp;
const ll INF = 1e18;
ll n, m, r;
ll dis[205][205];
ll arr[10];
ll best = INF;
bool used[10];
ll lvl = 0, sum = 0;
void backtrack(ll prev = 0) {
    if (lvl == r) {
        best = min(best, sum);
        return;
    }
    REP1(i, r) {
        if (!used[i]) {
            if (lvl == 0) {
                used[i] = true;
                lvl++;
                backtrack(i);
                used[i] = false;
                lvl--;
            }
            if (sum + dis[arr[prev]][arr[i]] < best) {
                used[i] = true;
                lvl++;
                sum += dis[arr[prev]][arr[i]];
                backtrack(i);
                used[i] = false;
                lvl--;
                sum -= dis[arr[prev]][arr[i]];
            }
        }
    }
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n >> m >> r;
    REP1(i, n) {
        REP1(j, n) {
            if (i == j) dis[i][j] = 0;
            else dis[i][j] = INF;
        }
    }
    REP1(i, r) {
        cin >> arr[i];
    }
    REP1(i, m) {
        ll u, v, w;
        cin >> u >> v >> w;
        dis[u][v] = dis[v][u] = w;
    }
    REP1(k, n) {
        REP1(i, n) {
            REP1(j, n) {
                if (dis[i][j] > dis[i][k] + dis[k][j]) dis[i][j] = dis[i][k] + dis[k][j];
            }
        }
    }
    backtrack();
    cout << best << '\n';
}


Measured memory_bytes: 640
import java.util.*;
import java.lang.Math;

public class Main{
	
	static Scanner sc = new Scanner(System.in);
	
	public static void main(String[] args){
		long a = sc.nextLong();
		long b = sc.nextLong();
		
		if(a > b){
			long tmp = a;
			a = b;
			b = tmp;
		}
			
		double ub = Math.sqrt(a);
		List<Long> divisors = new ArrayList<>();
		for(long i = 1L; i <= ub; ++i){
			if(a % i == 0L){
				divisors.add(i);
				long qa = a / i;
				if(i != qa){
					divisors.add(qa);
				}
			}
		}
		
		int ans = divisors.size();
		for(int i = 0; i < divisors.size(); ++i){
			if(b % divisors.get(i) != 0L){
				divisors.set(i, 0L);
				--ans;
			}
		}
		
		Collections.sort(divisors);
		//System.out.println(divisors);
		
		for(int i = 0; i < divisors.size(); ++i){
			if(divisors.get(i) == 0L) continue;
			
			if(divisors.get(i) == 1L || i == divisors.size() - 1L) continue;
			
			for(int j = i + 1; j < divisors.size(); ++j){
				if(divisors.get(j) > 0L && divisors.get(j) % divisors.get(i) == 0L){
					divisors.set(j, 0L);
					--ans;
				}
			}
		}
		
		System.out.println(ans);
	}
}

Measured memory_bytes: 23636
using System;

class MyClass
{
    public static void Main(string[] args)
    {
        string str = Console.ReadLine();
        string result = "";
        foreach (var item in str)
        {
            if (item.ToString() != item.ToString().ToLower())
            {
                result += item.ToString().ToLower();
            }
            else
            {
                result += item.ToString().ToUpper();
            }
        }
        Console.WriteLine(result);
    }
}


Measured memory_bytes: 15804
#include <bits/stdc++.h>
using namespace std;
 
long long gcd(long x,long y){
    if(y==0)return x;

    return gcd(y,x%y);
}
long long lcm(long x,long y){
    return x*y/gcd(x,y);
}

int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}

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;
    }

    return 0;
}

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

int main(){
    int n;
    cin >> n;
    vector<string> s(n);
    vector<int> ans(4);
    for(int i = 0; i < n; i++){
        cin >> s.at(i);
        if(s.at(i) == "AC") ans.at(0)++;
        if(s.at(i) == "WA") ans.at(1)++;
        if(s.at(i) == "TLE") ans.at(2)++;
        if(s.at(i) == "RE") ans.at(3)++;
    }

    cout << "AC x " << ans.at(0) << endl;
    cout << "WA x " << ans.at(1) << endl;
    cout << "TLE x " << ans.at(2) << endl;
    cout << "RE x " << ans.at(3) << endl;
}

Measured memory_bytes: 6424
import scala.annotation.tailrec
import scala.collection.mutable
object Main extends App {
  import scala.io.StdIn._
  val Array(n, start, maxWeight) = readLine.trim.split(' ').map(_.toInt)
  val freights = Array.tabulate(n){f ⇒
    readLine.trim.split(' ').map(_.toInt).tail.map(w ⇒ Freight(f + 1, w))
  }.flatten.filter(_.floor != 1)
  val sumWeightMemo = Array.fill(1 << freights.length){-1}
  sumWeightMemo(0) = 0
  for (i ← freights.indices) sumWeightMemo(1 << i) = freights(i).weight
  val maxFloor = if (freights.nonEmpty) freights.maxBy(_.floor).floor else 1
  val bitMask = (2 to maxFloor).map(f ⇒ freights.indices.filter(i ⇒ freights(i).floor >= f).map(1 << _).sum).toArray
  val memo = Array.fill(1 << freights.length){-1}
  val step = bitMask.map(mask ⇒ calMoveCount(mask) * 2 - 1)
  println(if (freights.nonEmpty) step.sum + math.abs(start - maxFloor) else 0)
  def calMoveCount(current: Int): Int = {
    if (calSumWeight(current) <= maxWeight) return 1
    if (memo(current) >= 0) return memo(current)
    memo(current) = Int.MaxValue
    var next = current & (~current + 1)
    while (next < current) {
      if (calSumWeight(next) <= maxWeight) {
        memo(current) = math.min(memo(current), calMoveCount(current ^ next) + 1)
      }
      next = ((next | ~current) + 1) & current
    }
    memo(current)
  }
  def calSumWeight(current: Int): Int = {
    current match {
      case 0 ⇒ 0
      case _ if sumWeightMemo(current) >= 0 ⇒ sumWeightMemo(current)
      case _ ⇒ sumWeightMemo(current & (~current + 1)) + calSumWeight(current - (current & (~current + 1)))
    }
  }
}
case class Freight(floor: Int, weight: Int)


Measured memory_bytes: 57768
s = int(input())
mod = 10**9+7

dp = [0 for i in range(s+1)]

for i in range(3,s+1):
  for j in range(3,i-2):
    dp[i] += dp[j]
  dp[i] += 1
  dp[i] %= mod
print (dp[-1])

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

int main()
{
  int n, x;
  cin >> n >> x;
  vector<int> m(n);
  int i;
  int min = 1000;
  for(i = 0; i < n; i++)
  {
    cin >> m.at(i);
    x -= m.at(i);
    if(m.at(i) < min)
    {
      min = m.at(i);
    }
  }
  cout << n + x/min << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int X, A, B;
  cin >> X >> A >> B;
  X -= A;
  while (true) {
    X -= B;
    if (X < 0) {
      cout << X + B << endl;
      break;
    }
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int n;
const int Max=1e6;
const int OO=1e6;
int r[Max];
int g[Max];
int b[Max];
string housing[Max];
int grid[100][100];
int value[100][100];
vector<pair<int,int>>v;
vector<int>vn;
bool valid(int x,int y){
	return x>-1 && y>-1 && x<n && y<n;
}
int sum(int r,int c)
{
    if(!valid(r,c))
        return 0;
    if(r==n-1 && c==n-1)
        return value[r-1][c-1]=grid[r][c];
        if(value[r][c]!=-1)
            return value[r][c];
    int path1=sum(r+1,c);
    int path2=sum(r,c+1);
    return   value[r][c]=grid[r][c]+max(path1,path2);
}
void printpath(int r,int c)
{
    if(!valid(r,c))
        return ;
     v.push_back({r,c});
     vn.push_back(value[r][c]);
     int l=value[r+1][c  ];
     int h=value[r  ][c+1];
     (l>h)?printpath(r+1,c):printpath(r,c+1);
}
char Char[100][100];
bool solve(int r,int c)
{
    if(!valid(r,c)||value[r][c]==1||Char[r][c]=='X')
        return 0;
    if(Char[r][c]=='E')
        return 1;
    value[r][c]=1;
    if(solve(r,c-1))return 1;
    if(solve(r,c+1))return 1;
    if(solve(r+1,c))return 1;
    if(solve(r-1,c))return 1;
    value[r][c]=0;
    return 0;
}
    vector<string >st;
void gbinary(int len,string cur="")
{
    if(len==0)
    {
        st.push_back(cur);
        return ;
    }
    gbinary(len-1,cur+"a");
    gbinary(len-1,cur+"b");
}
int mem[10000];
int fib(int a)
{
    if(a<=1)
    return 1;
    int &ret=mem[a];
    if(~ret)return ret;
    ret= fib(a-1)+fib(a-2);
    return ret;
}
int memo[Max][4];
void init()
{
    memset(memo,-1,sizeof memo);
}
int V[4]={5,6,7,8};
int cnt=0;
bool T=false;
/**first video in dp eng mostafa saad all
 possible probility for sum or substrak 5,6,7,8 and sum divisible by k ;

 */
void tryall(int i ,int sum)
{

    if(i==4)
    {
        cout<<sum<<endl;
       if ((sum%26)==0)
        T=1;
        return;
    }
   tryall(i+1,sum+V[i]);
   tryall(i+1,sum-V[i]);

}
int costmin(int i,int last )
{
    if(i==n)
    return 0;
    int &ret=memo[i][last];
    if(~ret)return ret;
    ret=0;

    if(last!=0)
    ret=max(ret, r[i]+costmin(i+1,0));

    if(last!=1)
    ret=max(ret, g[i]+costmin(i+1,1));

    if(last!=2)
    ret=max(ret, b[i]+costmin(i+1,2));

    return ret;

}
int main()
{
    init();
    scanf("%d",&n);
    for(int i=0; i<n;i++)
    {
        cin>>r[i]>>g[i]>>b[i];
    }

    printf("%lld\n",costmin(0,3));

}



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

typedef long long ll;
const int INF = 1e9;
const ll LINF = 1e18;
const int mod = 1e9+7;

#define pi pair<int,int>
#define pl pair<lld,lld>

#define dump(x) cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl

#define mem0(x) memset(x,0,sizeof(x))
#define fillnum(x,n) fill(begin(x),end(x),n)
#define asort(x) sort(x.begin(),x.end())
#define dsort(x,t) sort(x.begin(),x.end(),greater<t>())
#define vuniq(x) x.erase(unique(x.begin(), x.end()), x.end())

#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)

int main() {
    string S,T;
    cin >> S >> T;
    ll ans = LINF;
    for (int i = 0; i < S.size()-T.size()+1; i++) {
        ll cnt = 0;
        for (int j = 0; j < T.size(); j++) {
            if(S[i+j] != T[j]){
                cnt++;
            }
        }
        ans = min(ans,cnt);
    }
    cout << ans << endl;
}

Measured memory_bytes: 3580
#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <iomanip>
#include <cmath>
#include <string>
#include <cstdio>
using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main() {
  int vec[] = {1, -1, 4, -4};
  queue<string> que;
  que.push("01234567");

  map<string, int> d;

  while (!que.empty()) {
    string str = que.front();
    que.pop();
    int zero = str.find("0");

    string str2;
    REP(i, 4) {
      int next_z = zero + vec[i];
      if (next_z >= 0 && next_z <= 7 && !((zero == 3 && next_z == 4) || (zero == 4 && next_z == 3))){
        str2 = str;
        swap(str2[zero], str2[next_z]);
        if (d.find(str2) == d.end()) {
          que.push(str2);
          d[str2] = d[str] + 1;
        }
      }
    }
  }

  string num;
  while (getline(cin, num)) {
    string::iterator end_it = remove(num.begin(), num.end(), ' ');
    num.erase(end_it, num.end());
    cout << d[num] << endl;
  }
}

Measured memory_bytes: 2188
function Main(input) {
    input = input.split("\n");
    
    var al = input[0];
	
	var l = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
	
	for (var i = 0; i < 27; i++) {
	if  (al == l[i]) {
	var result = "A"
	break;
	} else {
	result = "a"
	}
	}
	
	console.log(result);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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


int main()
{
 	int N, count, sum;
	bool a, b;
	cin >> N;
	count=0;
	int h[N];
	for (int i=0;i<N;i++){
		cin >> h[i];
	}
	for (int k=0;k<10000;k++){
		sum=0;
		for(int i=0;i<N;i++){
			sum += h[i];
		}
		if (sum==0)break;
		a = false;
		b = false;
		for(int i=0;i<N;i++){
			if(h[i]>0)
			{
				h[i] -= 1;
				a = true;
			}
			else if(h[i]==0&&a == true){
				b = true;
			}
			if (a==true&&b==true)break;
		}
		count +=1;
	}
		cout << count << endl;
	return 0;
}

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

using namespace std;
const int maxn=1e5+5;

vector<int> ady[maxn];
int mk[maxn];

int cont=0;

void dfs(int node)
{
    mk[node]=1;

    for(int x:ady[node])
    {
        if(!mk[x])
        {
            dfs(x);
        }       
    }  
}

int main()
{
    int n,m;
    cin>>n>>m;
    
    for(int i=0;i<m;i++)
    {
        int a,b;cin>>a>>b;

        ady[a].push_back(b);
        ady[b].push_back(a);
    }

    for(int i=1;i<=n;i++)
    {
        if(!mk[i])
        {
            dfs(i);
            cont++;
        } 
    }
    cout<<cont-1<<'\n';
}

Measured memory_bytes: 9984
N = int(input())

if N <100:
    m = N//10
    k = m+m*10
    if N <= k:
        print(k)
    else:
        k = m+1 + (m+1)*10
        print(k)
else:
    m = N//100
    k = m+m*10+m*100
    if N <= k:
        print(k)
    else:
        k=m+1 +(m+1)*10+ (m+1)*100
        print(k)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long int
#define fi first
#define se second
#define pub push_back
#define pi pair<int,int>
#define all(v) (v).begin(), (v).end()
#define rep(i, l, r) for(int i=(int)(l);i<(int)(r);i++)
#define repd(i, l, r) for (int i=(int)(l);i>=(int)(r);i--)
#define clrg(i, l, r) for(int i=(int)(l);i<(int)(r);i++)vis[i]=0,v[i].clear();
int power(int x, unsigned int y){int res = 1;while (y > 0){ if (y & 1){res = res*x;} y = y>>1;x = x*x;}return res;}
int powermod(int x, unsigned int y, int p){int res = 1;x = x % p;while (y > 0){if (y & 1){res = (res*x) % p;}y = y>>1; x = (x*x) % p;}return res;}
#define print2d(mat,n,m){for(int i=0;i<(int)(n);i++){for(int j=0;j<(m);j++){cout<<mat[i][j]<<" ";}cout<< endl;}}
#define clr(a,x) memset(a,x,sizeof(a))
#define rr(v) for(auto &val:v)
#define print(v) for (const auto itr : v){cout<<itr<<' ';}cout<<"\n";
#define ln length()
#define sz size()
#define mod 1000000007
#define elif else if
int32_t main(){
      int n;
      cin>>n;
      int ac=0,wa=0,re=0,tle=0;
      rep(i,0,n){
         string s;
         cin>>s;
         if(s=="AC")ac++;
         elif(s=="WA")wa++;
         elif(s=="RE")re++;
         else tle++;
      }
      cout<<"AC x "<<ac<<"\n";
      cout<<"WA x "<<wa<<"\n";
      cout<<"TLE x "<<tle<<"\n";
      cout<<"RE x "<<re<<"\n";

   return 0;
}

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

int main() {
  int K, A, B;
  cin >> K >> A >> B;

  for (int i = A; i <= B; i++) {
    if (i % K == 0) {
      cout << "OK" << endl;
      break;
    }

    if (i == B) {
      if (i % K != 0) {
        cout << "NG" << endl;
      }
    }
  }
}

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

const double pi  = 2 * acos(0.0);
const double eps = 1e-8;

#define REP(i,a,b) for(int i=(a); i<(b);++i)
#define rep(i,n) REP(i,0,n)
#define INF (1<<29)
#define INFLL (1L<<29)

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

typedef int Cost;
struct Edge {
  int src, dst; Cost cost;
  Edge(int s, int d, Cost c) : src(s), dst(d), cost(c) {}
};
typedef vector<Edge>  Edges;
typedef vector<Edges> Graph;
typedef vector<Cost>  Array;
typedef vector<Array> Matrix;

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

int main(void) {
  ios_base::sync_with_stdio(false); cin.tie(0);
  string s;
  cin >> s;

  char head = s[0];
  char tail = s[s.size()-1];
  size_t len = s.length();

  if (head == tail && len % 2 == 0)
    cout << "First" << endl;
  if (head == tail && len % 2 != 0)
    cout << "Second" << endl;
  if (head != tail && len % 2 == 0)
    cout << "Second" << endl;
  if (head != tail && len % 2 != 0)
    cout << "First" << endl;
  return 0; 
}


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

int LENGTH = 26;
bool bothOdd(int H,int W, vector<int> count){
	int num_of4 = (W/2)*(H/2);
	int num_of2 = (H/2 + W/2);
	int num_of1 = 1;
	for(int i = 0; i<LENGTH; i++){
		while(count[i] > 0){
			if (count[i] >= 4 && num_of4>0){
				count[i] -= 4;
				num_of4--;
			}
			else if(count[i] >= 2 && num_of2>0){
				count[i] -= 2;
				num_of2--;
			}
			else if(count[i] >= 1 && num_of1>0){
				count[i] -= 1;
				num_of1--;
			}
			else if(count[i]!=0){
				cout << "No";
				return 0;
			}
		}
	}
	for(int i = 0; i<LENGTH; i++){
		if(count[i]!=0){
			cout << "No";
			return 0;
		}
	}
	if (num_of4 !=0 || num_of2 != 0|| num_of1 != 0){
		cout << "No";
		return 0;
	}
	cout << "Yes";
	return 0;
}

int main(){
	vector<int> count(LENGTH,0);
	int H, W;
	cin >> H >> W;
	string s;
	for (int i = 0; i < H; i++){
		cin >> s;
		for (int j = 0; j < W; j++){
			count[int(s[j]-'a')] ++;
		}
	}
	sort(count.begin(),count.end());

	int num_of4 = (W/2)*(H/2);
	int num_of2, num_of1=0 ;
	if(H%2 == 0 && W%2 == 0){
		num_of2=0;
	}
	else if( H%2 == 0){
		num_of2 = H/2;
	}
	else if (W%2 == 0){
		num_of2 = W/2;
	}
	else{
		num_of2 = W/2 + H/2;
		num_of1 = 1;
	}
	for(int i = 0; i<LENGTH; i++){
		while(count[i] > 0){
			if (count[i] >= 4 && num_of4>0){
				count[i] -= 4;
				num_of4--;
			}
			else if(count[i] >= 2 && num_of2>0){
				count[i] -= 2;
				num_of2--;
			}
			else if(count[i] >= 1 && num_of1>0){
				count[i] -= 1;
				num_of1--;
			}
			else if(count[i]!=0){
				cout << "No";
				return 0;
			}
		}
	}
	for(int i = 0; i<LENGTH; i++){
		if(count[i]!=0){
			cout << "No";
			return 0;
		}
	}
	if (num_of4 !=0 || num_of2 != 0|| num_of1 != 0){
		cout << "No";
		return 0;
	}
	cout << "Yes";
	
	return 0;
	
}

Measured memory_bytes: 256
#include<cstdio>
#include <iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>

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


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

	if (a == "H") {
		cout << b << endl;
	}
	else {
		if (b == "H")cout << "D" << endl;
		else if (b == "D") cout << "H" << endl;
	}
	
return		0;
}

Measured memory_bytes: 256
n, k = map(int, input().split())

mod = 10 ** 9 + 7 # (modの値をすごく大きくすれば（5乗とか）、普通のnCrとして使える)
MAX = 2 * (10 ** 5) + 1 # これは変動するので注意。せいぜい10 ** 6くらいまでがTLEの限界

def com_init(MAX, mod):
    fac = [0] * MAX
    finv = [0] * MAX
    inv = [0] * MAX
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MAX):
        fac[i] = fac[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        finv[i] = finv[i - 1] * inv[i] % mod
    return fac, finv

fac, finv = com_init(MAX, mod)

def nCr(n, r):
    if n < r:
        return 0
    elif n < 0 or r < 0:
        return 0
    return fac[n] * (finv[r] * finv[n - r] % mod) % mod

def nHk(n, k):
    '''
    Duplicated Combination
    '''
    return nCr(n - 1 + k, n - 1)

ans = 0
for i in range(min(n, k + 1)):
    ans += nCr(n, i) * nCr(n - 1, n - i - 1) % mod
print(ans % mod)

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

using namespace std;

#define ll long long
#define mk make_pair

void PLAY()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    cout << fixed << setprecision(10);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

/*ll v[1000000];
ll len[1000000];
ll cnt = 0;
vector<vector<ll>> x;
ll dfs(ll n)
{
    //cout<<n<<" a"<<endl;
    vis[n] = 1;
    for (int i = 0; i < x[n].size(); i++)
    {
        ll lol = x[n][i];
        if (!vis[lol])
        {
            dfs(lol);
            cnt++;
        }
    }
    return cnt;
}
void seth(ll a, ll b)
{
    if (vis[a] == 2)
        return;
    vis[a] = 2;
    len[a] = b;
    for (int i = 0; i < x[a].size(); i++)
    {
        ll lol = x[a][i];
        if (vis[lol] != 2)
        {
            seth(lol, b);
        }
    }
    }*/

bool cmp(pair<ll, ll> &a, pair<ll, ll> &b)
{
    if (a.second != b.second)
    {
        return a.second < b.second;
    }
    return a.first < b.first;
}

const ll N = 1e5;
const ll mod = 1e18 + 9;

ll poww(ll b, ll p)
{
    if (p == 0)
        return 1;
    if (p % 2)
        return (poww(b, p - 1) * b) % mod;
    return (poww((b * b) % mod, p / 2)) % mod;
}

ll fact[N], infact[N];
ll ncr(ll n, ll r)
{
    return (((fact[n] * infact[r]) % mod) * infact[n - r]) % mod;
}

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

    ll n,m;
    cin>>n>>m;
    ll sum=0;
    vector<ll>x(n);
    for(int i=0;i<n;i++)
    {
        cin>>x[i];
    }

    sort(x.rbegin(), x.rend());

    for(int i=0;i<n;i++)
    {
        if(m>0)
        {
            m--;
        }
        else
        {
            sum+=x[i];
        }
        
    }
    
    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define ll long long
#define rep(i,a,b) for(long long i=a; i<b; i+=1)
#define repr(i,a,b) for(long long i=a; i<=b; i+=1)
#define vec vector<ll>
#define map map<string,int>
#define repa(p,A) for(auto p:A)
#define pb push_back
#define sort(a) sort(a.begin(),a.end())
#define reverse(a) reverse(a.begin(),a.end())

using namespace std;
int main() {
  ll A,B,C,D;
  cin>>A>>B>>C>>D;
  while(A>0 && C>0) {
    C-=B;
    if(C<=0) {
      cout<<"Yes"<<endl;
      return 0;
    }
    A-=D;
    if(A<=0) {
      cout<<"No"<<endl;
      return 0;
    }
  }
}
      

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

using namespace std;
using ll = long long;

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define debug(x) cout << #x << ": " << x << endl;
#define popcnt __builtin_popcount

const ll INF = (ll) 1e15;

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

    ll res = INF;
    for (int mid = 2; mid <= N-1; ++mid) {
        int left_idx = distance(cum.cbegin(), lower_bound(cum.cbegin(), cum.cend(), cum[mid] / 2));
        int right_idx = distance(cum.cbegin(),lower_bound(cum.cbegin(), cum.cend(), cum[mid] + (cum[N] - cum[mid]) / 2));
        ll left_mn = max(cum[left_idx - 1], cum[mid] - cum[left_idx]), left_mx = cum[mid] - left_mn;
        ll right_mn = max(cum[right_idx - 1] - cum[mid], cum[N] - cum[right_idx]), right_mx = (cum[N] - cum[mid]) - right_mn;
        res = min(res, max(left_mx, right_mx) - min(left_mn, right_mn));
    }
    cout << res << endl;

    return 0;
}

Measured memory_bytes: 3328
n, k = map(int, input().split())
ab = []
for _ in range(n):
    a, b = map(int, input().split())
    ab.append([a, b])
ab.sort(key=lambda x: x[0])

for a, b in ab:
    k -= b
    if k <= 0:
        ans = a
        break
print(ans)


Measured memory_bytes: 25356
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main()
{
  int answer = 0;
  int n;
  
  cin >> n;
  
  int v[n];
  for (int i=0;i<n;++i) {
    cin >> v[i];
  }
  
  answer = 1;
  for (int i=1;i<n;++i) {
    bool check = true;
    for (int j=0;j<i;++j) {
        if (v[i] < v[j]) {
          check = false;
          break;
        }
    }

    if (check)
      answer++;
  }
    
  cout << answer << endl;

  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>

int main() {
  char buf[1<<17];
  scanf("%s", buf);
  std::string s = buf;

  size_t n = s.length();

  size_t res = n;
  for (size_t i = 1; i < n; ++i) {
    if (s[i] != s[i-1])
      res = std::min(res, std::max(i, n-i));
  }
  printf("%zu\n", res);
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int team[200],num=0,point,lank[200],co=0,flag=0;
    queue<int> que;
    string str;
    for(int i=1;i<200;i++)team[i]=-1;
    while(cin>>str){
        if(str[0]=='0'&&str[2]=='0')break;
        for(int i=0;;i++){
            if(str[i]==','){
                for(int j=0;j<i;j++)num+=(str[j]-'0')*(int)pow(10,i-j-1);
                team[num]=0;
                point=i;
            }
            else if(str[i]=='\0'){
                for(int j=point+1;j<i;j++)team[num]+=(str[j]-'0')*pow(10,i-j-1);
                break;
            }
        }
        num=0;
    }
    point=0;
    for(int i=1;flag!=1;i++){
        flag=1;
        for(int j=1;j<200;j++){
            if(point<team[j]){
                flag=0;
                point=team[j];
                if(co!=0){
                    for(int k=0;k<co;k++)que.pop();

                }
            co=1;
            que.push(j);
            }
            else if(point==team[j]){
                    flag=0;
                    que.push(j);
                    co++;
            }
        }
        for(int j=0;j<co;j++){
            lank[que.front()]=i;
            team[que.front()]=-1;
            que.pop();
        }
        point=0;co=0;
    }
    while(cin>>num)cout<<lank[num]<<endl;

}

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

#define for_(i,a,b) for(int i=a;i<b;++i)
#define allof(a) a.begin(),a.end()
#define minit(a,b) memset(a,b,sizeof(a))

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

int q;

int main() {
	cin >> q;
	ll lc = 0, rc = 0;
	
	for_(i,0,q) {
		ll p, n; char c;
		cin >> p >> c >> n;
		if (c == ')') rc += n;
		else lc += n;
		if (lc == rc) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	
	return 0;	
}

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

int main(int argc, const char * argv[]) {



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

    /////////////////////
    // Write code below /
    /////////////////////
    int A,B,ans;

    cin>>A>>B;

    ans=A+B;
    if(ans<A-B)
        ans=A-B;
    if(ans<A*B)
        ans=A*B;

    cout<<ans<<endl;


    return 0;
}

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

int main() {
    int a, b;
    cin >> a >> b;
    if(a<b){
        cout << "a < b" << endl;
    }
    else if(a>b){
        cout << "a > b" << endl;
    }
    else{
        cout << "a == b" << endl;
    }
    return 0;
}

Measured memory_bytes: 1156
#include <iostream>

int main() {
    int A, B, C, D;
    std::cin >> A >> B >> C >> D;

    if (A + B > C + D) {
        std::cout << "Left" << std::endl;
    } else if (A + B == C + D) {
        std::cout << "Balanced" << std::endl;
    } else {
        std::cout << "Right" << std::endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <iomanip>

using namespace std;
const double PI = acos(-1.0);

int main() {
    int R;
    cin >> R;
    cout << fixed << setprecision(10) << 2 * PI * R << endl;
    return 0;
}

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

#define ll long long

#define all(a) a.begin(),a.end()
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define Rep(i,n,m) for(int i=(int)(n);i<(int)(m);i++)
#define RepS(i,n,m) for(int i=(int)(n);i<=(int)(m);i++)
#define output_s(a) printf("%s\n",(a).c_str())

//library----------------------------------------------


int main(){
    int n[3];
    rep(i,3) cin>>n[i];
    sort(n,n+3);
    int ans = n[0]+n[1];
    printf("%d\n",ans);
    
    return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python

def main():
    n = int(input())
    a = list(map(int, input().split()))

    cnt = 0
    for i in range(0, n, 2):
        if a[i] % 2 == 1:
            cnt += 1

    print(cnt)

if __name__ == '__main__':
    main()


Measured memory_bytes: 9168
package main

import "fmt"

// 2018-07-30T21:14:16+0800
// 2018-07-30T21:16:27+0800
func main() {
	var s string
	fmt.Scanf("%s", &s)
	n := 0
	for i := 0; i < len(s); i++ {
		if s[i] == '+' {
			n++
		} else if s[i] == '-' {
			n--
		}
	}
	fmt.Println(n)
}

Measured memory_bytes: 512
#include<cstdio>
int n,c,a,k;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++){scanf("%d%d",&a,&k);while(a%k)a-=(a/k+1)*((a%k-1)/(a/k+1)+1);c^=a/k;}
	puts(c?"Takahashi":"Aoki");
	return 0;
}

Measured memory_bytes: 128
/*
ID: leezhen
TASK: practice
LANG: C++11
*/
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<pair<int, int> > vii;
typedef long long ll;
typedef unsigned long long ull;
#define mp make_pair
#define pb push_back
#define inf 1e9
#define REP(i, a, b) for (int i = int(a); i < int(b); i++)

// struct

// data
int n;
char s[110];

void solve() {
  if (n % 2 == 1) {
    printf("No\n");
    return;
  }
  for (int i = 0; i < n / 2; i++) {
    if (s[i] != s[i + n / 2]) {
      printf("No\n");
      return;
    }
  }
  printf("Yes\n");
}

int main() {
  int k, kase = 0;
  // scanf("%d", &k);
  k = 1;
  while (k--) {
    scanf("%d", &n);
    scanf("%s", s);
    solve();
  }

  return 0;
}


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

ll solve(int n)
{
  ll res = 1;
  for (int i = n; i > 0; i--)
  {
    res *= i;
    res %= 1000000007;
  }

  return res;
}

int main()
{
  int n, m;
  cin >> n >> m;

  if (abs(n - m) > 1)
  {
    cout << 0 << endl;
    return 0;
  }

  if (n != m)
  {
    cout << (solve(n) * solve(m)) % 1000000007 << endl;
  }
  else
  {
    cout << (solve(n) * solve(m) * 2) % 1000000007 << endl;
  }
}

Measured memory_bytes: 256
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

aa = [0]
bb = [0]
for i in range(n):
    aa.append(aa[-1]+a[i])
for i in range(m):
    bb.append(bb[-1]+b[i])

d = 0
ans = 0
for i in range(n, -1, -1):
    c = k - aa[i]
    if c >= 0:
        for j in range(d, m+1):
            if bb[j] <= c:
                d = j
            else:
                break
        ans = max(ans, i+d)
print(ans)

Measured memory_bytes: 47324
#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

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

int main() {
	int a[3];
	REP(i, 3) scanf("%d", &a[i]);
	sort(a, a + 3);
	if (a[0] + a[1] == a[2]) puts("Yes");
	else puts("No");
	
	return 0;
}

Measured memory_bytes: 764
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define sz(x) ((int)x.size())
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define mset(x,y) memset(x,y,sizeof(x))
#define rep(i,n) for(int i=0;i<int(n);i++)
#define per(i,n) for(int i=int(n)-1;i>=0;i--)
#define rng(i,a,b) for(int i=int(a);i<=int(b);i++)
#define gnr(i,b,a) for(int i=int(b);i>=int(a);i--)
using namespace std;
using namespace __gnu_pbds;
using ordered_set = tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>;
#ifdef LOCAL
#define dmp(...) _dmp(#__VA_ARGS__, __VA_ARGS__)
#else
#define dmp(...) (__VA_ARGS__)
#endif
template<class T> using vt=vector<T>;
template<class T> using vvt=vt<vt<T>>;
template<class TA,class TB> void chmax(TA&a,TB b){if(a<b)a=b;}
template<class TA,class TB> void chmin(TA&a,TB b){if(b<a)a=b;}
template<class TA,class TB>
ostream& operator<<(ostream& os,const pair<TA,TB>& p){
	return os<<"{"<<p.fi<<","<<p.se<<"}";
}
template<class T> ostream& operator<<(ostream& os,const vt<T>& v){
	os<<"{";for(auto& e:v)os<<e<<",";return os<<"}";
}
template<class TH> void _dmp(const char *sdbg, TH h){cout<<sdbg<<"="<<h<<endl;}
template<class TH, class... TA> void _dmp(const char *sdbg, TH h, TA...a){
while(*sdbg!=',')cout<<*sdbg++;cout<<"="<<h<<","; _dmp(sdbg+1, a...);
}
template<class T> void make_unique(vt<T>& v) {
	sort(all(v));v.erase(unique(all(v)),v.end());
}
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
int ri(){int x;cin>>x;return x;}
ll rll(){ll x;cin>>x;return x;}
vi rvi(int n){vi v;rep(i,n)v.pb(ri());return v;}
int n,m;
char s[110][110];
int dir[2][2]={0,1,1,0};
int d[110][110];
void MAIN() {
	cin>>n>>m;
	rep(i,n)cin>>s[i];
	mset(d,-1);
	deque<pair<int,int>> dq;
	dq.pb({0,0});d[0][0]=0;
	while(!dq.empty()) {
		int x=dq.front().first,y=dq.front().second;dq.pop_front();
		rep(i,2) {
			int tx=x+dir[i][0],ty=y+dir[i][1];
			if(tx<0||ty<0||tx>=m||ty>=n)continue;
			if(d[ty][tx]!=-1)continue;
			if(s[y][x]!=s[ty][tx]){
				d[ty][tx]=d[y][x]+1;
				dq.pb({tx,ty});
			}else {
				d[ty][tx]=d[y][x];
				dq.push_front({tx,ty});
			}
		}
	}
	bool f=s[0][0]=='#';
	bool g=s[n-1][m-1]=='#';
	int ans;
	if(f&&g)ans=d[n-1][m-1]/2+1;
	else if(f||g)ans=(d[n-1][m-1]+1)/2;
	else ans=d[n-1][m-1]/2;
	cout<<ans;
}
int main() {
	ios::sync_with_stdio(false);cin.tie(0);
	int T=1;
	//cin>>T;
	for(int tt=1;tt<=T;tt++) {
		MAIN();
	}
	return 0;
}


Measured memory_bytes: 384
use std::io;

fn main() {
    let n = read_one::<usize>();
    let a = read::<usize>();
    println!("{}", a.iter().max().unwrap() - a.iter().min().unwrap());
}

#[allow(dead_code)]
fn read<T>() -> Vec<T>
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.split_whitespace()
        .map(|s| s.trim().parse().unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_one<T>() -> T
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().unwrap()
}

Measured memory_bytes: 4352
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
string s; int K, dp[309][309][309];
int main() {
	cin >> s >> K;
	string d1 = s, d2 = s;
	reverse(d2.begin(), d2.end());
	for (int i = 0; i <= d1.size(); i++) {
		for (int j = 0; j <= d2.size(); j++) {
			for (int k = 0; k <= K; k++) {
				if (i >= 1) dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k]);
				if (j >= 1) dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k]);
				if (i >= 1 && j >= 1) {
					if (d1[i - 1] == d2[j - 1]) dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + 1);
					else if(k >= 1) dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k - 1] + 1);
				}
			}
		}
	}
	int ret = 0;
	for (int i = 0; i < s.size(); i++) {
		for (int j = 0; j <= K; j++) {
			ret = max(ret, dp[i][s.size() - i - 1][j] * 2 + 1);
		}
	}
	for (int i = 0; i <= s.size(); i++) {
		for (int j = 0; j <= K; j++) {
			ret = max(ret, dp[i][s.size() - i][j] * 2);
		}
	}
	cout << ret << endl;
	return 0;
}

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

int main() {
  int n,m;
  cin>>n>>m;
  int A[1100];
  int sum=0;
  int ans=0;
  
  for(int i=1;i<=n;i++){
    cin>>A[i-1];
  }
  
  for(int i=1;i<=n;i++){
    sum+=A[i-1];
  }
  
  for(int i=1;i<=n;i++){
    if(sum%4==0){
    if(A[i-1]>=(sum/(4*m)))ans++;
  } 
  else{if(A[i-1]>(sum/(4*m)))ans++;
  } 
  }
    
  if(ans>=m)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  
}


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

double div_n(int k, int n) {
    double res = 0;
    if (k <= n) {
        return 0;
    }
    
    while(k > n) {
        n *= 2;
        res++;
    }
    return res;
}

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

    double res = 0.0;
    for (int i = 1; i <= N; i++) {
        double n = div_n(K, i);
        res += 1.0 / (double)N * pow(0.5, n);
    }

    cout << setprecision(15) << res << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> V;
#define rep(i,s,e) for(ll i=s;i<e;i++ )
typedef pair<ll,ll> P;
const ll mod = 1000000007;
const ll INF = 1000000009;
ll i;

int main(){
    ll N;
    cin>>N;
    cout<<N*(N+1)/2<<endl;
}



Measured memory_bytes: 256
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Main {
	public static void main(String[] args) {
		// code to read values
		// code to call required method
		// code to display the result
		// System.out.println(Math.ceil(2.5));
		Scanner sc = new Scanner(System.in);
		int[] arr = new int[5];
		for(int i=0; i<5; i++){
			arr[i] = sc.nextInt();
			if(arr[i]==0) System.out.println(i+1);
		}
	}
}

Measured memory_bytes: 27008
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll d,g;
bool used[10];
ll p[10],c[10];
ll dfs(ll kai,ll g){
  ll ret=1000000000;
  for(ll i=0;i<d;i++){
    if(used[i])continue;
    used[i]=true;
    double x=g/(100*(i+1)*1.0);
    ll y=ceil(x);
    if(y<=p[i])ret=min(ret,y+kai);
    else{
      if(100*(i+1)*p[i]+c[i]>=g)ret=min(ret,kai+p[i]);
      else ret=min(ret,dfs(kai+p[i],g-(100*(i+1)*p[i]+c[i])));
    }
    used[i]=false;
  }
  return ret;
}
int main(){
  cin>>d>>g;
  for(ll i=0;i<d;i++)cin>>p[i]>>c[i];
  for(ll i=0;i<d;i++)used[i]=false;
  cout<<dfs(0,g)<<endl;
}

Measured memory_bytes: 256
def maximal_value(n, bli):

    ans = []
    ans.append(bli[0])

    for i in range(n-1):
        if bli[i] < ans[i]:
            ans[i] = bli[i]
        ans.append(bli[i])

    return sum(ans)

def main():
    n = int(input())
    bli = list(map(int, input().split()))
    print(maximal_value(n, bli))

if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
#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);}
typedef long long ll;
#define MOD 1000000007
#define EPS 10e-8

int main() {
    ll A[4];
    rep(i,3){
        cin >> A[i];
    }
    //sort(A,A+3);
    cout << (A[0]+A[1]>=A[2] ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int nums, ans, i;
    cin >> nums;
    int seq[nums];
    for(i = 0;i < nums;i++)
        cin >> seq[i];
    sort(seq, seq + nums);
    ans = abs(seq[0] - seq[nums - 1]);
    cout << ans <<endl;
    return 0;
}


Measured memory_bytes: 256
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

int main(void) {
    string s;
    getline(cin, s);
    transform(s.begin(), s.end(), s.begin(), ::toupper);
    cout << s << endl;
    return 0;
}

Measured memory_bytes: 1176
// Template from https://techracho.bpsinc.jp/jhonda/2019_08_05/78537

// input macro for competive-programming from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        input_inner!{$s, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

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

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

    ($iter:expr, bytes) => {
        read_value!($iter, String).into_bytes()
    };

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

fn main() {
    use std::io::Read;
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();

    println!("{}", solve(&s));
}

macro_rules! test {
    ($($exp_input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                let start = std::time::Instant::now();
                let input = solve($exp_input);
                let end = start.elapsed();
                assert_eq!(input, $output, "{}.{:03}", end.as_secs(), end.subsec_millis());
                assert!(end.as_secs() <= 2, "expected_sec: {}sec, actual_sec: {}sec", 2, end.as_secs());
                assert!(end.as_secs() <= 1, "expected_sec: {}sec, actual_sec: {}sec", 1, end.as_secs());
                assert!(end.subsec_millis() <= 10, "expected_ms: {}ms, actual_ms: {}ms", 10, end.subsec_millis());
                assert!(end.subsec_millis() <= 2, "expected_ms: {}ms, actual_ms: {}ms", 2, end.subsec_millis());
            )*
        }
    };
}

test! {
r#"10"# => r#"Yes"#,
r#"50"# => r#"No"#,
r#"81"# => r#"Yes"#,
}

fn solve(src: &str) -> String {
    let mut src_iter = src.split_whitespace();
    input! {
        source = src_iter,
        n: usize,
    }
    let mut ans = "No";

    'outer: for i in 1..10 {
        if n % i == 0 {
            for j in 1..10 {
                if i * j == n {
                    ans = "Yes";
                    break 'outer;
                }
            }
        }
    }

    ans.to_string()
}

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

struct Inputs
{
    int *inputK;
    int *inputA;
    int *inputB;
};

int CountMultiplicationB(int *inputK, int *inputB)
{
   return *inputB / *inputK;
}

int CountMultiplicationA(int *inputK, int *inputA)
{
   return *inputA / *inputK;
}

void PrintOutput(int *inputK,int multiplyA,int multiplyB, int *inputA, int *inputB)
{
    if(*inputK * multiplyA  == *inputA)
    {
        printf("OK \n");
    }
    else if(*inputK * (multiplyA + 1) <= *inputB)
    {
        printf("OK \n");
    }
    else
    {
        printf("NG \n");
    }
}

void ReadInput(int *inputK, int *inputA, int *inputB)
{
    //printf("Enter the value of K: \n");
    scanf("%d", inputK);
    //printf("Enter the value of A and B: \n");
    scanf("%d %d", inputA, inputB);

}

int main(int argc, const char * argv[])
{
    struct Inputs Golf;
    Golf.inputA = malloc(sizeof(int));
    Golf.inputB = malloc(sizeof(int));
    Golf.inputK = malloc(sizeof(int));
    
    ReadInput(Golf.inputK, Golf.inputA, Golf.inputB);
    
    int multiplyA = CountMultiplicationA(Golf.inputK, Golf.inputA);
    int multiplyB = CountMultiplicationB(Golf.inputK, Golf.inputB);
    
    PrintOutput(Golf.inputK, multiplyA, multiplyB,  Golf.inputA, Golf.inputB);
    
    return 0;
}


Measured memory_bytes: 1572
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        System.out.println(solve(s));

        sc.close();
    }

    static long solve(String s) {
        return search(s, 0, 0);
    }

    static long search(String s, int index, long sum) {
        if (index == s.length()) {
            return sum;
        }

        long result = 0;
        for (int i = index; i < s.length(); ++i) {
            result += search(s, i + 1, sum + Long.parseLong(s.substring(index, i + 1)));
        }

        return result;
    }
}

Measured memory_bytes: 21716
from collections import Counter

def main():

    S = list(input())
    head = S.pop(0)
    count = 0
    flag  = False
    flag1 = False
    flag2 = False

    if head == 'A':
        flag = True
    
    for i in S[1:-1]:
        if i=='C':
            count += 1
    if count == 1:
        flag1=True
        S.pop(S.index('C'))
        
    if ''.join(S).islower():
        flag2 = True
    
    if flag and flag1 and flag2:
        print('AC')
    else:
        print('WA')


    
if __name__== "__main__":
    main() 











Measured memory_bytes: 3316
// use std::collections::HashMap;

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let n: i64 = sc.read();
    let mut s = Vec::new();
    for _ in 0..n {
        let si: String = sc.read();
        s.push(si.into_bytes());
    }
    let mut ans = 0;
    let n = n as usize;
    for k in 0..n {
        let mut good: bool = true;
        for i in 0..n {
            for j in 0..n {
                good &= s[i][(j+k)%n] == s[j][(i+k)%n];
            }
        }
        if good {
            ans += n;
        }
    }
    println!("{}", ans);
}

// thanks, ir5
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

struct Scanner<'a> {
    cin: StdinLock<'a>,
}

impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }
}


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



int main(){
	map<string, string > m ;
	string S = "Sunny" ;
	string C = "Cloudy" ;
	string R = "Rainy" ;
	m[S] = C ;
	m[C] = R ;
	m[R] = S ;
	string x ;
	cin >> x ;
	cout << m[x] << endl ;


	return 0 ;
}

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


    class Program
    {
        static void Main(string[] args)
        {
          string[] Input = Console.ReadLine().Split(' ');
          int go = 0;
          int nana = 0;
          for(int i = 0; i < Input.Length; i++)
          {
           if(Input[i] == "5")
           {
             go++;
           }
            else if(Input[i] == "7")
           {
             nana++;
           }
          }
          
          if(go == 2 && nana == 1)
          {
            Console.WriteLine("YES");
          }
          else
          {
            Console.WriteLine("NO");
          }
        }
    }



Measured memory_bytes: 13140