akhauriyash/Code-Regression huggingface dataset:
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

// 内部定数
#define D_MASS_MAX		200005									// 最大マス数
#define D_MASS_NONE		'.'										// マス - なし

// 内部変数
static FILE *szpFpI;											// 入力
static int siA, siB, siC, siD;									// 位置
static char sc1Mass[D_MASS_MAX];								// マス

// 内部変数 - テスト用
#ifdef D_TEST
	static int siRes;
	static FILE *szpFpA;
	static int siTNo;
#endif

// １行出力
int
fOutLine(
	char *pcpLine				// <I> １行
)
{
	char lc1Buf[1024];

#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, pcpLine)) {
		siRes = -1;
	}
#else
	printf("%s", pcpLine);
#endif

	return 0;
}

// 移動チェック
int
fChkMove(
	int piSNo					// <I> 開始位置
	, int piENo					// <I> 終了位置
)
{
	int i;

	// 移動
	int liMax = 0;
	int liLen = 0;
	for (i = piSNo; i <= piENo; i++) {
		if (sc1Mass[i] == D_MASS_NONE) {
			liLen++;
			if (liMax < liLen) {
				liMax = liLen;
			}
		}
		else if (sc1Mass[i + 1] == D_MASS_NONE) {
			liLen = 0;
		}
		else {
			return -1;
		}
	}

	return liMax;
}

// Bの妨げチェック
int
fChkB(
)
{
	// D > C
	if (siD > siC) {
		return 0;
	}

	// Bの前後
	if (sc1Mass[siB - 1] == D_MASS_NONE) {
		if (sc1Mass[siB + 1] == D_MASS_NONE) {
			return 0;
		}
	}

	// Dの前後
	if (sc1Mass[siD - 1] == D_MASS_NONE) {
		if (sc1Mass[siD + 1] == D_MASS_NONE) {
			return 0;
		}
	}

	return -1;
}

// 実行メイン
int
fMain(
)
{
	int liRet, liWork;
	char lc1Buf[1024];

	// 位置 - 取得
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
	sscanf(lc1Buf, "%d%d%d%d%d", &liWork, &siA, &siB, &siC, &siD);
	siA--;
	siB--;
	siC--;
	siD--;

	// マス - 取得
	fgets(sc1Mass, sizeof(sc1Mass), szpFpI);

	// B -> D
	liRet = fChkMove(siB, siD);
	if (liRet < 0) {
		return -1;
	}

	// Bの妨げチェック
	if (liRet < 3) {
		liRet = fChkB();
		if (liRet != 0) {
			return -1;
		}
	}

	// A -> C
	liRet = fChkMove(siA, siC);
	if (liRet < 0) {
		return -1;
	}

	return 0;
}

// １回実行
int
fOne(
)
{
	int liRet;
	char lc1Buf[1024];

	// 入力 - セット
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", siTNo);
	szpFpI = fopen(lc1Buf, "r");
	sprintf(lc1Buf, ".\\Test\\A%d.txt", siTNo);
	szpFpA = fopen(lc1Buf, "r");
	siRes = 0;
#else
	szpFpI = stdin;
#endif

	// 実行メイン
	liRet = fMain();

	// １行出力
	if (liRet == 0) {
		sprintf(lc1Buf, "Yes\n");
	}
	else {
		sprintf(lc1Buf, "No\n");
	}
	fOutLine(lc1Buf);

	// 残データ有無
#ifdef D_TEST
	lc1Buf[0] = '\0';
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, "")) {
		siRes = -1;
	}
#endif

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpI);
	fclose(szpFpA);
#endif

	// テスト結果
#ifdef D_TEST
	if (siRes == 0) {
		printf("OK %d\n", siTNo);
	}
	else {
		printf("NG %d\n", siTNo);
	}
#endif

	return 0;
}

// プログラム開始
int
main()
{

#ifdef D_TEST
	int i;
	for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
		siTNo = i;
		fOne();
	}
#else
	fOne();
#endif

	return 0;
}



Measured memory_bytes: 384
#include <stdio.h>

  int main(void){

    int i,n,m,min,max;

    long long sum;

    sum = 0;

    scanf("%d", &n);

    for (i = 0;i<n;i++){

        scanf("%d", &m);

        if(i == 0){


            min = m;

            max = m;

        }

        if (min > m){

            min = m;

        }

        if (max < m){

            max = m;

        }

        sum += m;

    }

    printf("%d %d %lld\n",min,max,sum);

    return 0;

}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
const int MX=1e9;
int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    int n,s,k;
    cin>>n>>k>>s;
    if(s<MX){
        for(int i=1 ; i<=k ; i++)cout<<s<<" ";
        for(int i=k+1 ; i<=n ; i++)cout<<s+1<<" ";
    }
    else{
        for(int i=1 ; i<=k ; i++)cout<<s<<" ";
        for(int i=k+1 ;i <=n ; i++)cout<<1<<" ";
    }
    return 0;
}


Measured memory_bytes: 1280
#include<bits/stdc++.h>
#define endl "\n"
#define ll long long
#define eb emplace_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define MA 10e+18
int va=10e8+7;
ll val[200007]={0};
using namespace std;
//Conditional Operator (condition?true part:false part) eg : cout<<(y<=3?"YES":"NO")<<endl;
//string s(3,'1');
// if number of elements in array >10^5 then declare global array.
ll getmul(ll n){ll int k{0};while(n>0){k+=n%10;n=n/10;}return k;}//Sum OF n DIGITS 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t{1};
    //cin>>t;
    while(t--){
        int n;
        cin>>n;
        int val{0},flag{0};
        for(int i=0;i<n;i++){
            int a,b;
            cin>>a>>b;
            if(a==b) val++;
            else val=0;
            if(val==3) flag=1;
        }
        if(flag) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
 return 0;
}

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

