akhauriyash/Code-Regression huggingface dataset:
/*
ID: rchalam1
LANG: C++14
TASK:
*/
// For train.usaco.org, fill the template above.

// Competitive Coding Template

// GCC OPTIMIAZTION FLAGS
#ifdef ONLINE_JUDGE
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#endif

#include <bits/stdc++.h>

/*
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
*/
// All Includes for Competitive Coding Template

using namespace std;

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

using vi = std::vector<int>;
using vll = std::vector<long long>;
using vull = std::vector<unsigned long long>;

#define FOR(i, a, b) for (auto i = (a); i < (b); ++i)
#define F0R(i, a) FOR(i, 0, a)
#define ROF(i, a, b) for (auto i = (a); i >= (b); --i)
#define R0F(i, a) ROF(i, a, 0)
#define ITR(a, x) for (auto& a: x)

#define FSRT(set) sort((set).begin(),(set).end())
#define RSRT(set) sort((set).rbegin(),(set).rend())
#define CSRT(set, function) sort((set).begin(),(set).end(), (function))
#define TRS(set) sort((set).begin(),(set).end(), greater<>())
#define REV(set) reverse((set).begin(),(set).end());

#define ALL(set) (set).begin(), (set).end()

#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define ff first
#define ss second

// For stdio, call setIO() or setIO("").
void setIO(std::ifstream &readFile, std::ofstream &writeFile, const std::string &name = "", bool stdIO = false)
{
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);
	std::cout.tie(nullptr);
	if(!name.empty() && !stdIO)
	{
		readFile.open(name + ".in");
		if(readFile.fail()) return;
		writeFile.open(name + ".out");
		std::cin.rdbuf(readFile.rdbuf());
		std::cout.rdbuf(writeFile.rdbuf());
	}
}

// To time program, create object Timer  to start timing, and call Timer.elapsed().
#include <chrono>

class Timer
{
	std::chrono::time_point<std::chrono::high_resolution_clock> m_beg;
public:
	Timer() : m_beg(std::chrono::high_resolution_clock::now())
	{}

	void reset()
	{ m_beg = std::chrono::high_resolution_clock::now(); }

	[[nodiscard]] long double elapsed() const
	{
		return std::chrono::duration_cast<std::chrono::duration<long double, std::ratio<1> >>(
				std::chrono::high_resolution_clock::now() - m_beg).count();
	}
};

// Defines datatype
using dt = int;
// Defines MAXN value
constexpr dt MAXN = 1e5 + 1;
// Defines Modulus
constexpr dt MOD = 1e9 + 7;
// Defines Floating Point Correction
constexpr long double EPS = 1e-9;

//*****
//START CODE BELOW
//*****
int main(int argc, char *argv[])
{
	static std::ifstream readFile;
	static std::ofstream writeFile;
	setIO(readFile, writeFile);
	ll h, w;
	cin >> h >> w;
	cout << (h == 1 || w == 1 ? 1 : (h * w + 1) / 2) << '\n';
}

Measured memory_bytes: 3620
package main

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

func main() {
	N := nextInt()
	M := nextInt()
	m := make([]int, N)
	ok := make([]bool, N)
	for i := range m {
		v := nextInt()
		m[i] = v
		ok[i] = true
	}

	for i := 0; i < M; i++ {
		A := nextInt()
		B := nextInt()
		if m[A-1] <= m[B-1] {
			ok[A-1] = false
		}

		if m[B-1] <= m[A-1] {
			ok[B-1] = false
		}
	}

	count := 0
	for i := range m {
		if ok[i] {
			count++
		}
	}

	fmt.Println(count)
}

func nextInt() int {
	v, _ := strconv.Atoi(nextReader())
	return v
}

func nextInt64() int64 {
	v, _ := strconv.ParseInt(nextReader(), 10, 64)
	return v
}

func nextString() string {
	return nextReader()
}

func nextInts(n int) []int {
	r := make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}

func nextInt64s(n int) []int64 {
	r := make([]int64, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt64()
	}
	return r
}

var nextReader func() string

func init() {
	nextReader = NewScanner()
}

func NewScanner() func() string {
	r := bufio.NewScanner(os.Stdin)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)
	return func() string {
		r.Scan()
		return r.Text()
	}
}

func Min(a int, b int) int {
	if a > b {
		return b
	}
	return a
}

func Max(a int, b int) int {
	if a > b {
		return a
	}
	return b
}

func MinA(arg ...int) int {
	var s = arg[0]
	for _, v := range arg {
		s = Min(s, v)
	}
	return s
}

func MaxA(arg ...int) int {
	var s = arg[0]
	for _, v := range arg {
		s = Max(s, v)
	}
	return s
}

func Abs(a int) int {
	if a < 0 {
		return a * -1
	}
	return a
}


Measured memory_bytes: 5536
import java.util.Arrays;
        import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int h = sc.nextInt(), w = sc.nextInt();
        boolean[][] canvas = new boolean[h][];
        for (int y = 0; y < h; y++) {
            canvas[y] = new boolean[w];
            String line = sc.next();
            for (int x = 0; x < w; x++) {
                canvas[y][x] = line.charAt(x) == '#';
            }
        }
        for (int y = 0; y < h; y++) {
            for (int x = 0; x < w; x++) {
                if (!canvas[y][x]) {
                    continue;
                }
                if (x > 0 && canvas[y][x - 1]) {
                    continue;
                }
                if (y > 0 && canvas[y - 1][x]) {
                    continue;
                }
                if (x < w - 1 && canvas[y][x + 1]) {
                    continue;
                }
                if (y < h - 1 && canvas[y + 1][x]) {
                    continue;
                }
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
}


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

typedef long long ll;
const int N = 55;
const int M = 1000000007;

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

int main() {
  while (scanf("%d", &m), m) {
    memset(a, 0x3f, sizeof(a)); n = 0;
    for (int i = 0, u, v, w; i < m; i++) {
      scanf("%d%d%d", &u, &v, &w); a[u][v] = a[v][u] = w;
      n = max(n, max(u, v) + 1);
    }
    for (int k = 0; k < n; k++) {
      a[k][k] = 0;
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
          a[i][j] = min(a[i][j], a[i][k] + a[k][j]);
        }
      }
    }
    int ans = 0, mnd = 0x3f3f3f3f;
    for (int i = 0; i < n; i++) {
      int sum = 0;
      for (int j = 0; j < n; j++) { sum += a[i][j]; }
      if (mnd > sum) { ans = i; mnd = sum; }
    }
    printf("%d %d\n", ans, mnd);
  }
}

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

