akhauriyash/Code-Regression huggingface dataset:
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			
			String str = sc.nextLine();
			
			String[] params = str.split(" ");
			
			final int box_length = Integer.parseInt(params[0]);
			final int cakes = params.length - 1;
			int[] cake_len = new int[cakes];
			for(int i = 0; i < cakes; i++){
				cake_len[i] = Integer.parseInt(params[i+1]);
			}
			
			Arrays.sort(cake_len);
			
			List<Integer> list = new ArrayList<Integer>();
			boolean flag = true;
			for(int i = 0; i < cakes/2; i++){
				if(flag){
					list.add(0, cake_len[i]);
					list.add(cake_len[cakes - i - 1]);
					flag = false;
				}else{
					list.add(0, cake_len[cakes - i - 1]);
					list.add(cake_len[i]);
					flag = true;
				}
			}
			
			if(cakes == 1){
				list.add(cake_len[0]);
			}else if(cakes % 2 == 1){
				
				if(list.get(0) > cake_len[cakes/2]){
					list.add(0, cake_len[cakes/2]);
				}else{
					list.add(cake_len[cakes/2]);
				}
			}
			
			//System.out.println(list);
			
			double sum = list.get(0) + list.get(cakes-1);
			
			for(int i = 0; i < cakes-1; i++){
				sum += 2 * Math.sqrt(list.get(i) * list.get(i+1));
			}
			//System.out.println(sum);
			if(sum <= box_length){
				System.out.println("OK");
			}else{
				System.out.println("NA");
			}
		}
		
		
	}
	
}

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

int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  for(int i=0;i<N;i++){
    cin >> A.at(i);
  }
  
  sort(A.begin(),A.end());
  
  int maxi;
  for(int i=0;i<N;i++){
    maxi = A.at(N-1) - A.at(0);
  }
  
  cout << maxi << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll INF = 1e9+123;
#define DEBUG
#define PI 3.141592653589793238462643383279

#define _GLIBCXX_DEBUG
#ifdef DEBUG
#define s(...) show(__VA_ARGS__);
#define sl(...) show(__VA_ARGS__);cout<<endl;
#else
#define s(...)
#define sl(...)
#endif
void show() {}
template <class Head,class... Args>void show(Head t,Args... args){std::cout<<t<<" ";show(args...);}
#define REP(i, n) for(ll i = 1; i <= n; i++)
#define REPR(i, n) for(ll i = n; i >= 1; i--)
#define FOR(i, m, n) for(ll i = m; i <= n; i++)
#define VEC(type,A,N) vector<type> A(N+10)
#define VECi(type,A,N,i) vector<type> A(N+10,i)
#define VEC2(type,A,N,M) vector<vector<type>> A(N+10,vector<type>(M+10))
#define VEC2i(type,A,N,M,i) vector<vector<type>> A(N+10,vector<type>(M+10,i))
#define ALL(v) v.begin()+1, v.end()-9
ll frac(ll k){
    int s = 1;
    for (ll i=1; i<=k; ++i)s *= i;
    return s;
}
ll gcd(ll a, ll b){
   if (a%b==0)return(b);
   else return(gcd(b, a%b));
}
ll lcm(ll a,ll b){
    return a*b/gcd(a,b);
}
ll antidiv(ll N,ll C,ll D){
    return N-floor(N/C)-floor(N/D)+floor(N/lcm(C,D));
}
int main(){
    ll N;
    cin>>N;
    
    vector<ll> ret;
    for (ll i = 1; i * i <= N; i++) {
        if (N % i == 0) {
            ret.push_back(i);
            if (i * i != N) ret.push_back(N / i);
        }
    }
    sort(ret.begin(), ret.end()); // 昇順に並べる
    
    ll min=INF*INF;
    //<<min;
    REP(i,ret.size()/2+1){
        ll t=ret[i-1]+ret[ret.size()-i]-2;
        //sl(ret[i-1],ret[ret.size()-i],t);
        min=t<min?t:min;
    }
    cout<<min;
    
    //sort(ALL(C),[](auto& a, auto& b) {return a[2] < b[2];});
    //if(equal(D.begin(), D.end()-1, K.begin()))cout<<"Yes";else cout<<"No";
    cout<<endl;
    return 0;
}


Measured memory_bytes: 384
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007

#+++++

def main():
	n = int(input())
	#b , c = tin()
	#s = input()	
	al=lin()
	ch=0
	ret=0
	for h in al:
		ret += max(h-ch, 0)
		ch = h
	return ret
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Measured memory_bytes: 61976
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <climits>
#include <vector>

using namespace std;

typedef vector< bool > BVI;
typedef vector< int > VI;
typedef vector< VI > VVI;

int main() {
	int n, m;	

	while( true ) {

		cin >> n;

		if( n == 0 ) {
			break;
		}

		cin >> m;

		VVI map(n, VI(n, INT_MAX / 4));
		VI mincost(n, INT_MAX / 4);
		BVI used(n, false);
		mincost[0] = 0;
		int res = 0;
		int a, b, c;
		char dummy;

		for(int i = 0; i < m; i++) {
			cin >> a >> dummy >> b >> dummy >> c;
			map[a][b] = (c / 100) - 1;
			map[b][a] = (c / 100) - 1;
		}

		while( true ) {
			int v = -1;
			for(int u = 0; u < n; u++) {
				if(!used[u] && (v == -1 || mincost[u] < mincost[v])) {
					v = u;
				}
			}

			if( v == -1 ) {
				break;
			}
			used[v] = true;
			res += mincost[v];

			for(int u = 0; u < n; u++) {
				mincost[u] = min(mincost[u], map[v][u]);
			}
		}


		cout << res << endl;
	}
}

Measured memory_bytes: 1260
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,a) REP(i,0,a)
#define rev(s) reverse(s.begin(),s.end())
#define pb push_back
#define MAX 100