int main() {
  int h, w;
  cin >> h >> w;
  vector<vector<char>> tbl (h, vector<char>(w));
  
  //入力
  for(int i=0; i<h; i++)
    for(int j=0; j<w; j++)
      cin >> tbl.at(i).at(j);
  
  //縦処理
  for(int i=0; i<w; i++){
    int cnt=0;
    for(int j=0; j<h; j++){
      if(tbl.at(j).at(i) == '.')
        cnt++;
      else
        break;
    }
  	if(cnt == h){
      //cout << "????????" << endl;
      for(int j=0; j<h; j++)
        tbl.at(j).at(i) = '?';
    }
  }
  
  //横処理
  for(int i=0; i<h; i++){
    int cnt=0;
    for(int j=0; j<w; j++){
      if(tbl.at(i).at(j) == '#')
        break;
      else
        cnt++;
    }
  	if(cnt == w){
      for(int j=0; j<w; j++)
        tbl.at(i).at(j) = '!';
    }
  }
  

  /*
  for(int i=0; i<h; i++){
    for(int j=0; j<w; j++){
      cout << tbl.at(i).at(j);
      if(j < w - 1)
        cout << ' ';
      else
        cout << endl;
    }
  } */
  
   //出力
  for(int i=0; i<h; i++){
    for(int j=0; j<w; j++){
      if(tbl.at(i).at(j) == '!'){
        break;
      }else if(tbl.at(i).at(j) == '?'){
        if(j == w - 1)
			cout << endl;
      }
      else{
      	cout << tbl.at(i).at(j);      
		  if(j == w - 1)
			cout << endl;
      }
    }
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define rep(i, n) for(ll i = 0;i < n;i++)
template<class T, class U> void cmax(T& a, U b) { if (a<b) a = b; }
template<class T, class U> void cmin(T& a, U b) { if (a>b) a = b; }

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

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

  ll ans = 0;
  rep(i, n) {
    int tmp = (a[n-i-1]+ans)%b[n-i-1];
    if (tmp != 0) {
      ans += b[n-i-1]-tmp;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <limits>
#include <numeric>
#include <algorithm>
#include <functional>

#include <vector>

using namespace std;

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

	string S;
	cin >> S;

	int N = S.size();

	vector<long long> a(N + 1, 0);
	
	for (int i = 0; i < N; i++)
	{
		if (S[i] == '<')
		{
			a[i + 1] = max(a[i + 1], a[i] + 1);
		}
	}

	for (int i = N - 1; i >= 0; i--)
	{
		if (S[i] == '>')
		{
			a[i] = max(a[i], a[i + 1] + 1);
		}
	}

	long long result = 0;
	for (long long c : a)
	{
		result += c;
	}

	cout << result;

	//cout << accumulate(a.begin(), a.end(), 0);

	return 0;
}


Measured memory_bytes: 4764
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int n = scanner.nextInt();
    long sum = 0;
    int[][] record = new int[n][3];
    List<Integer> R = new ArrayList<>();
    List<Integer> G = new ArrayList<>();
    List<Integer> B = new ArrayList<>();
    String[] s = scanner.next()
        .split("");

    for (int i = n - 1; i >= 0; i--) {
      if (i != n - 1) {
        record[i][0] = record[i + 1][0];
        record[i][1] = record[i + 1][1];
        record[i][2] = record[i + 1][2];
      }
      if (s[i].equals("R")) {
        record[i][0]++;
      } else if (s[i].equals("G")) {
        record[i][1]++;
      } else {
        record[i][2]++;
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        if (s[i].equals(s[j])) {
          continue;
        }
        int c1 = mapToNum(s[i]);
        int c2 = mapToNum(s[j]);
        int c3 = c1 + c2 == 1 ? 2 : c1 + c2 == 2 ? 1 : 0;
        int dist = j - i;
        sum += record[j][c3];

        if (j + dist < n && mapToNum(s[j + dist]) == c3) {
          sum--;
        }
      }
    }
    System.out.println(sum);
    
//    for (final Integer base : R) {
//      int i = 1;
//      while (base + 2 * i < n) {
//        if ((G.contains(base + i) && B.contains(base + 2* i)) || (B.contains(base + i) && G.contains(
//            base + 2* i))) {
//          sum++;
//        }
//        i++;
//      }
//    }
//    for (final Integer base : G) {
//      int i = 1;
//      while (base + 2 * i < n) {
//        if ((R.contains(base + i) && B.contains(base + 2* i)) || (B.contains(base + i) && R.contains(
//            base + 2* i))) {
//          sum++;
//        }
//        i++;
//      }
//    }
//
//    for (final Integer base : B) {
//      int i = 1;
//      while (base + 2 * i < n) {
//        if ((G.contains(base + i) && R.contains(base + 2* i)) || (R.contains(base + i) && G.contains(
//            base + 2* i))) {
//          sum++;
//        }
//        i++;
//      }
//    }
//    System.out.println(R.size() * G.size() * B.size() - sum);
//
//    for (int i = 0; i < n; i++) {
//      for (int j = i + 1; j < n; j++) {
//        int dist = 0;
//        final String c1 = s[i];
//        final String c2 = s[j];
//        if (!s[i].equals(s[j])) {
//          dist = j - i;
//          sum += Stream.of(s)
//              .skip(j)
//              .filter(e -> !e.equals(c1) && !e.equals(c2))
//              .count();
//          if(j + dist < n && !s[j+dist].equals(c1) && !s[j+dist].equals(c2)) {
//            sum--;
//          }
//        }
//      }
//    }
//    System.out.println(sum);
  }

  private static int mapToNum(final String s) {
    if (s.equals("R")) {
      return 0;
    } else if (s.equals("G")) {
      return 1;
    } else {
      return 2;
    }
  }
}


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

int main() {
  
  int a ; 
  cin >> a  ;
  int ans = 0 ; 
  int max = 36 ; 
  
  for ( int i = 0 ; i < a ; i++ ) {
  	int b ; 
    cin >> b ;
    int tmax = 0 ;
    
    while ( b % 2 == 0){
	  b /= 2 ; 
      tmax += 1 ; 
    }
    
    if ( tmax < max)
      max = tmax;
  }
  cout << max << endl ; 
  
}




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

int main()
{
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &&a : a)
  {
    cin >> a;
  }
  sort(a.begin(), a.end(), greater<int>());
  ll ans = 0;
  if (n % 2 == 0)
  {
    for (int i = 0; i < n / 2; i++)
    {
      ans += a.at(i);
    }
    for (int i = 1; i < n / 2; i++)
    {
      ans += a.at(i);
    }
  }
  else
  {
    for (int i = 0; i < n / 2; i++)
    {
      ans += a.at(i);
    }
    for (int i = 1; i < n / 2 + 1; i++)
    {
      ans += a.at(i);
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 4044
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
*/

int main(){
    int N, H; cin >> N >> H;
    vector<int> a(N), b(N);
    for(int i=0; i<N; i++) cin >> a[i] >> b[i];
    sort(a.begin(), a.end(), greater<int>());
    sort(b.begin(), b.end(), greater<int>());

    int amax = a[0];
    int cnt = 0;
    for(int i=0; i<N && b[i] >= amax; i++){
        
        cnt++;
        H -= b[i];
        
        if(H <= 0){
            cout << cnt << endl;
            return 0;
        }
    }

    cout << cnt + (H-1)/amax + 1 << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <vector>
#include <math.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <iomanip>
#include <deque>
#include <map>

typedef long long ll;
#define rep(i, a, n) for(int i = a; i<n; i++)
#define ALL(a) begin(a), end(a)
#define mii map<int, int>
#define msi map<string, int>
#define vi vector<int>
#define vl vector<ll>
#define MOD 1000000007
#define INF 1e9
using namespace std;
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main() {
    ll N, K;
    cin >> N >> K;
    //vector<vector<int>> data(3, vector<int>(4));
    //初期値0
    //vector<int> data(i, 0);
    vl a(N);
    rep(i, 0, N) {
        cin>> a[i];
    }
    sort(a.begin(), a.end());
    ll h = INF;
    rep(i, 0, N-K+1) {
        h = min(a[i+K-1] - a[i], h);
    }
    cout << h << endl;
    return 0;
}

Measured memory_bytes: 1024
require 'set'
n = gets.chomp.to_i

def divisors_count n

  divisors = []

  (n**0.5).to_i.times do |i|
    i = i + 1
    if n.even?
      next
    end

    if (n % i).zero?
      divisors.push i
      divisors.push n.div(i)
    end
  end

  divisors.to_set.size
end


count = 0

n.times do |i|
  if divisors_count(i + 1) == 8
    count += 1
  end
end

puts count


Measured memory_bytes: 2044
#include<cstdio>
#include<iostream>
#include<cstring>
#include<vector>
using namespace std;
const int N=1010,M=2e5+10;
int w[M],ne[M],la[N],t,ans[M];
void link(int x,int y){
	w[++t]=y;
	ne[t]=la[x];
	la[x]=t;
}
int arv[N][N],n,m,X,mrk[N],ti,mrk2[N];
vector<int> e[N];
//void dfs(int x){
//	arv[X][x]=1;
//	for (int y=la[x];y;y=ne[y])
//		if (!arv[X][w[y]])dfs(w[y]);
//}
void go(int x){
	mrk[x]=ti;
	for (auto z:e[x])
		if (z!=X&&!mrk[z])go(z);
}
void go2(int x){
	mrk2[x]=ti;
	for (auto z:e[x])
		if (z!=X&&!mrk2[z])go2(z);
}
vector<int> c;
int main(){
	cin>>n>>m;
	for (int i=1;i<=m;i++){
		int x,y;
		scanf("%d%d",&x,&y);
		link(x,y);
		e[x].push_back(y);
	}
	for (X=1;X<=n;X++){
		c.clear();
		for (int y=la[X];y;y=ne[y]){
			ti++;
			if (!mrk[w[y]])go(w[y]);
			c.push_back(w[y]);
		}
		while (c.size()){
			if (!mrk2[c.back()])go2(c.back());
			c.pop_back();
			ti--;
		}
		for (int y=la[X];y;y=ne[y])ans[y]=(mrk[w[y]]<mrk2[w[y]]);
		for (int i=1;i<=n;i++)arv[X][i]=(bool)mrk[i],mrk[i]=mrk2[i]=0;
	}
	for (int x=1;x<=n;x++)
		for(int y=la[x];y;y=ne[y])
			ans[y]=ans[y]==arv[w[y]][x];
	for (int i=1;i<=m;i++)
		puts(ans[i]?"same":"diff");
}

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

int main() {
  int N;
  cin >> N;
  int min;
  for (int i = 0; i < N; i++){
    int x;
    cin >> x;
    int j;
    for (j = 0; true; j++){
      if (x % 2 == 1)
        break;
      x /= 2;      
    }
    if (i == 0)
      min = j;
    else if (i != 0 && j < min)
      min = j;
  }
  cout << min << endl;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
n, m, s, t = map(int,input().split())
C = [list(map(int,input().split())) for i in range(m)]

s -= 1
t -= 1

# O((V + E)log(V))
# Cは [[スタート頂点, ゴール頂点, 重み], ...] のリスト

# for i in range(m):
#     for j in range(2):
#         C[i][j] -= 1

M = [[] for i in range(n)]
for i in range(len(C)):
    M[C[i][0]-1].append([C[i][1]-1, C[i][2]])  # 無向グラフなら両方追加
    M[C[i][1]-1].append([C[i][0]-1, C[i][2]])  # 無向グラフなら両方追加

N = [[] for i in range(n)]
for i in range(len(C)):
    N[C[i][0]-1].append([C[i][1]-1, C[i][3]])  # 無向グラフなら両方追加
    N[C[i][1]-1].append([C[i][0]-1, C[i][3]])  # 無向グラフなら両方追加

import heapq

def dijkstra(s, M):
    D = [10**16] * n  # 頂点0からの距離
    P = [-1] * n  # 頂点0からの最短距離において、そこの直前の頂点(経路復元に利用)
    D[s] = 0
    V = [0] * n  # その頂点のD[i]が最短距離と確定したら1
    Q = []  # 優先度付きキュー
    for v in range(n):
        heapq.heappush(Q, [D[v], v])

    le = len(Q)
    while le > 0:
        q = heapq.heappop(Q)
        u = q[1]
        du = q[0]
        if V[u] == 0:
            V[u] = 1
            le -= 1
            for i in range(len(M[u])):
                v = M[u][i][0]
                luv = M[u][i][1]
                if V[v] == 0:
                    alt = du + luv
                    if D[v] > alt:
                        D[v] = alt
                        P[v] = u
                        heapq.heappush(Q, [alt, v])
    return D, P

Ds, _ = dijkstra(s, M)
Dt, _ = dijkstra(t, N)

ANS = [0] * n

# print(Ds,Dt)

ans = 10**16
for i in range(n-1, -1, -1):
    ans = min(ans, Ds[i] + Dt[i])
    ANS[i] = ans

for i in range(n):
    print(10**15 - ANS[i])

Measured memory_bytes: 149000
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
//typedef tree<int,null_type,less<int >,rb_tree_tag,tree_order_statistics_node_update>indexed_set;
template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p);
template <class T>
ostream &operator <<(ostream &os, vector<T>&v);
template <class T>
ostream &operator <<(ostream &os, set<T>&v);
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v);
#ifndef ONLINE_JUDGE
#define debug(a) cout<<#a<<" --> "<<(a)<<"\n";
#define debug2(a) cout<<#a<<" --> "<<(a)<<" ";
#define HERE cout<<"here - "<<__LINE__<<"\n";
#else
#define debug(a)
#define debug2(a)
#define HERE
#endif
const ll mod = 100000007;
const int N = 15;
typedef pair<int,int> pii;

void TEST_CASES(int cas)
{
    int n;
    cin>>n;
    int x = 0;
    vector<int>a(n);
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        x^=a[i];
    }
    for(int i=0;i<n;i++)
    {
        int y = x^a[i];
        printf("%d ",y);
    }
    printf("\n");

}


/*
*/

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1,cas=0;
    //scanf("%d",&t);
    while(t--)
    {
        TEST_CASES(++cas);
    }
    return 0;
}



//os.order_of_key(v): returns how many elements strictly less than v
//os.find_by_order()

template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p)
{
    os<<"{"<<p.first<<", "<<p.second<<"} ";
    return os;
}
template <class T>
ostream &operator <<(ostream &os, vector<T>&v)
{
    os<<"[ ";
    for(int i=0; i<v.size(); i++)
    {
        os<<v[i]<<" " ;
    }
    os<<" ]";
    return os;
}