int main(){
	double pi = 3.1415926;
	int r;
	cin >> r;

	printf("%.4lf\n",2*r*pi);

	return 0;
}

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

const ll MOD = 1e9+7;

int main() {
  int n; cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  vector<int> b(3, -1);
  ll ans = 1;
  rep(i, n) {
    int cnt = 0;
    rep(j, 3) if (a[i] - 1 == b[j]) cnt++;
    rep(j, 3) if (a[i] - 1 == b[j]) {
      b[j]++;
      break;
    }
    ans *= cnt % MOD;
    ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 640
import java.io.*;
import java.util.*;


public class Main{
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));

        // Start writing your solution here. -------------------------------------
        //int t = sc.nextInt();
        int t = 1;
        while(t -- > 0)
        {
            int n = sc.nextInt();
            long dp[][] = new long[n][3];
            for(int i = 0; i < n; i++)
                for(int j = 0; j < 3; j++)
                    dp[i][j] = sc.nextLong();
            for(int i = 1; i < n; i++)
                for(int j = 0; j < 3; j++)                
                    dp[i][j] = Math.max(dp[i - 1][(j + 2) % 3], dp[i - 1][(j + 1) % 3]) + dp[i][j];                
            out.println(Math.max(dp[n - 1][0], Math.max(dp[n - 1][1], dp[n - 1][2])));
        }
        //for(int i = 1; i <= n; i++) System.out.println(Arrays.toString(dp[i]));
        out.close();

        /*
        int n      = sc.nextInt();        // read input as integer
        long k     = sc.nextLong();       // read input as long
        double d   = sc.nextDouble();     // read input as double
        String str = sc.next();           // read input as String
        String s   = sc.nextLine();       // read whole line as String

        int result = 3*n;
        out.println(result);                    // print via PrintWriter
        */
        // Stop writing your solution here. -------------------------------------
        out.close();
    }
    //-----------PrintWriter for faster output---------------------------------
    public static PrintWriter out;
    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    //--------------------------------------------------------
}

Measured memory_bytes: 48920
import Data.List

--   1
-- 4 2 3 5 ??? 1????????¢???2?????£??¢
--   6

mov :: (Int,Int,Int,Int,Int,Int) -> Char -> (Int,Int,Int,Int,Int,Int)
mov (p1,p2,p3,p4,p5,p6) 'N' = (p2,p6,p3,p4,p1,p5)
mov (p1,p2,p3,p4,p5,p6) 'S' = (p5,p1,p3,p4,p6,p2)
mov (p1,p2,p3,p4,p5,p6) 'W' = (p3,p2,p6,p1,p5,p4)
mov (p1,p2,p3,p4,p5,p6) 'E' = (p4,p2,p1,p6,p5,p3)

ini :: [Int] -> (Int,Int,Int,Int,Int,Int)
ini (a:b:c:d:e:f:_) = (a,b,c,d,e,f)

-- ?????¢???????????????
m1 :: (Int,Int,Int,Int,Int,Int) -> Int -> (Int,Int,Int,Int,Int,Int)
m1 i@(p1,p2,p3,p4,p5,p6) n
  | p1 == n            = m1 (mov i 'S') n
  | p2 == n            = i
  | p3 == n || p4 == n = m1 (mov i 'E') n
  | p5 == n || p6 == n = m1 (mov i 'N') n

-- ?????¢???????????????
m2 :: (Int,Int,Int,Int,Int,Int) -> Int -> (Int,Int,Int,Int,Int,Int)
m2 i@(p1,p2,p3,p4,p5,p6) n
  | p1 == n            = i
  | p3 == n            = m2 (mov i 'W') n
  | p4 == n            = m2 (mov i 'E') n
  | otherwise          = m2 (mov i 'E') n

chk :: (Int,Int,Int,Int,Int,Int) -> (Int,Int,Int,Int,Int,Int) -> Bool
chk a@(a1,a2,a3,a4,a5,a6) b@(b1,b2,b3,b4,b5,b6) =
  let a'@(aa1,aa2,aa3,aa4,aa5,aa6)  = m1 a  b2
      a'' = m2 a' b1
  in
    if (aa1/=b1) && (aa4/=b1) && (aa6/=b1) && (aa3/=b1)
    then False
    else if a'' == b
         then True
         else False