int main()
{
	// #ifndef ONLINE_JUDGE
	// freopen("input.txt","r",stdin);
	// freopen("output.txt","w",stdout);
	// #endif
	ll n,i;
	vector<string> v;
	cin>>n;
	rep(i,n)
	{
		string s;
		cin>>s;
		v.pb(s);
	}
	// cout<<v[0][0]<<endl<<5;
	sort(v.begin(),v.end());
	 // cout<<v[0]<<v[1]<<endl;
	ll count=0;
	rep(i,v.size()-1)
	{
		if(v[i]==v[i+1])
			continue;
		else count++;
	}
	count++;
	if(n==1)
		count=1;
	cout<<count<<endl;
	return 0;
}

Measured memory_bytes: 11640
for i in range(4):
    _in=[int(num)for num in input().split(' ')]
    n=_in[0]
    if n==1:
        print(6000*_in[1])
    elif n==2:
        print(4000*_in[1])
    elif n==3:
        print(3000*_in[1])
    else:
        print(2000*_in[1])

Measured memory_bytes: 7664
#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long
using namespace std;
ll dp[100010][3], v[100010][3], n;
ll f(int pos, int stts, int cnt){
    if(n == pos) return 0;
    ll &ans = dp[pos][stts];
    if(ans != -1) return ans;
    ans = -2e9;
    if(cnt < 2)
        ans = max(ans, f(pos + 1, stts, 2));
    ans = max(ans, f(pos + 1, (stts + 1) % 3, 1) + v[pos][stts]);
    ans = max(ans, f(pos + 1, (stts + 2) % 3, 1) + v[pos][stts]);
    return ans;
}
int main(){
    fast;
    memset(dp, -1, sizeof dp);
    cin >> n;
    for(int i = 0; i < n; i++)
        cin >> v[i][0] >> v[i][1] >> v[i][2];
    cout << max(f(0, 0, 1), max(f(0, 1, 1), f(0, 2, 1))) << "\n";
	return 0;
}


Measured memory_bytes: 14512
#include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
#define MAXN 111111
using namespace std;
int pre[MAXN];
int find(int x)
{
	return (pre[x] == x) ? x : pre[x] = find(pre[x]);
}
struct Node
{
	int u, v;
	int power;
}node[MAXN];
bool cmp(const Node& x, const Node& y)
{
	return x.power < y.power;
}
int main(void)
{
	int n, m;

	while (scanf("%d%d", &n, &m) != EOF)
	{
		int ans = 0;

		for (int i = 0; i <= n; i++)pre[i] = i;
		for (int i = 0; i < m; i++)scanf("%d%d%d", &node[i].u, &node[i].v, &node[i].power);
		sort(node, node + m, cmp);
		for (int i = 0; i < m; i++)
		{
			int fx = find(node[i].u);
			int fy = find(node[i].v);

			if (fx != fy)
			{
				ans += node[i].power;
				pre[fx] = fy;
			}
		}
		printf("%d\n", ans);
	}

	return 0;
}


Measured memory_bytes: 4372
#include <iostream>
#include <cstdlib>
#include <time.h>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <array>
#include <string>
using namespace std;

typedef long long int ll;