template <class T>
ostream &operator <<(ostream &os, set<T>&v)
{
    os<<"[ ";
    for(T i:v)
    {
        os<<i<<" ";
    }
    os<<" ]";
    return os;
}
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v)
{
    for(auto i:v)
    {
        os<<"Key : "<<i.first<<" , Value : "<<i.second<<endl;
    }
    return os;
}


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


int main() {
    int N;

    cin >> N;
    vector <pair<string, pair<int, int> > > res(N);

    for (int i = 0; i < N; i++) {
        string s; int p;
        cin >> s >> p;
        res[i] = make_pair(s, make_pair(-p, i + 1));
    } 

    sort(res.begin(), res.end());
   
    for (int i = 0; i < N; i++) {
        cout << res[i].second.second << endl;
    }
}

Measured memory_bytes: 256
import sys
for s in sys.stdin:
	s = map(int, s.split())
	if len(s) == 1:
		continue
	else:
		(pm, pe, pj) = tuple(s)
		if 100 in (pm, pe, pj): c = "A"
		elif pm + pe >= 180: c = "A"
		elif pm + pe + pj >= 240: c = "A"
		elif pm + pe + pj >= 210: c = "B"
		elif pm + pe + pj >= 150 and (pm >= 80 or pe >= 80): c = "B"
		else: c = "C"
	print c