ans' :: [Int] -> [[Int]] -> Bool
ans' _ [] = True
ans' d0 (d1:ds) =
  let sd0 = sort d0
      sd1 = sort d1
  in
    if sd0 /= sd1
    then ans' d0 ds
    else
      let d0' = ini d0
          d1' = ini d1
      in
        (not $ chk d0' d1') && (ans' d0 ds)

ans :: [[Int]] -> Bool
ans [] = True
ans (d1:ds) =
  let r0  = ans' d1 ds
      r1  = ans ds
  in
    r0 && r1

main = do
  c <- getContents
  let ds  = map (map read) $ map words $ drop 1 $ lines c :: [[Int]]
      o   = ans ds
  putStrLn $ if o then "Yes" else "No"

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


int main(){
    ll n,y;
    cin>>n>>y;
    vector<ll> a(3,-1);
    for(ll i=0;i<=n;i++){
        for(ll j=0;j<=n&&j+i<=n;j++){
            ll k=n-(i+j);
            if(i*10000LL+j*5000LL+k*1000LL==y){
                a[0]=i;
                a[1]=j;
                a[2]=k;
            }
        }
    }
    for(int i=0;i<3;i++) cout<<a[i]<<' ';
    cout<<endl;
}

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

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) std::cout << x << '\n'
#define all(a) a.begin(), a.end()
#define pb push_back
#define sz(x) ((int)(x).size())
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return a / g * b; }
const int dx[4] = { 1, 0, -1,  0 };
const int dy[4] = { 0, 1,  0, -1 };
const int INF = (int)1e9;
const ll  inf = (ll)1e18;
const int mod = 1000000007;
const int MAX_N = 100010;

int h, w;
char s[51][51];
int d[51][51];

int bfs() {
	queue<P> que;
	que.push(P(0, 0));
	d[0][0] = 0;

	while (!que.empty())
	{
		P p = que.front();
		que.pop();
		if (p.first == h - 1 &&
			p.second == w - 1) break;

		for (int i = 0; i < 4; i++) {
			int nx = p.first + dx[i];
			int ny = p.second + dy[i];
			if (0 <= nx && nx < h &&
				0 <= ny && ny < w &&
				s[nx][ny] == '.' && d[nx][ny] == INF) {
				que.push(P(nx, ny));
				d[nx][ny] = d[p.first][p.second] + 1;
			}
		}
	}
	return d[h - 1][w - 1];
}

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

	int bcnt = 0;

	cin >> h >> w;
	rep(i, h) {
		rep(j, w) {
			cin >> s[i][j];
			if (s[i][j] == '#') {
				bcnt++;
			}
			d[i][j] = INF;
		}
	}

	cout << max(-1, h * w - bfs() - 1 - bcnt) << endl;

	return 0;
}

Measured memory_bytes: 256
def modpow(a, p):
    if p == 0:
        return 1
    if p % 2 == 0:
        halfP = p // 2
        half = modpow(a, halfP)
        return half * half % mod
    else:
        return a * modpow(a, p-1) % mod

def comb(a, b):
    if b > a - b:
        return comb(a, a-b)
    ansMul = 1
    ansDiv = 1
    for i in range(b):
        ansMul *= a - i
        ansDiv *= i + 1
        ansMul %= mod
        ansDiv %= mod

    ans = ansMul * modpow(ansDiv, mod-2) % mod
    return ans

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

mod = 10 ** 9 + 7
ans = 1
for i in range(2, int(M ** 0.5) + 1):
    cnt = 0
    while M % i == 0:
        M //= i
        cnt += 1
    if cnt:
        ans *= comb(cnt+N-1, N-1)
        ans %= mod
if M != 1:
    ans *= N
    ans %= mod

print(ans)


Measured memory_bytes: 3188
#include<bits/stdc++.h>
#define INF 0x7fffffff
#define INFLL 1e17
#define PI 2*acos(0.0)
#define show(x) cout<< #x <<" is "<< x <<"\n"
using namespace std;

#define FS first
#define SC second
#define PB(t) push_back(t)
#define LEN(t) ((int)t.size())
#define ALL(t) t.begin(),t.end()
#define MP(x, y) make_pair((x), (y))
#define Fill(a,c) memset(&a, c, sizeof(a))
#define POPCOUNT __builtin_popcount

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<PII> VPII;

int main() {

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

    
    int n; 
    cin >> n;
    if (n < 1200) {
        cout << "ABC\n";
    } else if (n < 2800) {
        cout << "ARC\n";
    } else {
        cout << "AGC\n";
    }
    

return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using ld = long double;
const int INF = (1<<30)-1;
const long long LINF = (1LL<<62)-1;
const long double PI = acos(-1.0L);
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
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; }

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a, b;
  cin >> a >> b;
  if (b%a)
    cout << b-a << endl;
  else
    cout << a+b << endl;
  return 0;
}

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

using namespace std;

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define per(i, n) for(int i = (n)-1; i >= 0; --i)
#define eee(a) (cerr << (#a) << ": " << (a) << endl);
#define ppp(a) (cout << (a) << endl); 
#define cop(a) for(auto x:(a)){cout << x << endl;}

using ll = long long;

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

constexpr char sp = ' ';
constexpr ll MOD = 1e9+7;
constexpr ll Mod = 998244353;
constexpr int INF = 1e9;
constexpr ll LINF = 1e18;
constexpr double phi = (1+sqrt(5))/2;
constexpr double pi = 3.14159265358979323846264338327950288;
inline ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
inline ll lcm(ll a, ll b){return a/gcd(a,b)*b;}
inline ll inverse(ll n, ll m=MOD){ll a=n,b=m,x=1,y=0;while(b){ll t=a/b;a-=t*b;swap(a,b);x-=t*y;swap(x,y);}return (a%m+m)%m;}
inline void Yes(){puts("Yes");}
inline void No(){puts("No");}
inline void Judge(bool b){b?Yes():No();}
inline void YES(){puts("YES");}
inline void NO(){puts("NO");}
inline void JUDGE(bool b){b?YES():NO();}
inline ll powmod(ll b, ll e, ll m=MOD){ll r=1;while(e>0){if(e&1)r=(r%m)*(b%m)%m;b=(b%m)*(b%m)%m;e>>=1;}return r;}
inline double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));}
inline double d2r(double d){return d*pi/180;}
inline double r2d(double r){return r*180/pi;}

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
    s<<'[';for(size_t i=0;i<v.size();++i){s << v[i];if(i < v.size()-1) s << ", ";}s<<']';return s;
}
struct __{ __(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(15); } };

const int MAX = 510000;

ll fac[MAX], finv[MAX], inv[MAX];