int main(){
	cin.sync_with_stdio(false);
	cin.tie(0);
	ll n;
	cin >> n;
	ll ans = 0;
	ll a[n];
	for(ll i=0; i<n; i++)
		cin >> a[i];
	sort(a, a+n);
	for(ll i=0; i<n; i++){
		for(ll j=i+1; j<n; j++){
			for(ll k=j+1; k<n; k++){
				if(a[i] + a[j] > a[k] and a[i] + a[k] > a[j] and a[k] + a[j] > a[i])
					ans++;
			}
		}
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 3644
#include <iostream>
#include <algorithm>
#include <string>
#include <numeric>
#include <boost/math/common_factor_rt.hpp>
using namespace std;
#define rep(i, n) for(int i = 0;i < n;i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define ll long long

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

  cout << A+B/2 <<endl;
}

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

using namespace std;

int main() {
#ifdef LOCAL
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  int n, m;
  scanf("%d %d", &n, &m);
  int ans = -1;
  for (int i = 1; i * i <= m; ++i) {
    if (m % i != 0) {
      continue;
    }
    for (int it = 0; it < 2; ++it) {
      int d = it == 0 ? i : m / i;
      if (m / d >= n) {
        ans = max(ans, d);
      }
    }
  } 
  assert(ans != -1);
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, n) for(int i = 0; i < (n); ++i)
#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define TRAV(i, a) for(auto & i : (a))
#define SZ(x) ((int)(x).size())
#define PR std::pair
#define MP std::make_pair
#define X first
#define Y second
typedef long long ll;
typedef std::pair<int, int> PII;
typedef std::vector<int> VI;

int tab[15][1005];
int main(){
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(0);
	int h, w, k;
	std::cin >> h >> w >> k;
	FOR(i, h){
		FOR(j, w){
			char a;
			std::cin >> a;
			if(a == '1') tab[i][j] = 1;
		}
	}
	const int INF = 100005;
	int best = INF;
	FOR(mask, 1<<(h-1)){
		std::vector<VI> vec;
		vec.emplace_back(w, 0);
		FOR(b, h){
			FOR(i, w) if(tab[b][i]) vec.back()[i]++;
			if(b != h-1 && (mask & (1<<b))) vec.emplace_back(w, 0);
		}
		int cand = 0;
		int x = SZ(vec);
		VI have(x);
		FOR(i, w){
			VI cur(x);
			bool good = true;
			FOR(j, x){
				cur[j] += vec[j][i];
				if(cur[j] > k) cand = INF;
				if(have[j]+cur[j] > k) good = false;
			}
			if(good){
				FOR(j, x) have[j] += cur[j];
			}else{
				cand++;
				have = cur;
			}
		}
		best = std::min(best, cand+__builtin_popcount(mask));
	}
	std::cout << best << "\n";
	return 0;
}

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

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

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


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define pb push_back
#define all(_obj) _obj.begin(),_obj.end()
#define F first
#define S second
#define INF 1e18
#define pll pair<ll, ll> 
#define vll vector<ll>
ll n,m,a,b,c,k,temp,x,y;
const int MAXN=1e5+11,mod=1e9+7;
inline ll max(ll a,ll b) {return ((a>b)?a:b);}
inline ll min(ll a,ll b) {return ((a>b)?b:a);}
inline vll read(int n) {vll v(n);for (int i = 0; i < v.size(); i++)cin>>v[i];return v;}
int col[3*MAXN];
vll row[3*MAXN];
void sol()
{
cin>>n>>m>>k;
for(int i=0;i<k;i++)
{
    cin>>a>>b;
    row[a].pb(b);
    col[b]++;
}
set<pll,greater<pll>> s;
for(int i=1;i<=m;i++) s.insert({col[i],i});
ll mx=0;
for(int i=1;i<=n;i++)
{
 int del=row[i].size();
 for(auto x:row[i])
 {
     pll p={col[x],x};
     s.erase(p);
     s.insert({col[x]-1,x});
     col[x]--;
 }
//  cout<<del<<' ';
//  cout<<(*s.begin()).F<<'\n';
 mx=max(del+(*s.begin()).F,mx);
  for(auto x:row[i])
 {
     pll p={col[x],x};
     s.erase(p);
     s.insert({col[x]+1,x});
     col[x]++;
 }
}
cout<<mx;









return ;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int test=1;
    //cin>>test;
    for(int i=1;i<=test;i++)
    sol();
}


Measured memory_bytes: 39944
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

/**
 * 0066 Tic Tac Toe
 */
public class Main {

    public static void main(String[] args) throws IOException {
        List<TicTacToe> ticTacToeList = readTicTacToe();
        for (TicTacToe ticTacToe : ticTacToeList) {
            // System.out.println(ticTacToe);
            System.out.println(ticTacToe.judge());
        }
    }

    private static List<TicTacToe> readTicTacToe() throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        List<TicTacToe> ticTacToeList = new ArrayList<>();
        String line = null;
        while ((line = reader.readLine()) != null) {
            ticTacToeList.add(new TicTacToe(line));
        }
        return ticTacToeList;
    }

    // Tic Tac Toe
    private static class TicTacToe {

        // Win pattern
        Pattern[] WIN_PATTERN = { Pattern.compile(".*1.*4.*7.*"), Pattern.compile(".*2.*5.*8.*"),
                Pattern.compile(".*3.*6.*9.*"), Pattern.compile(".*1.*2.*3.*"), Pattern.compile(".*4.*5.*6.*"),
                Pattern.compile(".*7.*8.*9.*"), Pattern.compile(".*1.*5.*9.*"), Pattern.compile(".*3.*5.*7.*") };

        // position
        private String o = "";
        private String x = "";

        // Constructor
        public TicTacToe(String input) {
            for (int i = 0; i < input.length(); i++) {
                if (input.charAt(i) == 'o') {
                    o = o + (i + 1);
                } else if (input.charAt(i) == 'x') {
                    x = x + (i + 1);
                }
            }
        }

        // Judge
        private char judge() {
            // Check o
            for (Pattern p : WIN_PATTERN) {
                if (p.matcher(o).matches()) {
                    return 'o';
                }
            }
            // Check x
            for (Pattern p : WIN_PATTERN) {
                if (p.matcher(x).matches()) {
                    return 'x';
                }
            }
            return 'd';
        }

        @Override
        public String toString() {
            return "o: " + o + ", x: " + x;
        }
    }
}

Measured memory_bytes: 26024
#include "bits/stdc++.h"
#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cout<<#v<<":";for(int i=0;i<v.size();i++) cout<<" "<<v[i]; cout<<endl
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define MOD 1000000007
#define mod 1000000009
#define pi 3.14159265358979323846
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
typedef long long ll;
const int inf = 1000000001;
const ll INF = 1e18 * 4;
using namespace std;

int dp[42][402][402];

int main(){
    rep(i, 0, 42){
        rep(j, 0, 402){
            rep(k, 0, 402){
                dp[i][j][k] = inf;
            } 
        }
    }
    int N, ma, mb; cin >> N >> ma >> mb;
    vi a;
    vi b;
    vi c;
    rep(i, 0, N){
        int p, k, l; cin >> p >> k >> l;
        a.push_back(p);
        b.push_back(k);
        c.push_back(l);
    }
    rep(i, 0, N+1){
        dp[i][0][0] = 0;
    }
    rep(i, 0, N){
        rep(j, 0, 402){
            rep(k, 0, 402){
                if(j-a[i] >= 0 && k-b[i] >= 0){
                    dp[i+1][j][k] = min(dp[i][j][k], dp[i][j-a[i]][k-b[i]] + c[i]);
                } else {
                    dp[i+1][j][k] = dp[i][j][k];
                }
            }
        }
    }
    int ans = inf;
    rep(j, 0, 402){
        rep(k, 0, 402){
            if(j==0 && k == 0) continue;
            if(j * mb == k * ma){
                ans = min(ans, dp[N][j][k]);           
            }
        }
    }
    /* rep(i, 0, 4){ */
    /*     cout << i << endl; */
    /*     rep(j, 0, 10){ */
    /*         rep(k, 0, 10){ */
    /*             cout << dp[i][j][k] << " "; */
    /*         } cout << endl; */
    /*     } */
    /*     cout << endl; */
    /* } */
    if(ans == inf) cout << "-1" << endl;
    else cout << ans << endl;

    return 0;
}




Measured memory_bytes: 26752
#include<iostream>
#include<algorithm>
using namespace std;
static const int MAX=200000;

int main(){
    int R[MAX], n;
    
    cin >> n;
    for(int i = 0; i < n; i++) cin >> R[i];
    
    int maxv = -2000000000;
    int minv = R[0];
    
    for(int i = 1; i < n; i++){
        maxv = max(maxv, R[i] - minv);
        minv = min(minv, R[i]);
    }
    
    cout << maxv << endl;
    
    return 0;
}


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