Measured memory_bytes: 4248
use proconio::{fastout, input};

#[fastout]
fn main() {
    input!{
        n:usize,
        m:[usize; n],
    }
    let mut counter = 0;
    let mut x = m[0];
    for i in 0..n {
        if m[i] <= x {
            counter += 1;
            x = m[i]
        }
    }
    print!("{}",counter)
}


Measured memory_bytes: 4760
#pragma warning(disable:4786)
#pragma warning(disable:4996)
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
#include<ext/pb_ds/detail/standard_policies.hpp>
#define pii pair<int,int>
#define pll pair<long long ,long long>
#define pli pair<long long , int>
#define pil pair<int ,long long>
#define pi acos(-1)
#define pb push_back
#define mkp make_pair
#define all(a) a.begin(), a.end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define MAX 300005
#define INF 0x3f3f3f3f
template <class T> inline T bigmod(T p,T e,T M){ll ret = 1LL;for(; e > 0LL; e >>= 1LL){if(e & 1LL) ret = (ret * p) % M;p = (p * p) % M;}return (T)ret;}
template <class T> inline T modinverse(T a,T M){return bigmod(a,M-2,M);}   // M is prime}

using namespace std;
using namespace __gnu_pbds;

typedef trie<string,null_type,trie_string_access_traits<>,pat_trie_tag,trie_prefix_search_node_update>pref_trie;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef tree<pair<int, int>,null_type,less<pair<int, int>>,rb_tree_tag,tree_order_statistics_node_update> ordered_multiset;