void combinit(){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < MAX; ++i){
        fac[i] = fac[i-1]*i % MOD;
        inv[i] = MOD-inv[MOD%i] * (MOD/i) % MOD;
        finv[i] = finv[i-1]*inv[i] % MOD;
    }
}


ll com(int n, int k){
    if(n < k) return 0;
    if(n < 0 or k < 0) return 0;
    return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD;
}
int main(){

    combinit();
    ll n, k;
    scanf("%lld%lld", &n, &k);
    vector<ll> a(n);
    rep(i, n) scanf("%lld", &a[i]);
    sort(a.begin(), a.end());
    

    ll f;
    for(int i = 1; n-i >= k-1; ++i){
        f += a[n-i]*com(n-i, k-1)%MOD;
        f %= MOD;
    }
    for(int i = 1; n-i >= k-1; ++i){
        f -= a[i-1]*com(n-i, k-1)%MOD;
        f += MOD;
        f %= MOD;
    }
    ppp(f);

    return 0;
}


Measured memory_bytes: 12928
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {
    public static void main(String[] args) {
        TestCase testCase = readFromInput();

        int number = findNumber(testCase);

        output(number);
    }

    private static TestCase readFromInput() {
        Scanner sc = new Scanner(System.in);
        final int N = sc.nextInt();

        List<Integer> A = new ArrayList<>();
        for (int i = 0; i < N; ++i) {
            int AN = sc.nextInt();
            A.add(AN);
        }

        sc.close();

        return new TestCase(N, A);
    }

    public static int findNumber(TestCase testCase) {
        List<Integer> A = new ArrayList<>(testCase.A);
        int min = findMinimum(A);
        int lastMin;

        do {
            lastMin = min;
            A = attackAllByMin(A, lastMin);
            min = findMinimum(A);

        } while (min < lastMin);

        return min;
    }

    private static List<Integer> attackAllByMin(List<Integer> A, int min) {
        return A.stream()
                .map(AN -> {
                    final int remainder = AN % min;
                    if (remainder >= 1) {
                        return remainder;
                    } else {
                        return AN;
                    }
                })
                .collect(Collectors.toList());
    }

    private static int findMinimum(List<Integer> a) {
        return a.stream().reduce(Math::min).orElseThrow(() -> new IllegalArgumentException("List is empty"));
    }

    private static int countNumberAllLiked(int[] counts) {
        int number = 0;
        for (int i : counts) {
            if (i == 0) {
                number++;
            }
        }
        return number;
    }

    private static void output(int i) {
        System.out.println(i);
    }

    public static class TestCase {
        final int N;
        final List<Integer> A;

        public TestCase(int N, List<Integer> A) {
            this.N = N;
            this.A = A;
        }
    }
}


Measured memory_bytes: 60144
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;

int keta(int n)
{
	int ret=0;
	while(n)
	{
		ret++;
		n/=10;
	}
	return ret;
}

int main()
{
	int N;
	int ketaN;
	int ans=0;
	
	cin >> N;
	
	ketaN=keta(N);
	for(int k=3;k<=ketaN;k++)
	{
		for(int bit=0;bit<pow(3,k);bit++)
		{
			int i=bit;
			int use[3]={};
			int num=0;
			for(int j=0;j<k;j++)
			{
				use[i%3]++;
				num=num*10+(3+(i%3)*2);
				i/=3;
			}
			if(num<=N && use[0]*use[1]*use[2]!=0)ans++;
		}
	}
	cout << ans << endl;	
	return 0;
}


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

// 
int main() {
    string S, T;
    cin >> S >> T;
    long long countDiff = 0;
    for (int i = 0; i < S.size(); i++) {
        if (S[i] != T[i]) {
            countDiff++;
        }
    }
    cout << countDiff;
}


Measured memory_bytes: 3912
#include <cstdio>
#include <iomanip>
#include <iterator>
#include <iostream>
#include <sstream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <climits>
#include <string>
#include <set>
#include <numeric>
#include <bitset>
#include <cmath>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <stack>
#include <numeric>
#include <vector>
#include <cassert>
#include <ctime>

using namespace std;
 
#define dump(...) do{print_vars(cout<<"# "<<#__VA_ARGS__<<'=',__VA_ARGS__);cout<<endl;}while(0)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define FORi(i,a,b) for(int i=int(a);i<=int(b);i++)
#define FOR(i,n) FORi(i,1,n)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple
 
using uint=unsigned;
using ll=long long;
using ull=unsigned long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using vd=vector<double>;
using vvd=vector<vd>;
using vs=vector<string>;
using pii=pair<int, int>;
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
	return os<<'('<<p.first<<','<<p.second<<')';
}
template<typename Ch,typename Tr,typename C>
basic_ostream<Ch,Tr>& operator<<(basic_ostream<Ch,Tr>& os,const C& c){
	os<<'[';
	for(auto& p: c) os << p << " ";
	return os<<']';
}
 