int main() {
    int N; cin >> N;
    vector<int> a(N);
    rep(i, N){
        cin >> a[i];
    }

    ll ans = 1001001001;
    for (int i = -100; i < 101; i++){
        ll now = 0;
        for (int j = 0; j < N; j++){
            int c = abs(i-a[j]);
            c *= c;
            now += c;
        }
        ans = min(ans, now);
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3612
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;

const int N = 1e5 + 50;

struct edge {
  int nxt, to;
} e[N << 1];
int fir[N], cnt = 1;

inline void addedge(int x, int y) {
  e[++ cnt] = (edge) { fir[x], y }; fir[x] = cnt;
}

int n;

inline int Dfs(int x, int f) {
  int sg = 0;
  for (int i = fir[x]; i; i = e[i].nxt)
    if (e[i].to != f) sg ^= Dfs(e[i].to, x) + 1;
  return sg;
}

int main() {
  scanf("%d", &n);
  for (int i = 1, x, y; i < n; i ++) {
    scanf("%d%d", &x, &y);
    addedge(x, y); addedge(y, x);
  }
  puts(Dfs(1, 0) ? "Alice" : "Bob");
  return 0;
}


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

int main(){
    int n,cnt=0,ans=0;
    cin>>n;

    for(int i=1; i<=n; i=i+2){
        cnt=0;
        for(int j=1; j<=i; j++){
            if(i%j==0) cnt++;
        }
        if(cnt==8) ans++;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3608
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner s=new Scanner(System.in);
		int r=0,w,r1=0;
		double x=0,y=0,si,co;
		String[] str;
		
		while(true){
			
			str=s.next().split(",");
			w=Integer.parseInt(str[0]);
			r=Integer.parseInt(str[1]);
			
			if(w==0 && r==0) break;
			
			si=w*Math.sin((r1*Math.PI/180.0));
			co=w*Math.cos((r1*Math.PI/180.0));

			x=x+si;
			y=y+co;

			if(r<0)r+=360;
			r1+=r;
			r1%=360;
		}
		int ans1=(int)x;
		int ans2=(int)y;
		System.out.println(ans1);
		System.out.println(ans2);

	}

}

Measured memory_bytes: 12000
// ConsoleApplication1.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>

using namespace std;

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

    for (int i = 0; i < s.size(); i++) {
        if (s[i] != t[i]) {
            cout << "No";
            return 0;
        }
    }

    if (s.size() + 1 == t.size()) {
        cout << "Yes";
    }
    else {
        cout << "No";
    }
    return 0;
}

// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します

Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define sz size
#define se second
#define fe first
#define mper make_pair
#define all(x) x.begin(), x.end()
#define mal ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL);
#define vl vector<ll>
#define vi vector<int>
#define vli vector <pair <ll, int> >
#define vll vector <pair <ll, ll> >
#define vii vector <pair <int, int> >
using namespace std;

ll n, m;
string a, b;

vector < pair <char, int> > g[5];

int main(){

mal

cin >> n >> m;
cin >> a >> b;


if(n == 1 || m == 1 || a[0] != b[0]) {cout << -1;return 0;}

if(n < m) {swap(n, m); swap(a, b);}



ll N = (n * m) / __gcd(n, m);


ll val1 = (((N / n * 1ll) * (N / m * 1ll) / __gcd((N / n) * 1ll, (N / m * 1ll)))) / (N / n * 1ll);

for(int i = 0; i < a.sz() - 1; ++i) {

    if((i + 1) % val1 == 0) {g[1].pb(mper(a[i], (i + 1) * (N / n) + 1));}

}

for(int i = 1; i < a.sz(); ++i) {

    if(i % val1 == 0) {g[2].pb(mper(a[i], (i) * (N / n) + 1));}

}

ll val2 = (N / n * 1ll) * (N / m * 1ll) / __gcd((N / n * 1ll), (N / m * 1ll)) / (N / m * 1ll);

for(int i = 0; i < b.sz() - 1; ++i) {

    if((i + 1) % val2 == 0) {g[3].pb(mper(b[i], (i + 1) * (N / m) + 1));}

}

for(int i = 1; i < b.sz(); ++i) {

    if(i % val2 == 0) {g[4].pb(mper(b[i], (i) * (N / m) + 1));}

}

ll cnt1 = 0;
ll cnt2 = 0;
ll cnt3 = 0;
ll cnt4 = 0;

bool check1 = 0;

for(int i = 0; i < g[1].sz(); ++i) {

//        cout << g[1][i].fe << ' ' << g[2][i].fe << ' ' << g[3][i].fe << ' ' << g[4][i].fe << '\n';

        if(g[3].sz() == g[1].sz()) {

            if(g[1][i].fe == g[3][i].fe) {
                cnt1++;

            }

        }

        if(g[4].sz() == g[1].sz()) {

            if(g[1][i].fe == g[4][i].fe && g[1][i].se >= g[4][i].se) {cnt2++;}

        }

        if(g[3].sz() == g[2].sz()) {

            if(g[2][i].fe == g[3][i].fe && g[2][i].se >= g[3][i].se) {cnt3++;}

        }

        if(g[4].sz() == g[2].sz()) {

            if(g[2][i].fe == g[4][i].fe && g[2][i].se >= g[4][i].se) {cnt4++;}

        }

}

ll all = max(max(g[1].sz() * 1ll, g[2].sz() * 1ll), max(g[3].sz() * 1ll, g[4].sz() * 1ll));

if(cnt1 == all || cnt2 == all || cnt3 == all || cnt4 == all) {cout << N;return 0;}
else {cout << -1;}

return 0;
}


Measured memory_bytes: 1468
C = [list(map(int,input().split())) for _ in range(3)]
N = 0
for i in range(3):
  N = max(N, max(C[i]))+1
for i in range(N):
  for j in range(N):
    for k in range(N):
      check = 0
      for l in range(3):
        if C[l][0]-i == C[l][1]-j == C[l][2]-k:
          check += 1
      if check == 3:
        print('Yes')
        exit()

print('No')

Measured memory_bytes: 3064
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Numerics;

namespace AtCoderWorkspace
{
    public class Solver
    {
        public void Solve()
        {
            var cin = new Scanner();
            var n = cin.nextInt();
            var s = n.ToString().ToCharArray();
            var ans = s[0] == '7' || s[1] == '7' || s[2] == '7';
            Console.WriteLine(ans? "Yes":"No");
        }
    }

    class Scanner
    {
        string[] s;
        int i;

        char[] cs = new char[] { ' ' };

        public Scanner()
        {
            s = new string[0];
            i = 0;
        }

        public string next()
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            if (s.Length == 0) return next();
            i = 0;
            return s[i++];
        }

        public int nextInt()
        {
            return int.Parse(next());
        }
        public int[] ArrayInt(int N, int add = 0)
        {
            int[] Array = new int[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt() + add;
            }
            return Array;
        }

        public int[] DPArrayInt(int N, int ex)
        {
            int[] Array = new int[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt();
            }
            return Array;
        }

        public long nextLong()
        {
            return long.Parse(next());
        }

        public long[] ArrayLong(int N, long add = 0)
        {
            long[] Array = new long[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong() + add;
            }
            return Array;
        }

        public long[] DPArrayLong(int N, int ex)
        {
            long[] Array = new long[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong();
            }
            return Array;
        }

        public double nextDouble()
        {
            return double.Parse(next());
        }


        public double[] ArrayDouble(int N, double add = 0)
        {
            double[] Array = new double[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextDouble() + add;
            }
            return Array;
        }
    }

    class Program
    {
        static void Main(string[] s) => new Solver().Solve();
    }
}