int main(){
    IOS
    //freopen("output.txt","w",stdout);
    int n;
    cin>>n;

    ll sum = 0 ;
    ll prev=0;
    for(int i=0;i<n-1;i++){
        ll b;
        cin>>b;
        if(i==n-2)sum+=b;
        if(i==0){
            sum+=b;
            prev=b;
            continue;
        }
        sum+=min(prev,b);
        prev=b;

    }
    cout<<sum;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
 
using namespace std;
/*
FTFFTFFF
4 2
*/
int f[8001][16001];
int a[8001];      
int main()
{		
	memset(f,0,sizeof(f));
	int x,y;
	string s;
	cin>>s>>x>>y;
	int cnt=0;
	int j=0;
	for(int i=0;i<s.size();i++)
	{ 
		if(s[i]=='F')
		{
			cnt++;
		}
		else
		{
			a[++j]=cnt;
			cnt=0;
		}
	}
	if(cnt!=0) a[++j]=cnt;
	f[0][8000]=1;
	f[1][a[1]+8000]=1;
	for(int i=2;i<=j;i++)
	{
		for(int p=0;p<=16000;p++)
		{
			if(p+a[i]<=16000&&f[i-2][p+a[i]]==1) f[i][p]=1;
			else if(p-a[i]>=0&&f[i-2][p-a[i]]==1) f[i][p]=1;
		} 
	}
	if(j%2==0)
	{
		if(f[j-1][x+8000]==1&&f[j][y+8000]==1) cout<<"Yes";
		else cout<<"No"; 
	}
	else
	{
		if(f[j][x+8000]==1&&f[j-1][y+8000]==1) cout<<"Yes";
		else cout<<"No";
	}
	return 0;
} 

Measured memory_bytes: 500352
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll i,j,n,m,mod,res,js,ans;
ll C[3100][3100],g[3100][3100];//9000000
ll pow_mod(ll x,ll y,ll mm)
{
	ll sum=1;
	while(y)
	{
		if(y&1)
		{
			sum=sum*x%mm;
		}
		x=x*x%mm;
		y>>=1;
	}
	return sum;
}
int main()
{
	ll i,j;
	scanf("%lld%lld",&n,&mod);
	for(i=0;i<=n;i++)
	{
		C[i][0]=1;g[i][0]=1; 
		for(j=1;j<=i;j++)
		{
			C[i][j]=(C[i-1][j-1]+C[i-1][j])%mod;
			g[i][j]=(g[i-1][j-1]+(j+1)*g[i-1][j]%mod)%mod;
		}
	}
	for(i=0;i<=n;i++)
	{
	    ll qwe=pow_mod(2,pow_mod(2,n-i,mod-1),mod);
	    ll asd=pow_mod(2,n-i,mod),zxc=1;js=0;
		for(j=0;j<=i;j++)
		{
			js=(js+g[i][j]*zxc%mod)%mod;
			zxc=zxc*asd%mod;
		}
		ans=(ans+((i&1)?mod-C[n][i]:C[n][i])*js%mod*qwe%mod)%mod;
	}
	printf("%lld\n",ans);
	return 0;
} 

Measured memory_bytes: 96684
#include <functional>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <assert.h>
#include <bitset>
#include <string>
#include <cstdio>
#include <math.h>
#include <complex>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <set>
#include <bitset>
#include <map>
using namespace std;

#define int64 long long
#define mp make_pair
#define ull unsigned long long


#ifdef _DEBUG
	const int N = 101;
#else
	const int N = 500;
#endif
const int M = 70; 

const int MOD = 1e9+7;

int n, m;
int cnt[N][N];

vector <pair<int, int> > g[N];

void dfs(int root, int v, int prev)
{
	cnt[root][v]++;
	if (cnt[root][v] > 1) return;
	for (int i = 0; i < g[v].size(); i++)
	{
		if (g[v][i].second < prev)
		{
			dfs(root, g[v][i].first, g[v][i].second);
		}
	}
}

int main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= m; i++)
	{
		int a, b;
		scanf("%d%d", &a, &b);
		g[a].push_back(mp(b, i));
		g[b].push_back(mp(a, i));
	}
	for (int i = 1; i <= n; i++)
	{
		dfs(i, i, m + 1);
	}
	int ans = 0;
	for (int i = 1; i <= n; i++)
	{
		for (int j = i + 1; j <= n; j++)
		{
			bool flag = true;
			for (int k = 1; k <= n; k++)
			{
				if (cnt[i][k] + cnt[j][k] > 1)
				{
					flag = false;
					break;
				}
			}
			if (flag) ans++;
		}
	}
	cout << ans;
	return 0;
}


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

typedef long long ll;
typedef long double ld;
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
#define endl '\n'
#define max3(a,b,c) max(a,max(b,c))

const int q = 1e9+9;