void print_vars(ostream&){}
template<typename Car,typename... Cdr>
void print_vars(ostream& os,const Car& car,const Cdr&... cdr){
	print_vars(os<<car<<(sizeof...(cdr)?",":""),cdr...);
}
 
 
template<int I,typename Tuple>
void print_tuple(ostream&,const Tuple&){}
template<int I,typename Car,typename... Cdr,typename Tuple>
void print_tuple(ostream& os,const Tuple& t){
	os<<get<I>(t)<<(sizeof...(Cdr)?",":"");
	print_tuple<I+1,Cdr...>(os,t);
}
template<typename... Args>
ostream& operator<<(ostream& os,const tuple<Args...>& t){
	print_tuple<0,Args...>(os<<'(',t);
	return os<<')';
}
 
 
constexpr int INF=1e9;
constexpr int MOD=1e9+7;
constexpr double EPS=1e-9;
constexpr int maxw=31;
constexpr int maxn=3001;
int a, b, c, d, e, f;
int dp[maxw][maxn];

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

	while(cin>>a>>b>>c>>d>>e>>f) {
		memset(dp, 0, sizeof(dp));
		dp[0][0] = 1;
		int maxz = -1;
		int maxs = 0;
		FOR(i, f/100) {
			rep(j, min(i*e, f - i*100) + 1) {
				if(a<=i) dp[i][j] |= dp[i-a][j];
				if(b<=i) dp[i][j] |= dp[i-b][j];
				if(c<=j) dp[i][j] |= dp[i][j-c];
				if(d<=j) dp[i][j] |= dp[i][j-d];
				if(dp[i][j] && j*1.0 / (i*100 + j) > maxs*1.0 / maxz) {
					maxz = j+i*100;
					maxs = j;
				}
			}
		}
		if(maxz == -1) cout << a*100 << " " << 0 << endl;
		else cout << maxz << " " << maxs << endl;
	}
	return 0;
}



Measured memory_bytes: 640
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

def inp():
    return int(input())
def inps():
    return input().rstrip()
def inpl():
    return list(map(int, input().split()))
def _debug(obj):
    print(obj, file=sys.stderr)

# import decimal
# from decimal import Decimal
# decimal.getcontext().prec = 10

# from heapq import heappush, heappop, heapify
# import math
# from math import gcd
# import itertools as it
# import collections
# from collections import deque 

# ---------------------------------------

s = inps()
print("ARC" if s == "ABC" else "ABC")


Measured memory_bytes: 61768
#include <stdio.h> 
int main(void)
{
	int i, j, r, c;
	int a[101][101] = { 0 };
	scanf("%d %d", &r, &c);
	for (i = 0;i < r;i++)
	{
		for (j = 0;j < c;j++)
		{
			scanf("%d", &a[i][j]);
			a[i][c] = a[i][c] + a[i][j];
			a[r][j] = a[r][j] + a[i][j];
		}
		
	}
	for (j = 0;j < c;j++)
	{
		a[r][c] = a[r][c] + a[r][j];
	}
	for (i = 0;i <=r ;i++)
	{
		for (j = 0;j <= c;j++)
		{
			printf("%d", a[i][j]);
			if (j < c)
			{
				printf(" ");
			}
			else
			{
				printf("\n");
			}
		}
	}
	return 0;
}

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

txy = list(tuple(map(int,input().split())) for _ in range(N))

t_0 = 0
x_0 = 0
y_0 = 0

for t,x,y in txy:
    dt = t - t_0
    dx = x - x_0
    dy = y - y_0
    if (abs(dx) + abs(dy))%2 == dt%2 and (abs(dx)+abs(dy)) <= dt:
        t_0 = t
        x_0 = x
        y_0 = y
    else:
        print("No")
        exit()

print("Yes")

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

int main(){

	int long long n;
	int long long suma1 = 0;
	int long long suma2 = 0;
	cin>>n;
	int vec[n];
	for( int i=0 ; i<n ; i++ ){
		cin>>vec[i];
	}

	int k = n-1;
	int i = 0;
	suma1 = vec[i];
	suma2 = vec[k];
	k--;
	i++;
	while( k>=i ){
		if( (suma1 + vec[i]) > (suma2 + vec[k]) ){
			suma2 = suma2 + vec[k];
			k--;
		}else{
			suma1 = suma1 + vec[i];
			i++;
		}
	}

	if( suma1>suma2 ){
		cout<<suma1-suma2<<endl;
	}else{
		cout<<suma2-suma1<<endl;
	}

	return 0;
}

Measured memory_bytes: 256
/* Manish Pant - insider_pants */

#include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
    #include "debug.h"
#endif

#define F first
#define S second
#define endl "\n"
#define pb push_back
typedef long long ll;
typedef long double ldob;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

void fast()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

const int N = 15;
int v[N][N];
int cost[N];
int n, m, x;
vector<int> dp((1 << N), int(1e8));

int main()
{
    fast();
    cin >> n >> m >> x;
    for(int i = 0; i < n; i++)
    {
        cin >> cost[i];
        for(int j = 0; j < m; j++)
        {
            cin >> v[i][j];
        }
    }

    for(int j = 0; j < m; j++)
    {
        int add = 0;
        for(int i = 0; i < n; i++)
        {
            add += v[i][j];
        }
        if(add < x)
        {
            cout << -1 << endl;
            return 0;
        }
    }

    dp[0] = 0;
    for(int mask = 0; mask < (1 << n); mask++)
    {
        vector<int> temp(n, 0);
        for(int i = 0; i < n; i++)
            if((mask >> i) & 1)
                for(int j = 0; j < m; j++) temp[j] += v[i][j];

        bool f = 0;
        for(int i = 0; i < m; i++)
            if(temp[i] < x) f = 1;

        for(int i = 0; i < n; i++)
        {
            if((mask >> i) & 1) continue;
            if(f == 0) dp[mask | (1 << i)] = min(dp[mask | (1 << i)], dp[mask]);
            else dp[mask | (1 << i)] = min(dp[mask | (1 << i)], dp[mask] + cost[i]);
        }
    }

    cout << dp[(1 << n) - 1] << endl;
}

Measured memory_bytes: 3600
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

int main()
{
    int N, K;   cin >> N >> K;
    vector<int> A(N);
    for (int i = 0; i < N; i++) cin >> A[i];

    vector<int> cnt(N);
    for (int i = 0; i < N; i++){
        cnt[A[i]]++;    //個数を数える
    }

    sort (cnt.begin(), cnt.end(), greater<int>());
    int sum = 0;
    for (int i = 0; i < K; i++){
        sum += cnt[i];
    }
    cout << N - sum << endl;
}