Measured memory_bytes: 27540
/*....
     
 "Be not afraid of GROWING slowly, be afraid only of STANDING Still"
                                                                     
....*/
#include<bits/stdc++.h>
#define Abhi_921 ios_base::sync_with_stdio(false); cin.tie(NULL)
#define ll long long
#define ld long double
#define fi(i,j,n) for(int i=j;i<n;i++)
#define fd(i,j,n) for(int i=j;i>n;i--)
#define print(a,n) for(int i=0;i<n;i++){cout<<a[i]<<' ';}cout<<endl;
#define inp(a,n) for(int i=0;i<n;i++) cin>>a[i]
#define printe(v) for(auto &i:v){cout<<i<<' ';}cout<<endl;
#define deb(n1) cout<<n1<<endl;
#define pb push_back
#define eb emplace_back
#define vi vector<ll>
#define vll vector<pair<ll,ll>>
#define umap unordered_map<ll,ll>
using namespace std;
const long long mod=1e9+7;
int n,a[100005];
int dp[100005];
ll solve(int i){
    dp[n-1]=0;
    if(dp[i]!=-1) return dp[i];
    int l=abs(a[i]-a[i+1])+solve(i+1);
    int r=INT_MAX;
    if(i+2<n){
    r=abs(a[i]-a[i+2])+solve(i+2);
    }
    return dp[i]=min(l,r);
}
int main(){
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
Abhi_921;
int t;
t=1;
while(t--){
cin>>n;
fi(i,0,n) cin>>a[i];
memset(dp,-1,sizeof(dp));
cout<<solve(0);
}
return 0;
}

Measured memory_bytes: 9044
n, m = map(int, input().split())
if n == 1:
  print(m)
  exit()
if n < int(m**(1/2)):
  for divide in range(n,int(m**(1/2))+1):
    if m % divide == 0:
      print(int(m/divide))
      exit()
  for divide in range(n,0,-1):
    if m % divide == 0:
      print(divide)
      exit()