int main()
{
    char n;
    cin>>n;

    cout<<char(int(n)+1)<<endl;

    return 0;
}
    // gotcha;


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<long long> vll;
typedef vector<pair<int, int>> vpi;
typedef vector<pair<long long, long long>> vpl;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
#define INF (int)(1e9)
#define MAXX 1.1529215e+18
#define inf 999999
#define EPS (1e-7)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define FOR(i, k, n) for (int i = (k); i < (int)(n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.begin(), a.end(), greater<int>()
#define ROT(a) a.begin(), a.begin() + 1, a.end()
#define RROT(a) a.begin(), a.end() - 1, a.end()
#define PB push_back
#define MP make_pair
#define PI acos(-1.0)
#define sz(a) a.size()
const ll MOD = 1e9 + 7;
const int MAX = 10000000;
template <typename T1, typename T2>
inline bool chmin(T1& a, T2 b)
{
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T1, typename T2>
inline bool chmax(T1& a, T2 b)
{
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
T gcd(T a, T b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
//cout << 'H' << endl;
/*--------------------------------------------*/

int main()
{
    //cout << fixed << setprecision(10)
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N;
    cin >> N;

    cout << ((N / 1000 + 1) * 1000 - N) % 1000 << endl;
}


Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
int n,ans,sum;
string s;
int main(){
	cin>>n>>s;
	for(int i=0;i<n;i++){
		if(s[i]=='I')ans++;
		if(s[i]=='D')ans--;
		sum=max(sum,ans);
	}
	cout<<sum;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define inf 1e18
int main()
{
	char c;
	cin>>c;
	if(c>='A' && c<='Z')
	{
		cout<<"A";
	}
	else
	{
		cout<<"a";
	}
	cout<<"\n";
}


Measured memory_bytes: 3632
#include <stdio.h>
 
int main(){
    int countTable[256] = {0};
    char ch;
 
    while((ch = getchar()) != EOF){
                countTable[ch]++;
    }
    for(int i = 97; i <=122;i++)printf("%c : %d\n",i,countTable[i]+countTable[i-32]);
}


Measured memory_bytes: 2724
import java.util.*;
public class Main{
    static Scanner kbd = new Scanner(System.in);
    public static void main(String[] args){
	while(kbd.hasNext()){
	    String s = kbd.next();
	    solve(s);
	}
    }

    static void solve(String s){
	String[] re = new String[s.length()];
	int i;
	for(i=0; i<s.length(); i++){
	    re[i] = s.substring(i, i+1);
	}
	String ans = "";
	for(i=re.length-1; i>=0; i--){
	    ans += re[i];
	}
	System.out.println(ans);
    }
}

Measured memory_bytes: 17132
#include<iostream>
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<cctype>
#define szxb 100010
using namespace std;
int n,a[szxb];
signed main()
{
	scanf("%d",&n);int t;
	for(register int i(1);i<=n;i++){scanf("%d",&t),a[t-1]++,a[t]++,a[t+1]++;}
	printf("%d",(*max_element(a,a+szxb)));
	return putchar(10),0;
}

Measured memory_bytes: 640
n,m = map(int,input().split())
a = list(map(int,input().split()))
if n < m:
  print("No")
  quit()
a.sort(reverse = True)
l = sum(a)/4/m
for i in range(m):
  if a[i] < l:
    print("No")
    quit()
print("Yes")

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

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
const ll mod = 1e9+7;


int main(){
	
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    
    ll n,k;cin>>n>>k;
    vll v1;

    REP(i,n) {
        ll c; cin>>c;
        v1.push_back(c);
    }
    // cout << v1[5] <<endl;
    ll mx=0;

    FOR(i, 0, min(k,n)){
        FOR(j, 0, min(n,k)-i){
            vll v2(0);
            REP(s,i) {
                v2.push_back(v1[s]);
            }
            REP(t,j){
                
                v2.push_back(v1[n-1-t]);
                // cout<< v1[n-1-t]<<endl;
            }
            sort(ALL(v2));

            ll idx=0;
            ll sum = accumulate(ALL(v2),0LL);
            // cout<<sum<<endl;
            REP(s, v2.size()){
                if (v2[s]<0 && s<k-i-j) sum-=v2[s];
                else break;
            }
            mx = max(mx, sum);
        }
    }

    cout<<mx<<endl;
    return 0;
}

Measured memory_bytes: 256
#![allow(unused_imports)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

pub trait InputValue {
    fn parse(s: &str) -> Self;
}

pub fn read<T: InputValue>() -> T {
    let mut buf = String::new();
    let _ = stdin().read_line(&mut buf);
    T::parse(&buf.trim())
}

pub fn readn<T: InputValue>(n: usize) -> Vec<T> {
    let mut vec = vec![];
    for _ in 0..n {
        vec.push(read());
    }
    vec
}

pub fn readnc<T: InputValue>() -> Vec<T> {
    let mut vec = vec![];
    let line: String = read();
    for token in line.split_whitespace() {
        vec.push(T::parse(token));
    }
    vec
}

macro_rules! parse_single_value {
    ($($t:ty),*) => {
        $(
            impl InputValue for $t {
                fn parse(s: &str) -> $t { s.parse().unwrap() }
            }
        )*
	}
}
parse_single_value!(i32, i64, f32, f64, usize, String);

macro_rules! parse_tuple {
	($($t:ident),*) => {
		impl<$($t),*> InputValue for ($($t),*) where $($t: InputValue),* {
			fn parse(s: &str) -> ($($t),*) {
				let mut tokens = s.split_whitespace();
				let t = ($($t::parse(tokens.next().unwrap())),*);
				t
			}
		}
	}
}
parse_tuple!(A, B);

// ===

fn main() {
    let (n, x): (usize, i32) = read();
    let mut m: Vec<i32> = readn(n);
    m.sort();

    let mut x = x;
    for &mi in m.iter() {
        x -= mi;
    }
    let count = n as i32 + (x / m[0]);
    println!("{}", count);
}


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

#define MP make_pair
#define PB push_back
#define ll long long int
#define F first
#define S second
#define MAX(x,y) (x)>(y)?(x):(y)
#define MIN(x,y) (x)<(y)?(x):(y)
#define REP(i,a,n) for(i=a;i<(n);i+=1)
#define REPL(i,a,n) for(i=a;i<=(n);i+=1)
#define REPr(i,n) for(i=n-1;i>=0;i-=1)

typedef vector<int> vi;
typedef vector<ll> vll;
typedef set<int>::iterator sit;
typedef unordered_set<int>::iterator usit;
typedef multiset<int>::iterator msit;
typedef unordered_multiset<int>::iterator umsit;
typedef vector<ll>::iterator vllit;

//cin.ignore(numeric_limits<streamsize>::max(),'\n');

ll MAX3(ll x, ll y, ll z){
    ll temp = max(x,y);
    return max(temp,z);
}

const int N = 101;
const int W = 100001;
ll dp[N][W];
vector<pair<ll, ll>> items;

int n,w;

void solve(){
    int i,k,x;
    REPL(i,0,w)
        dp[0][i] = 0;
    REPL(i,0,n)
        dp[i][0] = 0;

    REPL(k,1,n){
        REPL(x,1,w){
            if(x -items[k].F >= 0)
                dp[k][x] = items[k].S + dp[k-1][x-items[k].F];
            dp[k][x] = max(dp[k][x], dp[k-1][x]);
        }
    }  
}


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    items.clear();
    items.shrink_to_fit();
    cin>>n>>w;
    ll a,b;
    int i;
    pair<ll,ll> p;
    p = MP(0,0);
    items.PB(p);
    REP(i,0,n){
        cin>>a>>b;
        p = MP(a,b);
        items.PB(p);
    }
    solve();
    cout<<dp[n][w]<<endl;
    return 0;
}

Measured memory_bytes: 79232
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>

template <class Cost = int>
struct Edge {
    int src, dst;
    Cost cost;
    Edge(int src = -1, int dst = -1, Cost cost = 1)
        : src(src), dst(dst), cost(cost){};

    bool operator<(const Edge<Cost>& e) const { return this->cost < e.cost; }
    bool operator>(const Edge<Cost>& e) const { return this->cost > e.cost; }
};

template <class Cost = int>
using Edges = std::vector<Edge<Cost>>;

template <class Cost = int>
using Graph = std::vector<std::vector<Edge<Cost>>>;

using lint = long long;
constexpr lint INF = 1LL << 50;

void solve() {
    int n, m;
    std::cin >> n >> m;

    Edges<lint> edges(m);
    Graph<lint> graph(n);
    for (auto& e : edges) {
        std::cin >> e.src >> e.dst >> e.cost;
        --e.src, --e.dst;

        graph[e.src].emplace_back(e.src, e.dst, e.cost);
        graph[e.dst].emplace_back(e.dst, e.src, e.cost);
    }

    std::vector<lint> vs(n);
    std::vector<int> cs(n);
    auto paint = [&](lint w) {
        std::fill(cs.begin(), cs.end(), -1);
        vs[0] = w;
        cs[0] = 0;

        std::queue<int> que;
        que.push(0);

        while (!que.empty()) {
            int v = que.front();
            que.pop();

            for (auto e : graph[v]) {
                int u = e.dst;
                if (cs[u] != -1) continue;

                cs[u] = 1 - cs[v];
                vs[u] = e.cost - vs[v];
                que.push(u);
            }
        }
    };

    paint(0);
    bool bip = true, ok = true;
    for (auto e : edges) {
        if (cs[e.src] == cs[e.dst]) bip = false;
        if (vs[e.src] + vs[e.dst] != e.cost) ok = false;
    }

    if (bip && ok) {
        lint lmin = INF, rmin = INF;
        for (int v = 0; v < n; ++v) {
            auto& min = (cs[v] == 0 ? lmin : rmin);
            min = std::min(min, vs[v]);
        }

        std::cout << std::max(lmin + rmin - 1, 0LL) << std::endl;
    } else {
        lint w = 0;
        for (auto e : edges) {
            if (vs[e.src] + vs[e.dst] != e.cost) {
                w = std::abs(vs[e.src] + vs[e.dst] - e.cost);
                break;
            }
        }

        paint(w / 2);
        ok = true;
        for (int v = 0; v < n; ++v) {
            if (vs[v] <= 0) ok = false;
        }
        for (auto e : edges) {
            if (vs[e.src] + vs[e.dst] != e.cost) ok = false;
        }

        std::cout << ok << std::endl;
    }
}

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

    solve();

    return 0;
}


Measured memory_bytes: 10752
import java.util.Scanner;

public class Main {

	public static void main(String[] args)  {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();

		System.out.println(Math.max(a*b, c*d));
	}
}

Measured memory_bytes: 21844
import sys
import math
a=sys.stdin.readline()
res=[i for i in a.split()]
r1,r2=float(res[0]),float(res[1])
v1,v2=r1.is_integer(),r2.is_integer()
if v1==v2==True:
    N,D=int(r1),int(r2)
    if 1<=(N and D)<=20:
        w=2*D+1
        print(int(math.ceil(N/w)))

Measured memory_bytes: 9148
#include <bits/stdc++.h>
using namespace std;
char S[10];
int main(){
    scanf("%s", S);
    int N= strlen(S);
    int ans = 0;
    for(int i = 0; i < N; i++){
        if(S[i] == '+') ans++;
        else ans--;
    }
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, m, n) for (int i = m; i < (n); i++)
#define FORR(i, m, n) for (int i = (m); i > 0; i--)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;

int main() {
  int n, l;
  cin >> n >> l;
  vector<string> s(n);
  REP(i, n) {
    cin >> s[i];
  }
  sort(ALL(s));
  REP(i, n) {
    cout << s[i];
  }
  cout << endl;
  return 0;
}

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


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

typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int MAXN = 1e6 + 3;

#define _  %  MOD
#define __ %= MOD

#define      each(it,s)        for(auto it = s.begin(); it != s.end(); ++it)
#define      sortA(v)          sort(v.begin(), v.end())
#define      sortD(v)          sort(v.begin(), v.end(), greater<auto>())
#define      fill(a)           memset(a, 0, sizeof (a))

#define      swap(a,b)        {a=a+b;b=a-b;a=a-b;}
#define      rep(i, n)         for(ll i = 0; i < (n); ++i)
#define      repA(i, a, n)     for(ll i = a; i <= (n); ++i)
#define      repD(i, a, n)     for(ll i = a; i >= (n); --i)
#define watch(x) cout << (#x) << " is " << (x) <<endl

#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define fbo find_by_order
#define ook order_of_key

ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}
ll power(ll x,ll y){ll res=1; while(y>0){if(y&1) res=res*x;y=y>>1;x=x*x;}return res;} // modular exponent

int main()
{
    ios_base::sync_with_stdio(false); // don't use printf and scanf
    cin.tie(NULL); // cout<<fixed<<setprecision
    ll K;
    cin>>K;
    queue<ll> q;
    for(int i=1;i<=9;i++) q.push(i);
    ll k=0;
    while(k<K)
    {
        ll x=q.front();
        q.pop();
        k++;
        if(k==K)
        {
            cout<<x<<'\n';
            break;
        }
        int last_digit=x%10;
        ll num=10*x +last_digit;
        if(last_digit>0) q.push(num-1);
        q.push(num);
        if(last_digit<9) q.push(num+1);
    }
    return 0;
}


Measured memory_bytes: 1792
#include<stdio.h>
int main(void){
    int W,H,x,y,r;
    scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
    if(W>=x+r && H>=y+r && x>0 && y>0){
    printf("Yes\n");
    }
    else{
    printf("No\n");
    }
    return 0;
}

Measured memory_bytes: 1820
use std::io::*;
use std::str::FromStr;

fn main() {
    let a: String = read();
    let b: String = read();

    println!("{}", solve(&a, &b));
}

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn solve(a: &str, b: &str) -> i64 {
    let n1: i64 = a.parse().ok().unwrap();
    let n2: i64 = b.replace(".", "").parse().ok().unwrap();
    (n1 * n2) / 100
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_solve_1() {
        assert_eq!(217, solve("198", "1.10"));
    }

    #[test]
    fn test_solve_2() {
        assert_eq!(0, solve("1", "0.01"));
    }

    #[test]
    fn test_solve_3() {
        assert_eq!(9990000000000000, solve("1000000000000000", "9.99"));
    }
}


Measured memory_bytes: 2136
/*
	Name:
	Author: xiaruize
	Date:
*/

#include<bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define MOD 1000000007
#define ALL(a) (a).begin(), (a).end()
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define ll long long
#define form(i,j,n) for(int i=int(j);i<=int(n);i++)
#define pb push_back
#define mk make_pair
#define pii pair<int,int>
#define pis pair<int,string>
#define sec second

inline int read()
{
    char ch=getchar();
    int x=0,f=1;
    while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9') x=x*10+(ch^48),ch=getchar();
    return x*f;
}

int ans[2005];

int main()
{
 	ios::sync_with_stdio(false);
	cin.tie(0);
 	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	int n,x,y;
	cin>>n>>x>>y;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
		{
			ans[min(abs(i-j),min(abs(x-i)+1+abs(j-y),abs(y-i)+1+abs(j-x)))]++;
		}
	}
	for(int i=1;i<n;i++)
	{
		cout<<ans[i]/2<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
s = input()
s1 = s[::-1]
if s == s1:
    s2 = s[:(len(s) - 1) // 2]
    s3 =s2[::-1]
    if s2 == s3:
        s4 = s[(len(s) + 1) // 2:]
        s5 = s4[::-1]
        if s4 == s5:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

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

#define endl '\n'
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define test cout<<"test"<<endl;
#define fi first
#define se second
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
void chmin(T &a,T b){if(a>b)a=b;}
template<typename T>
void chmax(T &a,T b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void pmod(ll &a,ll b,ll c){a=(b+c)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void qmod(ll &a,ll b,ll c){a=(b*c)%MOD;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
ostream &operator<<(ostream &os, pair<ll, ll>&p){
  return os << p.first << " " << p.second;
}  
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  //cout<<fixed<<setprecision(10);
  ll res=0,buf=0;
  bool judge = true;
  ll a,b,c,d;
  string s;
  cin>>a;
  //cin>>a>>b;
  //cin>>a>>b>>c;
  //cin>>a>>b>>c>>d;
  //cin>>s;
  cout<<a*a*3<<endl;
  return 0;
}

Measured memory_bytes: 764
#include <stdio.h>
int main(void){
    
    int a,b;
    
    scanf("%d %d",&a,&b);
    if(a == 1){
        if(b == 2){
            printf("3");
        }else{
            printf("2");
        }
    }else if(a == 2){
        if(b == 1){
            printf("3");
        }else{
            printf("1");
        }
    }if(a == 3){
        if(b == 1){
            printf("2");
        }else{
            printf("1");
        }
    }
    return 0;
}

Measured memory_bytes: 128
<?php
fscanf(STDIN, "%d", $n);
$Tarray = new SplFixedArray($n);
$Tarray = explode(' ', trim(fgets(STDIN)));
fscanf(STDIN, "%d", $m);
for($i=0; $i<$m; $i++){
    fscanf(STDIN, "%d %d", $p, $x);
    $t = $Tarray[$p-1];
    $Tarray[$p-1] = $x;
    print array_sum($Tarray);
    print "\n";
    $Tarray[$p-1] = $t;
}

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

using namespace std; 

typedef string str;
typedef long double db;

#define nl "\n"
#define sp " "
#define fi first
#define se second
#define pb push_back
#define ins insert

#define int long long
#define toint stoll
#define tostr to_string

#define hashmap unordered_map
#define hashset unordered_set

#define llMin LLONG_MIN
#define llMax LLONG_MAX

const int mod = 1e9 + 7;

signed main(){
    ios_base::sync_with_stdio(0); 
    cin.tie(0); cout.tie(0);
    //cout << fixed << setprecision(10);
    string s; cin >> s;
    int sum = 0;
    for (int i = 0; i < s.size(); i++){
        sum += (s[i] - '0');
    }
    if (sum % 9 == 0){
        cout << "Yes";
    }
    else cout << "No";
}


Measured memory_bytes: 3776
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn main() {
    let n: i32 = read();
    let h = n / 3600;
    let m = n % 3600 / 60;
    let s = n % 60;
    println!("{}:{}:{}", h, m, s)
}


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<vector<ll>> VV;
typedef vector<vector<int>> VVi;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
const ll INF=1e18+18;
const ll MAX=100005;
const ll MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbgmap(mp) cerr << #mp << ":"<<endl; for (auto i = mp.begin(); i != mp.end(); ++i) { cerr << i->first <<":"<<i->second << endl;}
#define dbgarr(n,m,arr) rep(i,n){rep(j,m){cerr<<arr[i][j]<<" ";}cerr<<endl;}
#define dbgdp(n,arr) rep(i,n){cerr<<arr[i]<<" ";}cerr<<endl;
#define sum(v) accumulate(ALL(v),0)
#define fi first
#define se second

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

template<typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; }

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<"	";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<std::setprecision(10);

    ll n,d,x;
    cin>>n>>d>>x;
    Vec a(n);
    ll ans=0;
    rep(i,n)cin>>a[i];

    rep(i,n){
        ans +=  (1 + (d-1)/a[i]);
    }
    ans += x;
    cout<<ans<<endl;
    return  0;
}


Measured memory_bytes: 256
#include <stdio.h>
 
int main(void) {
    int n, k, i, ans=1;
    scanf("%d %d", &n, &k);
    
    for(i=1; i<=n; i++) {
        if(ans<=k)
            ans *= 2;
        else
            ans += k;
    }
    
    printf("%d", ans);
    
    return 0;
}

Measured memory_bytes: 128