Measured memory_bytes: 1792
#include <stdio.h>
#include <assert.h>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <array>
#include <vector>
#include <queue>
#include <set>
#include <cmath>
//#include <unordered_map>
//#include <unordered_set>
//#include <boost/container/static_vector.hpp>
//#include <boost/unordered_set.hpp>
//#include <boost/unordered_map.hpp>
//#include <unistd.h>

//#include <cv.h>
//#include <highgui.h>
#include <stdlib.h>
#include <string>

struct Node {
    std::vector<int> neighbor;
    std::vector<int> children;
    int rank;
    long long stone;
};

const int MAX_N = 100050;

int N, a[MAX_N], b[MAX_N];
long long A[MAX_N];

Node tree[MAX_N];

void set_rank_children(int i, int rank, int parent) {
    tree[i].rank = rank;
    for (int n : tree[i].neighbor) {
        if (n != parent) {
            set_rank_children(n, rank + 1, i);
            tree[i].children.push_back(n);
        }
    }
}

int main(int argc, char **argv) {
    std::cin >> N;

    for (int i = 1; i <= N; i++) {
        std::cin >> A[i];
    }

    for (int i = 1; i < N; i++) {
        std::cin >> a[i] >> b[i];
    }

    for (int i = 1; i <= N; i++) {
        tree[i].stone = A[i];
    }

    for (int i = 1; i < N; i++) {
        tree[a[i]].neighbor.push_back(b[i]);
        tree[b[i]].neighbor.push_back(a[i]);
    }

    set_rank_children(1, 0, 0);

    std::vector<std::pair<int, int>> node_rank;
    for (int i = 1; i < N; i++) {
        node_rank.push_back(std::pair<int, int>({i, tree[i].rank}));
    }
    std::sort(node_rank.begin(), node_rank.end(),
        [](const std::pair<int, int>& a, const std::pair<int, int>& b) { return a.second > b.second; }
    );

    for (auto p : node_rank) {
        int n = p.first;
        long long child_sum = 0;
        long long max_num = 0;
        for (int c : tree[n].children) {
            child_sum += tree[c].stone;
            max_num = std::max(max_num, tree[c].stone);
        }

        if (tree[n].children.size() == 0) {
            continue;
        } else if (tree[n].children.size() == 1) {
            if (child_sum != tree[n].stone) {
                std::cout << "NO" << std::endl;
                return 0;
            }
            if (n == 1) {
                std::cout << "YES" << std::endl;
                return 0;
            }
        } else {
            long long proc_num = child_sum - tree[n].stone;
            tree[n].stone -= proc_num;
            if (proc_num < 0 || tree[n].stone < 0 || proc_num + tree[n].stone < max_num) {
                std::cout << "NO" << std::endl;
                return 0;
            }
            if (n == 1) {
                if (tree[n].stone == 0) {
                    std::cout << "YES" << std::endl;
                    return 0;
                } else {
                    std::cout << "NO" << std::endl;
                    return 0;
                }
            }
        }
    }

    assert(false);
    return 0;
}



Measured memory_bytes: 23420
#include <bits/stdc++.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;

typedef long long int lli;
typedef pair<int, int> ii;

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

#ifdef LOCAL
	#define eprintf(...) printf(__VA_ARGS__)
#else 
	#define eprintf(...) 1
#endif

#define ROUNDUP(a, b) 		( ((a) + ((b) - 1) ) / b)
#define SET_ZERO(a)	 		( memset((a), 0, sizeof(a)))
#define SET_NUM_ARRAY(a,b)	( memset((a), b, sizeof(a)))
//#define int long long int //dont forget to change int to signed

int main() {
	int N;
	scanf("%d", &N);
	lli a[2*1000*100+9];
	SET_ZERO(a);
	for (int i = 1; i <= N; i++) {
		lli lld;
		scanf("%lld", &lld);
		a[i] = a[i-1] + lld;
	}

	lli min = 1001001001001001;
	for (int i = 1; i <= N-1; i++) {
		lli x = a[i], y = a[N] - a[i];
		chmin<lli>(min, x-y>0?x-y:y-x);
	}
	printf("%lld\n", min);
	return 0;
}


Measured memory_bytes: 1792
import java.util.*;
class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    
    int n = sc.nextInt();
    
    int cake = 4;
    int donatu = 7;
    
      
      for(int i=0 ; i<=25; i++){
        
        for(int j=0 ; j<=14; j++){
          
         int total =  cake*i+donatu*j;      
         
           if(total==n){
          System.out.println("Yes");
          return;
        }
      }
     
    }
    System.out.println("No");
  }
}

Measured memory_bytes: 23252
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define rep2(i,n) for(int i = 1; i <= (n); ++i)
#define rrep2(i,n) for(int i = (n); i > 0; --i)
#define srep(i,s,n) for(int i = s; i < (n); ++i)
#define rsrep(i,s,n) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }
#define out_ary(...) { int n = (__VA_ARGS__).size(); rep(i, n) printf("%d%s", (__VA_ARGS__)[i], i != n-1 ? " " : "\n"); }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<P> vpair;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<vstr> vvstr;
typedef vector<vbool> vvbool;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;


int main() {
    int n, K;
    cin >> n >> K;
    vll x(n), y(n);
    rep(i, n) cin >> x[i] >> y[i];

    vll nx, ny;

    ll ans = (LINF/2)*9;
    rep(i, n) {
        rep(j, n) {
            nx.push_back(x[i]);
            ny.push_back(y[j]);
        }
    }

    rep(i, n*n) {
        srep(j, i+1, n*n) {
            ll x_mn = min(nx[i], nx[j]);
            ll x_mx = max(nx[i], nx[j]);
            ll y_mn = min(ny[i], ny[j]);
            ll y_mx = max(ny[i], ny[j]);
            int count = 0;
            rep(k, n) {
                if (x[k] >= x_mn && x[k] <= x_mx && y[k] >= y_mn && y[k] <= y_mx) count++;
            }
            if (count >= K) {
                ans = min(ans, (x_mx - x_mn) * (y_mx - y_mn));
            }

        }
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 384
import java.util.Scanner;

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

        int x = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        if (b <= a) {
            System.out.println("delicious");
        } else if (b <= a + x) {
            System.out.println("safe");
        } else {
            System.out.println("dangerous");
        }
    }
}