else:
  for divide in range(m//n,0,-1):
    if m % divide == 0:
      print(divide)
      exit()

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

int main(){
    long long i, c = 0, res = 0;
    string s;
    cin >> s;
    for(i=0; i<s.length(); i++){
        if(s[i] == 'W'){
            res += i - c;
            c++;
        }
    }
    cout << res;
    return 0;
}

Measured memory_bytes: 640
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline void rd(int &x){
  int k;
  int m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(int x){
  int s=0;
  int m=0;
  char f[10];
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
template<class S, class T> inline S chmax(S &a, T b){
  if(a<b){
    a=b;
  }
  return a;
}
int N;
int A[15];
int X[15][15];
int Y[15][15];
int main(){
  int i;
  int res = 0;
  int mask;
  int cnt;
  rd(N);
  for(i=(0);i<(N);i++){
    int j;
    rd(A[i]);
    for(j=(0);j<(A[i]);j++){
      rd(X[i][j]);X[i][j] += (-1);
      rd(Y[i][j]);
    }
  }
  for(mask=(0);mask<(1<<N);mask++){
    cnt = 0;
    for(i=(0);i<(N);i++){
      if(mask & 1<<i){
        int j;
        cnt++;
        for(j=(0);j<(A[i]);j++){
          if( (mask & 1<<X[i][j]) && Y[i][j]==0){
            goto cTE1_r3A;
          }
          if(!(mask & 1<<X[i][j]) && Y[i][j]==1){
            goto cTE1_r3A;
          }
        }
      }
    }
    chmax(res, cnt);
    cTE1_r3A:;
  }
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20200119-1

// --- original code ---
// int N, A[15], X[15][15], Y[15][15];
// {
//   int res = 0, mask, cnt;
//   rd(N);
//   rep(i,N){
//     rd(A[i]);
//     rep(j,A[i]) rd(X[i][j]--, Y[i][j]);
//   }
//   rep(mask,1<<N){
//     cnt = 0;
//     rep(i,N) if(mask & 1<<i){
//       cnt++;
//       rep(j,A[i]){
//         if( (mask & 1<<X[i][j]) && Y[i][j]==0) break_break_continue;
//         if(!(mask & 1<<X[i][j]) && Y[i][j]==1) break_break_continue;
//       }
//     }
//     res >?= cnt;
//   }
//   wt(res);
// }


Measured memory_bytes: 256
import java.util.Scanner;

/**
 *
 * @author lenovo
 */
public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (true) {
            int h = scanner.nextInt();
            int w = scanner.nextInt();
            for (int j = 0; j < h; j++) {
                String s = "";
                for (int i = 0; i < w; i++) {

                    s = s + "#";
                }
                System.out.println(s);
             
            }
            if (h == 0 || w == 0) {
                break;
            }
     System.out.print("\n");
        }
      
    }

}

Measured memory_bytes: 54980
#define _USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cstdio>
#include <complex>
#include <numeric>
#include <string.h>
#include <random>
#include <cmath>
#define rep(i,n) for (int i = 0; i < (int)n; i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<pi, pi> pp;
typedef pair<ll, ll> pl;
double PI = 3.141592653589793238462643383279;
const double EPS = 1e-9;
const ll MOD = 1000000007;
//const ll MOD = 998244353
const int inf = 1 << 30;
const ll linf = 1LL << 60;

ll H, W, T;

ll mygcd(ll x, ll y) {
    while (y) {
        x %= y;
        swap(x,y);
    }
    return x;
}

ll mod_pow (ll x, ll y) {
    ll ret = 1;
    while (y) {
        if (y&1) ret = ret * x % MOD;
        x = x * x % MOD;
        y /= 2;
    }
    return ret;
}

int main() {
    cin >> H >> W >> T;
    ll hg = mygcd(H, T);
    ll wg = mygcd(W, T);
    cerr << hg << " " << wg << endl;
    ll H2 = H/hg;
    ll W2 = W/wg;
    ll G = mygcd(H2, W2);

    ll ans = mod_pow(2, H2) + mod_pow(2, W2) + mod_pow(2, G);
    ans = (ans - 3 + MOD) % MOD;
    ans = mod_pow(ans, hg);
    ans = mod_pow(ans, wg);
    cout << ans << endl;
}

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

tmp = [[e, n - i] for i, e in enumerate(a)]
tmp.sort(reverse=True)

aa = [[e, n - i] for e, i in tmp] + [[0, -1]]

v_prev, i_prev = aa[0]
i = 0
ans = [0] * n
sm = 0
while i < n:
    while aa[i][1] >= i_prev:
        sm += aa[i][0]
        i += 1

    ans[i_prev] += sm - aa[i][0] * i
    sm = aa[i][0] * i
    v_prev, i_prev = aa[i]

print(*ans, sep="\n")


Measured memory_bytes: 40396
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {
	public static void main(String... args) {
		Scanner scan = new Scanner(System.in);
		Integer n = Integer.parseInt(scan.nextLine());
		HashMap<String, Integer> map = new HashMap<>();
		for (int i = 0; i < n; i++) {
			String text = scan.nextLine();
			int count = 1;
			if (map.containsKey(text)) {
				count = map.get(text) + 1;
			}
			map.put(text, count);
		}

		int max = map.values().stream().max(Comparator.comparing(Integer::valueOf)).get();
		List<String> results = map.keySet().stream().filter(key -> map.get(key) == max).collect(Collectors.toList());
		Collections.sort(results);
		for (String result : results) {
			System.out.println(result);
		}

		scan.close();
	}
}

Measured memory_bytes: 178180
#include<iostream>
#include<algorithm>
int w,h,x,y,r;
bool func(int x,int y){
	if(0<=x && x<=w && 0<=y && y<=h){
	return true;
	}else return false;
}
int main(){
	std::cin>>w>>h>>x>>y>>r;
	
	if(func(x,y) && func(x+r,y) && func(x+r,y+r) && func(x,y+r) && func(x-r,y+r) && func(x-r,y) && func(x-r,y-r) && func(x,y-r) && func(x+r,y-r)){
		std::cout<<"Yes"<<std::endl;
	}else std::cout<<"No"<<std::endl;
	return 0;
}

Measured memory_bytes: 1156
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;

public class Main {
	
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastInput in = new FastInput(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		ABC178B solver = new ABC178B();
		solver.solve(1, in, out);
		out.close();
	}

	static class ABC178B {

		public void solve(int testNum, FastInput in, PrintWriter out) {
			
			int a = in.nextInt();
			int b = in.nextInt();
			int c = in.nextInt();
			int d = in.nextInt();
			
			long max1 = (long)Math.max((long)a*c, (long)a*d);
			long max2 = (long)Math.max((long)b*c , (long)b*d);
			
			long ans = (long)Math.max(max1, max2);
			
			out.println(ans);

		}

	}
static class FastInput{
	private final BufferedReader in;
	private String[] buff;
	private int index = 0;
	
	public FastInput(InputStream is) {
		in = new BufferedReader(new InputStreamReader(is));
	}
	String nextLine() {
		try {
			return in.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}
	String next() {
		while (buff == null || index >= buff.length) {
			buff = nextLine().split(" ");
			index = 0;
		}
		return buff[index++];
	}
	int nextInt() {
		return Integer.parseInt(next());
	}
	
	long nextLong() {
		return Long.parseLong(next());
	}
	
	Double nextDouble() {
		return Double.parseDouble(next());
	}
	
	BigInteger nextBigInteger() {
		return new BigInteger(next());
	}
	
	BigDecimal nextBigDecimal() {
		return new BigDecimal(next());
	}
	
	public int[] nextIntArray(final int n) {
		final int[] res = new int [n];
		
		for(int i = 0 ; i < n ;i++) {
			res[i] = nextInt();
		}
		return res;
	}
	
	public long[] nextLongArray(final int n) {
		final long[] res= new long [n];
		
		for(int i = 0 ; i < n ;i++) {
			res[i] = nextLong();
		}
		return res;
	}
	
	public double[] nextDoubleArray(final int n ) {
		final double[] res = new double [n];
		
		for(int i = 0 ; i < n ;i++) {
			res[i] = nextDouble();
		}
		return res;
	}
	
	
	public int[][] nextInt2DArray(final int n , final int m){
		int [][]res = new int [n][m];
		
		for(int i = 0 ; i < n ;i++) {
			for(int j = 0 ; j < m ;j++) {
				res[i][j] = nextInt();
			}
		}
		return res;
	}
	public long[][] nextLong2DArray(final int n , final int m){
		long [][]res = new long [n][m];
		
		for(int i = 0 ; i < n ;i++) {
			for(int j = 0 ; j < m ;j++) {
				res[i][j] = nextLong();
			}
		}
		return res;
	}
	
	public char[][] nextChar2DArray(final int n){
		char [][]res = new char [n][];
		
		for(int i = 0 ; i < n ;i++) {
			String s = next();
			res[i] = s.toCharArray();
		}
		
		return res;
	}
}
}


Measured memory_bytes: 33056
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
using namespace std;
inline int read(){
	int f=1,ans=0;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){ans=ans*10+c-'0';c=getchar();}
	return f*ans;
}
const int MAXN=200001;
map<pair<int,int> ,int> M;
set<int> s[MAXN];
queue<pair<int,int> > que;
void add(int u,int v){
	s[u].insert(v),s[v].insert(u);
	if(u>v) swap(u,v);
	M[make_pair(u,v)]++;
	if(M[make_pair(u,v)]==2) que.push(make_pair(u,v));
	return; 
}
void del(int u,int v){
	s[u].erase(v),s[v].erase(u);
	if(u>v) swap(u,v);
	M.erase(make_pair(u,v));
}
set<int>::iterator it,it1;
int n,f[MAXN];
int find(int x){if(f[x]==x) return x;return f[x]=find(f[x]);}
bool solve(){
	int tot=0;
	for(int i=1;i<=n;i++) f[i]=i;
	while(!que.empty()){
		int u=que.front().first,v=que.front().second;que.pop();
		tot++;
		u=find(u),v=find(v);
		if(s[u].size()<s[v].size()) swap(u,v);
		del(u,v);
		f[v]=u;
		for(it=s[v].begin();it!=s[v].end();){
			it1=it;it++;
			int end=*it1;end=find(end);
			del(v,end),add(u,end);
		}
//		s[v].clear();
	}
	return tot==(n-1);
}
int main(){
// 	freopen("tree.in","r",stdin);
// 	freopen("tree.out","w",stdout);
	n=read();
	for(int i=1;i<n;i++) add(read(),read());
	for(int i=1;i<n;i++) add(read(),read());
	if(solve()){printf("YES\n");return 0;}
	printf("NO\n");return 0;
}


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

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

  // ここにプログラムを追記
  if(c == 'a' || c == 'e' || c == 'i' || c == 'o'|| c == 'u'){
    cout << "vowel"<<endl;
  }else{
    cout <<"consonant"<<endl;
  }
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a.reverse()
b.reverse()
cnt = 0
for i in range(n):
    if b[i] >= a[i]:
        cnt += a[i]
        b[i] -= a[i]
        a[i] = 0
    else:
        cnt += b[i]
        a[i] -= b[i]        
        continue
    if b[i] > 0:
        if b[i] >= a[i + 1]:
            cnt += a[i + 1]
            a[i + 1] = 0
        else:
            cnt += b[i]
            a[i + 1] -= b[i]
print(cnt)


Measured memory_bytes: 18624
import scala.io.StdIn._
object Main extends App {
  readLine
  val hs = readLine.split(" ").map(_.toInt)
  val (maxCnt, curCnt, _) = hs.foldLeft((0, 0, 0)){case ((maxCnt, curCnt, preNum), curNum) =>
    if (curNum <= preNum) (maxCnt, curCnt + 1, curNum)
    else (Math.max(maxCnt, curCnt), 0, curNum)
  }
  println(Math.max(maxCnt, curCnt))
}

Measured memory_bytes: 50380
#include<bits/stdc++.h>
#include<math.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int count=0,count1=0;
    if(s.size()==1)
        cout<<"0"<<endl;
    else
    {
        for(int i=0;i<s.size();i++)
        {
            if((s[i]=='0'&&i%2==0)||(s[i]=='1'&&i%2==1))
            {
                count++;
            }
            else
                count1++;
        }
         cout<<min(count,count1)<<endl;
    }
}


Measured memory_bytes: 3748
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
typedef long long ll;
const ll inf = 1e9;
map<string,ll> mp;
int main(){
    int q; cin >> q;
    multiset<ll> st;
    rep(i,q){
        ll com, x;
        string key;
        cin >> com >> key;
        if(!com){
            cin >> x;
            mp[key] = x;
        }else cout << mp[key] << endl;
    }
    return 0;
}


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

#define rep(i,x,y) for(ll i=(x);i<(y);i++)
#define rrep(i,x,y) for(ll i=(ll)(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
#define itrout(x) for(int i=0;i<x.size();i++) {cout << x[i] << (i==x.size()-1 ? "\n" : " ");}
#ifdef LOCAL
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define debugbit(x, n) cerr << #x << " = " << bitset<n>(x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define itrdebug(x) cerr << #x << " "; for (auto & el : (x)) {cerr << (el) << " ";} cerr << endl
#define dassert(...) assert(__VA_ARGS__)
#else
#define debug(x)
#define debugbit(x, n)
#define itrdebug(x)
#define dassert(...)
#endif
//#define int long long

typedef long long ll;
const ll MOD = 1e9 + 7;
const long double EPS = 1e-8;

void solve(long long D, long long T, long long S){
    if (D <= T * S) cout << "Yes";
    else cout << "No";
    cout << endl;
}

signed main(){
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    long long D;
    scanf("%lld",&D);
    long long T;
    scanf("%lld",&T);
    long long S;
    scanf("%lld",&S);
    solve(D, T, S);
    return 0;
}


Measured memory_bytes: 3644
/* << IN THE NAME OF GOD >> */
#include <bits/stdc++.h>
using namespace std;



#define err(x) cerr << #x  << " = "<<  x << '\n'
#define out(x) cout << x << '\n'
#define forp(i, r, l) for(int i = int(r); i < int(l); i++)
#define forn(i, r, l) for(int i = int(r); i > int(l); i--)
#define FAST ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll ,ll> pll;
const int maxn = 5e5 + 120;
 
ll a ,n ,res ,d ,sum ,b[maxn];

int main(){FAST;    
    cin >> n;
    forp(i ,0 ,n)
        cin >> a ,b[i] = a - i - 1 ,sum += b[i];

    sort(b ,b + n) ,d = (sum) / n;

  /*  if( sum & 1)
        sum < 0 ? d-- : d;
*/
    d = b[(n - 1)/2];
    forp(i ,0 ,n)
        res += abs(b[i] - d);

    out(res);
    return 0;
}
 










Measured memory_bytes: 1792
#include<stdio.h>

int main(void){
  
  int i,A,sum;
  
  for(i=0;i<3;i++){
    scanf("%d",&A);
    sum+=A;
  }
  
  if(sum<=21)
    printf("win\n");
  else
    printf("bust\n");
    
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define pb push_back
using ll = long long;
using vin=vector<int>;
using vvin=vector<vin>;
using vll=vector<ll>;
using vvll=vector<vll>;
using vst=vector<string>;
using P = pair<ll,ll>;
const int inf=1e9+7;
const ll INF=9e18;
template <typename T> bool chmin(T &a, const T& b){if(a > b){a = b;return true;}return false;}
template <typename T> bool chmax(T &a, const T& b){if(a < b){a = b;return true;}return false;}
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
ll n,k;
vll a,f;
bool check(ll x){//全員x以内
  ll cnt=0;
  rep(i,0,n){
   if(a[i]*f[i]>x){
     cnt+=a[i]-x/f[i];
   }
  }
  return cnt<=k;
}

int main(){cout<<fixed<<setprecision(20);
		   //二分探索
           //O(nlog10^12)
           cin>>n>>k;
           a.resize(n);
           f.resize(n);
           rep(i,0,n)cin>>a[i];
           rep(i,0,n)cin>>f[i];
           sort(all(a));
           sort(all(f));
           reverse(all(a));
           ///////////////
           ll ok=1e12,ng=-1;
           while(ok-ng>1){
            ll mid=(ok+ng)/2;
             if(check(mid))ok=mid;
             else ng=mid;
           }
           cout<<ok<<endl;
}

Measured memory_bytes: 6316
#include<stdio.h>

int main(void)
{
    int n, sum=0;
    scanf("%d", &n);
    int a[n], b[n], c[n-1]; 
  
    for(int i=0; i<n; i++) scanf("%d",&a[i]);
  	for(int i=0; i<n; i++) scanf("%d",&b[i]);
	for(int i=0; i<n-1; i++) scanf("%d",&c[i]);

  	for(int i=0; i<n; i++)
  	{
   		sum += b[a[i]-1];
    	if(a[i] == a[i-1] + 1) sum += c[a[i-1]-1];
    }
  
 	printf("%d", sum);
  
  	return 0;
}


Measured memory_bytes: 128
module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";var r=n(1);n(2)(r.readFileSync("/dev/stdin","utf8"))},function(t,e){t.exports=require("fs")},function(t,e,n){"use strict";var r=n(3),i=n(5);t.exports=function(t){var e=new r(t);i(e)}},function(t,e,n){"use strict";var r=n(4);t.exports=class{constructor(t){var e=t.trim().split(/\s+/g);this.inp=new r(e)}inr(){return this.inp.deq()}in(){return parseInt(this.inp.deq(),10)}fin(){this.inp.clear()}}},function(t,e,n){"use strict";t.exports=class{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.size=t.length,this.items=t,this.ind=0}enq(t){this.size+=1,this.items.push(t)}deq(){var t=this.items[this.ind];return this.size-=1,this.ind+=1,t}clear(){this.items=[],this.size=0,this.ind=0}}},function(t,e,n){"use strict";t.exports=function(t){t.in()*t.in()%2==1?console.log("Yes"):console.log("No")}}]);


Measured memory_bytes: 7372
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Numerics;

namespace AtCoderWorkspace
{
    public class Solver
    {
        public void Solve()
        {
            var cin = new Scanner();
            var a = cin.nextInt();
            var b = cin.nextInt();

            Console.WriteLine((a-1)*(b-1));
        }
    }

    class Scanner
    {
        string[] s;
        int i;

        char[] cs = new char[] { ' ' };

        public Scanner()
        {
            s = new string[0];
            i = 0;
        }

        public string next()
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            if (s.Length == 0) return next();
            i = 0;
            return s[i++];
        }

        public int nextInt()
        {
            return int.Parse(next());
        }
        public int[] ArrayInt(int N, int add = 0)
        {
            int[] Array = new int[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt() + add;
            }
            return Array;
        }

        public int[] DPArrayInt(int N, int ex)
        {
            int[] Array = new int[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt();
            }
            return Array;
        }

        public long nextLong()
        {
            return long.Parse(next());
        }

        public long[] ArrayLong(int N, long add = 0)
        {
            long[] Array = new long[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong() + add;
            }
            return Array;
        }

        public long[] DPArrayLong(int N, int ex)
        {
            long[] Array = new long[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong();
            }
            return Array;
        }

        public double nextDouble()
        {
            return double.Parse(next());
        }


        public double[] ArrayDouble(int N, double add = 0)
        {
            double[] Array = new double[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextDouble() + add;
            }
            return Array;
        }
    }

    class Program
    {
        static void Main(string[] s) => new Solver().Solve();
    }
}


Measured memory_bytes: 11092