Measured memory_bytes: 22612
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] shohinArray = new int[n];
		for(int i = 0;i < n;i++) {
			shohinArray[i] = sc.nextInt();
		}
		int totalVote = 0;
		for(int i = 0;i < n;i++) {
			totalVote += shohinArray[i];
		}
		Arrays.sort(shohinArray);
		double rate = (shohinArray[n  -m] * 100000)/totalVote;
		double base = 100000 / (4 * m);
		if(rate >= base ) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}

	}
}

Measured memory_bytes: 21972
#include<iostream>
using namespace std;
#include<algorithm>
#include<cstdio>
int main()
{ 
	int N,sum=0;
	char s[100];
	cin >> N;
	for (int i = 0; i < N; i++)
		cin >> s[i];
	for (int i = 0; i < N - 2; i++)
	{
		if(s[i]=='A'&&s[i+1] == 'B'&&s[i+2] == 'C') sum += 1;
	}
	cout << sum;
}

Measured memory_bytes: 888
// ARC092A.cpp
#include <bits/stdc++.h>

using namespace std;

const int MAX_N = 210;

int n;
bool enabled[MAX_N];

struct point
{
    int x, y, typ;
    bool operator<(const point &rhs) const { return x < rhs.x; }
} pts[MAX_N];

int main()
{
    scanf("%d", &n);
    for (int i = 1; i <= (n << 1); i++)
        scanf("%d%d", &pts[i].x, &pts[i].y), pts[i].typ = i > n;
    sort(pts + 1, pts + 1 + (n << 1));
    int ans = 0;
    for (int i = 1; i <= (n << 1); i++)
        if (pts[i].typ == 1)
        {
            int id = -1;
            for (int j = 1; j < i; j++)
                if (!enabled[j] && pts[j].typ == 0 && pts[j].y < pts[i].y && (id == -1 || pts[j].y > pts[id].y))
                    id = j;
            if (id != -1)
                enabled[id] = true, ans++;
        }
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 256
#pragma warning(disable:4996)
#include <bits/stdc++.h>

using namespace std;

//macro
#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define EPS (1e-8)
#define equals(a,b)(fabs((a)-(b))<EPS)

using ll = long long;
using ull = unsigned long long;
using vb = vector<bool>;
using vi = vector<int>;
using vll = vector<ll>;
using vs = vector<string>;
using vvb = vector<vb>;
using vvi = vector<vi>;
using vvll = vector<vll>;
//func
template<typename A, typename T>void assign2d(A&arr, ll H, ll W, T t) { arr.resize(H); REP(i, H) arr[i].assign(W, t); }
template<class T> ostream &operator<<(ostream &os, const vector<T> &v) { int n = v.size(); REP(i, n)os << v[i] << (i == n - 1 ? "" : " "); return os; }
template <class T = int> inline T IN() { T x; cin >> x; return x; }
template<class T> inline void OUT(const T &x) { cout << x << "\n"; }
struct pre_ { pre_() { cin.tie(nullptr); ios::sync_with_stdio(false); /*cout << fixed << setprecision(6);*/ } } pre__;


int main(void) {
	int N, M;
	cin >> N;
	map<string, int> m;
	REP(i, N) {
		string s;
		cin >> s;
		if (m.count(s) == 0) {
			m[s] = 0;
		}
		m[s]++;
	}
	cin >> M;
	REP(i, M) {
		string s;
		cin >> s;
		if (m.count(s) == 0) {
			m[s] = 0;
		}
		m[s]--;
	}
	int ans = -114514;
	for (auto _m : m) {
		if (_m.second > ans) {
			ans = _m.second;
		}
	}
	if (ans < 0) {
		OUT("0");
		return 0;
	}
	OUT(ans);
	return 0;
}

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

using namespace std;

int main() {
  int A,B;
  cin>>A>>B;
  int cnt=0;
  for(int i=A;i<=B;i++){
    string s=to_string(i);
    if(s[0]==s[4]&&s[1]==s[3])cnt++;
  }
  cout<<cnt<<endl;
}


Measured memory_bytes: 256
open System

[<EntryPoint>]
let main argv =
    let n = stdin.ReadLine() |> int
    let s = [|1..n|]
    let a = stdin.ReadLine().Split(' ') |> Array.map int
    for i = 1 to n do s.[a.[i-1]-1] <- i
    String.Join(" ", (s |> Array.map string)) |> printfn "%s"
    0


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

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

    set<char> used;
    for(char c : s){
        if(used.count(c)){
            cout << "no" << endl;
            return 0;
        }
        used.insert(c);
    }

    cout << "yes" << endl;

    return 0;
}


Measured memory_bytes: 384
/*input
123 456
*/
/**
    Author: Kristopher Paul
    Date Created: 21-12-2019
    Contest Name:
                _/    _/   _/_/_/_/   _/   _/_/_/_/
               _/  _/     _/    _/   _/   _/
              _/_/       _/_/_/_/   _/   _/_/_/_/
             _/  _/     _/  _/     _/         _/
            _/    _/   _/    _/   _/   _/_/_/_/
**/
#include<bits/stdc++.h>
#include<stdio.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define int ll
#define pb push_back
#define INF 1e18
#define MOD 1000000007
//#define MOD 998244353
#define mp make_pair
const double PI=3.141592653589793238462643383279502884197169399375105820974944;
#define REP(i,n) for (int i = 0; i < n; i++)
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define REPD(i,n) for (int i = n-1; i >= 0; i--)
#define FORD(i,a,b) for (int i = a; i >= b; i--)
#define remax(a,b) a = max(a,b)
#define remin(a,b) a = min(a,b)
#define umap unordered_map
#define pii pair<int,int>
#define F first
#define S second
#define mii map<int,int>
#define vi vector<int>
#define vvi vector<vi>
#define itr :: iterator it
#define all(v) v.begin(),v.end()
#define WL(t) while(t--)
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define out(x) cout << #x << " is " << x << endl
#define FastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

//Uncomment for File I/O
/*
#define cin fin
#define cout fout

ifstream fin("cowmbat.in");
ofstream fout("cowmbat.out");
*/

using namespace std;
//using namespace __gnu_pbds;

//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> pbds; // set
//typedef tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update> pbds; // multiset

int ModExp(int x,int y,int m){
    int res = 1;
    x = x % m;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % m;

        y = y>>1;
        x = (x*x) % m;
    }
    return res;
}

void solve(){
    int a,b;
    cin >> a >> b;
    cout << lcm(a,b) << endl;
}

signed main(){
    FastIO;
    int t = 1;
//    cin >> t;
    WL(t){
        solve();
    }
}


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

int main()
{
	string s;
	bool b;

	cin >> s;
    
	if (s.at(0) == s.at(1) && s.at(2) == s.at(3) && s.at(1) != s.at(2))
		b = true;
	else if (s.at(0) == s.at(2) && s.at(1) == s.at(3) && s.at(0) != s.at(1))
		b = true;
	else if (s.at(0) == s.at(3) && s.at(1) == s.at(2) && s.at(0) != s.at(1))
		b = true;
	else
		b = false;

	if(b)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

	return 0;
	
}

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

int main() {
  int K,S;
  cin >> K >> S;
  int ans = 0;
  rep(i,K+1){
    rep(j,K+1){
      if ((i+j<=S)&&(S-i-j<=K)){     
        ans++;
      }
    }
  
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<list>
#include<string>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<ctime>
using namespace std;

typedef long long ll;
bool debug = false;
const int NIL = -1;
const int INF = 1000000000;
const int NUM = 1410;
clock_t START, END;
int G[NUM][NUM];

struct rect {
	int height, pos;
};

int main(void)
{
	if (debug) {
		START = clock();
		freopen("in29.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
	};
	int H, W, t, maxArea = 0;
	cin >> H >> W;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			cin >> t;
			if (i == 0) {
				if (t)
					G[i][j] = 0;
				else
					G[i][j] = 1;
			}
			else {
				if (t)
					G[i][j] = 0;
				else
					G[i][j] = G[i - 1][j] + 1;
			}
		}
	}
	stack<rect> S;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (S.empty() || S.top().height <= G[i][j]) {
				S.push({ G[i][j], j });
			}
			else {
				int _pos = W;
				while (!S.empty() && S.top().height > G[i][j]) {
					maxArea = max(maxArea, S.top().height * (j - S.top().pos));
					_pos = min(_pos, S.top().pos);
					S.pop();
				}
				S.push({ G[i][j],_pos });
			}
		}
		while (!S.empty()) {
			maxArea = max(maxArea, S.top().height * (W - S.top().pos));
			S.pop();
		}
	}
	cout << maxArea << endl;
	if (debug) {
		END = clock();
		double endtime = (double)(END - START) / 1000;
		printf("total time = %lf s", endtime);
	}
	return 0;
}


Measured memory_bytes: 10852
n = int(input())
a = list(map(int, input().split()))
g_count = 0
n_count = 0
for i in a:
  if (i % 2) == 0:
    g_count += 1
    if (i % 3) == 0 or (i % 5) == 0:
      n_count += 1
if g_count == n_count:
  print('APPROVED')
else:
  print('DENIED')

Measured memory_bytes: 3060
#!/usr/bin/env python3
import bisect
import collections
import sys

sys.setrecursionlimit(1000000)
ACMOD = 1000000007
INF = 1 << 62



def solve(S: str):
    print(S[:3])
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()


Measured memory_bytes: 9404
#include <bits/stdc++.h>
using namespace std;
 
int main() {

	int N;
	cin >> N;
	vector<tuple <string,int,int>> R(N);
	for (int i=0; i<N; i++){
		string S;
		int P;
		cin >> S >> P;
		R.at(i) = make_tuple(S,100-P,i+1);
	}
	
	sort(R.begin(),R.end());
	for (int i=0; i<N; i++){
		cout << get<2>(R.at(i)) << endl;
	}
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <cctype>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr int INF = 1 << 30;
constexpr ll LINF = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int a, b;
    cin >> a >> b;
    for(int i=1;i<=2000;++i) {
        if(int(i * 0.08) == a && int(i * 0.10) == b) {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}


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

int main(){
  int n, m, sum = 0;
  cin >> n >> m;
  vector <int> vote(n);
  for (int i = 0; i < n; i++){
    cin >> vote.at(i);
    sum += vote.at(i);
  }
  int cnt = 0;
  for (int i = 0; i < n; i++){
    if (sum % 4 == 0){
      if(vote.at(i) >= sum/(4*m))
        cnt++;
    }
    else{
      if(vote.at(i) >= sum/(4*m) + 1)
        cnt++ ;
    }
  }
  if(cnt >= m)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))
a = 0
S = 0
num = 1
for i in range(1,N):
    if A[i] - A[i - 1] == 0:
        a = 0
    elif A[i] - A[i - 1] > 0:
        a = 1
    else:
        a = 2
    if S == 0:
        S = a
    elif (S != a) and (a != 0):
        num += 1
        S = 0
print(num)


Measured memory_bytes: 20136
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('a1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    K, X = read_int_list()
    res = 'Yes' if K * 500 >= X else 'No'
    print(res)


main()


Measured memory_bytes: 3956