akhauriyash/Code-Regression huggingface dataset:
"""
B - AcCepted
文字列 S が与えられます。S のそれぞれの文字は英大文字または英小文字です。 S
が次の条件すべてを満たすか判定してください。

S の先頭の文字は大文字の A である。
Sの先頭から 3 文字目と末尾から 2 文字目の間（両端含む）に大文字の C がちょうど 1
個含まれる。
以上の A, C を除く S のすべての文字は小文字である。
"""

s = input()

cnt_C = 0
ans = True
if s[0] != "A":
    ans = False
    #print("s[0] is not A")
else:
    length = len(s)

    n = 1
    for check_char in s[1:]:
        #print(check_char)
        
        if check_char.islower() is False:
            if check_char != "C" or n == 1 or n == (length - 1):
                ans = False
            
            cnt_C += 1
        
        n += 1

if cnt_C != 1:
    ans = False

if ans:
    print("AC")
else:
    print("WA")

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

//Compiler version g++ 6.3.0

/*int main()
{
  long long tt;
  cin >> tt;
  while(tt--){
    
    int ppl,flag = 0;
    int hlp;
    cin >> ppl;
    vector <int> coinA(ppl);
    for(int i = 0; i < ppl; i++ ){
      cin >> hlp;
      coinA[i] = hlp;
    }
    map<int,int> checker;
    
    for (int i = 0; i < ppl; i++){
      
      if(i == 0){
        if(coinA[i] == 5){
          
        
        checker[5]++;
        continue;
        }
        else{
        // cout << "NO\n;";
         flag = 1;
         break;
        }
      }
      int tmp = coinA[i] - 5;
      //if(tmp == 0) continue;
      checker[coinA[i]]++;
      int an = tmp/5;
    
      
      if(checker[tmp] != 0){
        checker[tmp]--;
        
        continue;
      }
      else if(checker[5] >= an){
        checker[5] = checker[5] - an;
        continue;
      }
     
      else{
      //  cout << "NO\n";
      flag = 1;
        break;
      }
      
    }
    if(flag == 0)cout << "YES\n";
    else cout << "NO\n";
    
  }
    
}*/


int main(){
  long long N;
  cin >> N;
  long long tmp;
  long long res,ans = 1e13;
  for (int i = 1; i <= sqrt(N); i++){
    if(N % i == 0){
      tmp = N/i;
      res = (i - 1) +(tmp - 1);
      ans = min(ans,res);
    }
    
  }
  cout << ans;
  
}

Measured memory_bytes: 3628
s = list(input())
p = list(input())
for x in range(len(p)) :
    s.append(s[x])

i = 0
j = 0
while True :
    if p[j] == s[i] :
        j += 1
        if j == len(p) :
            print("Yes")
            break
        i += 1
        if i == len(s) :
            print("No")
            break
    else :
        i += (1 - j)
        if i == len(s) :
            print("No")
            break
        j = 0



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

ll N, K;
vector<ll> A;
ll ret = 0;
ll f0;

void input(){
    ll temp;
    cin >> N >> K;
    for(ll i=0;i<N;i++){
        cin >> temp;
        A.push_back(temp);
    }
}

ll func(ll X){
    ll ans = 0;
    for(ll i=0;i<N;i++){
        ans += X^A[i];
    }
    return ans;
}

void solve(){
    f0 = func(0);
    ll e=1;
    while(e<K){
        e *= 2;
    }
    e *= 2;
    for(;e>0;e=e/2){
        if(ret + e <= K){
            if(func(e)>func(0)){
                ret += e;
            }
        }
    }
    
}

int main(void){
    // Your code here!
    input();
    solve();
    cout << func(ret) << endl;
}


Measured memory_bytes: 1400
#include<stdio.h>

int main()
{
  int n;
  scanf("%d",&n);
  int s=0;
  for (int i=0;i<4;i++)
  {
    if (n%10==2) s++;
    n=n/10;
  }
  printf("%d\n",s);
  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define INF 0x3f3f3f3f 

using namespace std;

int main() 
{
    int n;
    scanf("%d",&n);
    int sum=0;
    int w=INF;
    bool flag=false;
    for(int i=1; i<=n; i++){
        int x;
        scanf("%d",&x);
        sum+=x;
        if(x%10!=0){
            flag=true;
            w=min(w,x);
        }
    }
    if(!flag)
        printf("0\n");
    else{
        if(sum%10!=0)
            printf("%d\n",sum);
        else
            printf("%d\n",sum-w);
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include<algorithm>
#include<string>
#include <map>
#include <queue>
#include <stack>
#include<set>
#include<tuple>

#define DIV 1000000007
using namespace std;
using ll = long long;
using ldb = long double;

int main() {
	ll N; cin >> N;
	vector<pair<ll,ll>> ran(N);
	vector<ll> u(2), v(2,1e10);
	for (int i = 0; i < N; i++) {
		cin >> ran[i].first >> ran[i].second;
		if (u[0] < ran[i].first) {
			swap(u[0], u[1]);
			u[0] = ran[i].first;
		}
		else if (u[1] < ran[i].first)u[1] = ran[i].first;
		if (v[0] > ran[i].second) {
			swap(v[0], v[1]);
			v[0] = ran[i].second;
		}
		else if (v[1] > ran[i].second)v[1] = ran[i].second;

	}

	sort(ran.begin(), ran.end());
	vector<pair<ll, ll>> left(N);
	left[0] = ran[0];
	for (int i = 1; i < N; i++) {
		left[i].first = ran[i].first;
		left[i].second = min(left[i - 1].second, ran[i].second);
	}

	vector<pair<ll, ll>> right(N);
	right[N - 1] = ran[N - 1];
	for (int i = N - 2; i >= 0; i--) {
		right[i].first = right[i + 1].first;
		right[i].second = min(right[i + 1].second, ran[i].second);
	}

	ll ans = 0;
	for (int i = 0; i < N - 1; i++) {
		ll temp = max((ll)0, left[i].second - left[i].first + 1);
		temp += max((ll)0, right[i + 1].second - right[i + 1].first + 1);
		ans = max(ans, temp);
		//cout << "i=" << i << " temp=" << temp << endl;
	}
	if (u[0] < u[1])swap(u[0], u[1]); //cout << "u[0]=" << u[0] << " u[1]=" << u[1] << endl;
	if (v[0] > v[1])swap(v[0], v[1]); //cout << "v[0]=" << v[0] << " v[1]=" << v[1] << endl;
	for (int i = 0; i < N; i++) {
		ll p = (ran[i].first != u[0] ? u[0] : u[1]), q = (ran[i].second != v[0] ? v[0] : v[1]);
		ans = max(ans, max((ll)0, q - p + 1) + ran[i].second - ran[i].first + 1);
		//cout << "i=" << i << " ans=" << ans ;
		//cout << " p=" << p << " q=" << q << endl;
	}
	cout << ans << endl;
}


Measured memory_bytes: 8008
#include <bits/stdc++.h>
using namespace std;
int t[222];
int main() {
    int n;
    cin>>n;
    for(int i = 0; i < 2*n; ++i) {
        cin>>t[i];
    }
    sort(t, t+2*n);
    int ans = 0;
    for(int i = n-1; i >= 0; --i) {
        ans += min(t[2*i], t[2*i+1]);
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
void solve(){
	string s;
	cin>>s;
	if(s[s.size()-1]=='s'){
		s=s+"es";
		cout<<s<<"\n";
	}else{
		s=s+"s";
		cout<<s<<"\n";
	}
}
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	long t=1;
//	cin>>t;
	while(t--)
		solve();
}

Measured memory_bytes: 3652
#include<stdio.h>
#include<cstring>
#include<algorithm> 
#include<iostream> 
#include<vector>
using namespace std;
typedef long long ll;
const int maxn=1e5+5;
int vis[1005];
int main(){
	int n,k;
	cin>>n>>k;
	for(int i=1;i<=k;i++){
		int num;
		cin>>num;
		for(int j=1;j<=num;j++){
			int a;
			cin>>a;
			vis[a]++;
		}
	}
	int cnt=0;
	for(int i=1;i<=n;i++){
		if(!vis[i]) cnt++;
	}
	cout<<cnt<<endl;
	return 0;
}

Measured memory_bytes: 3636
N,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
mx=min(x)
x=list(map(lambda t:t-mx,x))
def gcd(a,b):
    while b:
        a,b=b,a%b
    return(a)
a=10**10
for i,j in zip(x,x[1:]):
    a=min(a,gcd(i,j))
print(a)

Measured memory_bytes: 14252
/**
  * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_10_A&lang=jp
  * Math Functions - Distance
  */
object Main {
  def main(args: Array[String]): Unit = {
    val Array(x1, y1, x2, y2) = io.StdIn.readLine().split(" ").map(_.toDouble)
    val d = math.sqrt(math.pow(x1 - x2, 2) + math.pow(y1 - y2, 2))
    println(d)
  }
}

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

typedef long long ll;

int main()
{
    string S;
    ll Q;
    cin >> S;
    cin >> Q;
    bool Rev = false;
    for (int i = 0; i < Q; ++i)
    {
        int T;
        cin >> T;

        if (T == 1)
        {
            Rev = !Rev;
        }
        else
        {
            int F;
            cin >> F;
            if (F == 1)
            {
                if (Rev)
                {
                    char C;
                    cin >> C;
                    S.insert(S.end(), C);
                }
                else
                {
                    string C;
                    cin >> C;
                    S.insert(0, C);
                }
            }
            else
            {
                if (!Rev)
                {
                    char C;
                    cin >> C;
                    S.insert(S.end(), C);
                }
                else
                {
                    string C;
                    cin >> C;
                    S.insert(0, C);
                }
            }
        }
    }
    if (!Rev)
    {
        cout << S << endl;
    }
    else
    {
        reverse(S.begin(), S.end());
        cout << S << endl;
    }
}



Measured memory_bytes: 900
# coding: utf-8
from collections import defaultdict

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


def read():
    N = II()
    a = ILI()
    return N, a


def solve(N, a):
    count = defaultdict(int)
    for _a in a:
        count[_a - 1] += 1
        count[_a] += 1
        count[_a + 1] += 1
    l_count = list(count.items())
    l_count.sort(key = lambda x: -x[1])
    ans = l_count[0][1]
    return ans


def main():
    params = read()
    print(solve(*params))


if __name__ == "__main__":
    main()


Measured memory_bytes: 24512
using System;
using System.Linq;
class c
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        var a = Array.ConvertAll(Console.ReadLine().Split(), long.Parse);
        decimal d = a.Contains(0) ? 0 : 1;
        decimal check = 1E18M;
        for (int i = 0; i < n; i++)
        {
            if (a[i] != 0) check /= a[i];
        }
        if (check >= 1) for (int i = 0; i < n; i++)
            {
                d *= a[i];
                if (i == n - 1) Console.WriteLine(d);
            }
        else Console.WriteLine(d==0?0:-1);
    }
}


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

int main() {
  ll a, b, c, k;
  cin >> a >> b >> c >> k;
  ll ans;
  if (k % 2 == 0) {
    ans = a - b;
  }
  else {
    ans = b - a;
  }
  if (ans > 1000000000000000000) {
    cout << "Unfair" << endl;
  }
  else {
    cout << ans << endl;
  }
  return 0;
}

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

void dfs(int a, int b);

bool viz[100][100], disp[100][100];

int main()
{
	int a, b;
	cin >> a >> b;
	char c;

	for (int i = 1; i <= a; i++) {
		for (int j = 1; j <= b; j++) {
			cin >> c;
			if (c == '#')
				disp[i][j] = 1;
		}
	}

	dfs(1, 1);

	for (int i = 1; i <= a; i++) {
		for (int j = 1; j <= b; j++) {
			if (disp[i][j] && !viz[i][j]) {
				cout << "Impossible";
				return 0;
			}
		}
	}
	cout << "Possible";
	return 0;
}

void dfs(int a, int b)
{
	viz[a][b] = 1;
	if (disp[a + 1][b])
		dfs(a + 1, b);
	else if (disp[a][b + 1])
		dfs(a, b + 1);
}

Measured memory_bytes: 256
#include <iostream>

int main()
{
    char b;

    scanf("%c",&b);

    switch(b)
    {
    case 'A':
        printf("T\n");
        break;
    case 'C':
        printf("G\n");
        break;
    case 'G':
        printf("C\n");
        break;
    case 'T':
        printf("A\n");
        break;
    }
}

Measured memory_bytes: 256
n, m = (int(i) for i in input().split())
a = [int(i) for i in input().split()]
bc = []
for i in range(m):
  tmp = [int(i) for i in input().split()]
  bc.append(tmp[::-1])

for i in range(n):
  tmp = [a[i]]
  tmp.append(1)
  bc.append(tmp)
  
bc.sort()
bc = bc[::-1]
#print(bc)

ans = 0
i = 0
count = 0
while count < n:
  if bc[i][1] == 0:
    i += 1
  ans += bc[i][0]
  bc[i][1] -= 1
  count += 1
  
print(ans)


Measured memory_bytes: 37740
#include <bits/stdc++.h>
using namespace std;
int main() {
    ios_base::sync_with_stdio(false), cin.tie(nullptr);
    string s;
    cin >> s;
    if (s[s.size() - 1] == 's') {
        cout << s << "es" << "\n";
    } else {
        cout << s << "s" << "\n";
    }
    return 0;
}


Measured memory_bytes: 3648
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<map>
#include<fstream>
#include<string>
#include<sstream>
#include<iomanip>
#include<numeric>
#include<cctype>
using namespace std;

#define Yes(a) a ? "Yes" : "No";
#define YES(a) a ? "YES" : "NO";

void sout(string* a, string* b) {
	if (*a > * b) {
		string c = *a;
		*a = *b;
		*b = c;
	}
}

int combination(int n, int k) {
	if (n > k && k > 0) {
		return (combination(n - 1, k) + combination(n - 1, k - 1));
	}
	else
		return 1;
}

int main() {
	int a, b;
	cin >> a >> b;
	int s = 1, count = 0;
	while (s < b) {
		s--;
		s += a;
		count++;
	}
	cout << count << endl;
}


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


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(0);
#define tie cin.tie(0);
#define x first
#define y second
#define ll long long
#define mod 666013

using namespace std;

int n, m;
char a[305][305];
string s;


int main(){
	cin >> n >> m;
	for (int i = 1; i <= n; i++)
	{
		cin >> s;
		cout << s << "\n" << s << "\n";
	}
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Diagnostics;
using System.Collections.Generic;
using static System.Math;

class P
{
    static void Main()
    {
        string s = Console.ReadLine();
        Console.WriteLine((s.Contains('N') ^ s.Contains('S')) || (s.Contains('W') ^ s.Contains('E')) ? "No" : "Yes");
    }
}

Measured memory_bytes: 13268
sx, sy, tx, ty = map(int, raw_input().split())
sx, sy, tx, ty = 0, 0, tx-sx, ty-sy

ans1 = 'R'*tx + 'U'*ty + 'L'*tx + 'D'*ty

ans2 = 'D' + 'R'*(tx+1) + 'U'*(ty+1) + 'L'

ans3 = 'U' + 'L'*(tx+1) + 'D'*(ty+1) + 'R'

print ans1 + ans2 + ans3


Measured memory_bytes: 2692
a, b, c, x, y = map(int, input().split())
total = a*x+b*y
for i in range(0, max(x,y)*2+2, 2):
  C = c*i
  A = max((x-i//2),0)*a
  B = max((y-i//2),0)*b
  total = min(total, A+B+C)
print(total)
  


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define int long long int
using namespace std;
template<typename T,typename U> using P=pair<T,U>;
template<typename T> using V=vector<T>;
template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}

template<typename T>auto&operator<<(ostream&s,const vector<T>&v){s<<"[";bool a=1;for(auto e:v){s<<(a?"":" ")<<e;a=0;}s<<"]";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const pair<T,U>&p){s<<"("<<p.first<<","<<p.second<<")";return s;}
template<typename T>auto&operator<<(ostream&s,const set<T>&st){s<<"{";bool a=1;for(auto e:st){s<<(a?"":" ")<<e;a=0;}s<<"}";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const map<T,U>&m){s<<"{";bool a=1;for(auto e:m){s<<(a?"":" ")<<e.first<<":"<<e.second;a=0;}s<<"}";return s;}
#define DUMP(x)  cerr<<#x<<" = "<<(x)<<endl;

struct edge { int to, cost; };

const int INF = 1e18;
const int MOD = 1e9+7;

signed main()
{
   int n, W; cin >> n >> W;
   V<int> w(n), v(n);
   for (int i = 0; i < n; i++) {
      cin >> w[i] >> v[i];
   }

   V<int> dp(W+1);
   for (int i = 0; i < n; i++) {
      for (int j = W; j >= 0; j--) {
         if (j + w[i] <= W) {
            chmax(dp[j + w[i]] , dp[j] + v[i]);
         }
      }
   }
   cout << dp[W] << endl;

   return 0;
}


Measured memory_bytes: 1024
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

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

using namespace std;
typedef long long ll;

int main()
{
    // Input
    ll n;
    cin >> n;

    ll ans = 0;
    REP(a, n - 1) {
        ans += (n - 1) / a;
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 3180
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
template<class T> inline bool chmax(T &a, T b) { if (a<b) {a=b; return 1;} return 0;}
template<class T> inline bool chmin(T &a, T b) { if (b<a) {a=b; return 1;} return 0;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    string s;
    cin >> s;
    int n = sz(s);

    string ans;
    rep(i, n) {
        if (s[i] == '?') ans += 'D';
        else ans += s[i];
    }
    cout << ans << endl;
}

Measured memory_bytes: 3808
import sys
input = sys.stdin.readline
x,y,a,b,c=map(int, input().split())
p=list(map(int, input().split()))
q=list(map(int, input().split()))
r=list(map(int, input().split()))
p.sort(reverse=True)
q.sort(reverse=True)
p=p[:x]
q=q[:y]
r=r+p+q
r.sort(reverse=True)
print(sum(r[:x+y]))

Measured memory_bytes: 23472
class UnionFind():
    def __init__(self, n):
        self.par = [-1] * n

    def root(self, x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.root(self.par[x])  # contraction
            return self.par[x]

    def unite(self, x, y):
        x, y = self.root(x), self.root(y)
        if x != y:
            if self.par[x] > self.par[y]:  # merge technique
                x, y = y, x
            self.par[x] += self.par[y]
            self.par[y] = x

    def same(self, x, y):
        return self.root(x) == self.root(y)

    def size(self, x):
        return -self.par[self.root(x)]


n, m = map(int, input().split())
uf = UnionFind(n)
for _ in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    uf.unite(a, b)

ans = max(uf.size(i) for i in range(n))
print(ans)


Measured memory_bytes: 14728
import heapq

N = int(input())
iXY = [[i] + list(map(int, input().split())) for i in range(N)]
G = [set() for _ in range(N)]

iXY.sort(key=lambda a: a[1])
for i in range(1, N):
  i0, x0, y0 = iXY[i - 1]
  i1, x1, y1 = iXY[i]
  G[i0].add((i1))
  G[i1].add((i0))

iXY.sort(key=lambda a: a[2])
for i in range(1, N):
  i0, x0, y0 = iXY[i - 1]
  i1, x1, y1 = iXY[i]
  G[i0].add((i1))
  G[i1].add((i0))

Q = [(0, 0)]
B = set()
a = 0
iXY.sort()

while True:
  d, v = heapq.heappop(Q)
  while v in B:
     d, v = heapq.heappop(Q)
  a += d
  B.add(v)
  if len(B) == N:
    break
  for i in G[v]:
    if i not in B:
      heapq.heappush(Q, (min(abs(iXY[v][1] - iXY[i][1]), abs(iXY[v][2] - iXY[i][2])), i))
print(a)

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

#define int long long
#define ld long double

#define rep(i,a,b) for(int i=a;i<b;i++)
#define repb(i,a,b) for(int i=a;i>b;i--)

#define pb push_back
#define mp make_pair
#define all(A) A.begin(),A.end()
#define allr(A) A.rbegin(),A.rend()
#define precise(i) fixed << setprecision(i)
#define fi first
#define se second

#define err() cout<<"\n==================================\n";
#define errA(A) for(auto i:A) cout<<i<<" "; cout<<"\n";
#define err1(a) cout<<#a<<" "<<a<<"\n";
#define err2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<"\n";
#define err3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<"\n";
#define err4(a,b,c,d) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<" "<<#d<<" "<<d<<"\n";

const int logN = 20;
const int M = 1000000007;
const int INF = 1e12;
#define PI 3.14159265;
const int N = 200005;

#define Pii pair<int,int>
#define Vi vector<int>
#define Vpii vector<Pii>

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

int32_t main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
//    cin>>t;
    while(t--)
    {
           solve();
    }
    return 0;
}

Measured memory_bytes: 3652
#include<iostream>
#include<math.h>
#include<stdio.h>
using namespace std;

int main(){
  int i ,n;
  
  while(cin >> n){
    double hensa=0,sum=0;
    double sum2=0,bunsan=0;
    if (n ==0)break;
    int score[n];
    for ( i = 0 ; i < n ; i++){
      cin >> score[i];
      sum += score[i];
    }
    double ave = sum / n;
    for ( i = 0 ; i < n ; i++){
      bunsan = pow(score[i]-ave,2);
      sum2 += bunsan;
      bunsan = 0;
    }
    sum2 = sum2/n;
    hensa = sqrt(sum2);
    printf("%.8f\n",hensa);
  }
  return 0;
}

Measured memory_bytes: 1196
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
const ll INF = 1LL<<60;
const ll MOD = 1e9+7;


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,a,b;cin>>n>>a>>b;
    vector<ll> h(n);rep(i,n)cin>>h[i];
    ll l=0, r=1000000001;
    while(l+1<r){
        ll c = (l+r)/2;
        ll sum = 0;
        for(ll hp: h){
            sum+=max(0LL, (hp-c*b+a-b-1)/(a-b));
        }
        if(c>=sum)r=c;
        else l=c;
    }
    cout<<r<<endl;
    return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<climits>
#include<set>
#include<utility>
#include<typeinfo>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef set<int> S;
#define rep(i, n) for(int i=0; i<n; i++)
const ll MOD=1e9+7;

int main(){

	string S;
	cin >> S;
	int ans = 0;
	for(int i = 0; i < S.length(); i++){
		if(i % 2 == 0){
			if(S[i] != '0'){
				ans++;
			}
		} else {
			if(S[i] != '1'){
				ans++;
			}
		}
	}
	int tmp = ans;
	ans = 0;
	for(int i = 0; i < S.length(); i++){
		if(i % 2 == 0){
			if(S[i] != '1'){
				ans++;
			}
		} else {
			if(S[i] != '0'){
				ans++;
			}
		}
	}
	cout << min(ans, tmp) << endl;

	return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define GET_REP(_1, _2, _3, NAME, ...) NAME
#define rep(...) GET_REP(__VA_ARGS__, irep, _rep)(__VA_ARGS__)
#define rep1(...) GET_REP(__VA_ARGS__, irep1, _rep1)(__VA_ARGS__)
#define _rep(i, n) irep (i, 0, n)
#define _rep1(i, n) irep1(i, 1, n)
#define irep(i, a, n) for (int i = a; i < (int)(n); ++i)
#define irep1(i, a, n) for (int i = a; i <= (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define rrep1(i, n) for (int i = (int)(n); i >= 1; --i)
#define allrep(X, x) for (auto &&X : x)
#define all(x) begin(x), end(x)
#ifdef LOCAL
  #include "../../Lib/cout_container.hpp"
  #define debug(x) cout << #x " => " << (x) << endl
#else
  #define debug(x) 0
#endif
using lint = long long;
constexpr int    INF  = 1 << 28;
constexpr lint   INFL = 1LL << 60;
constexpr int    MOD  = (int)1e9 + 7;
constexpr double EPS  = 1e-9;
using namespace std;
namespace { struct INIT { INIT() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } INIT; }

int main(void) {
  string s;
  cin >> s;
  int mini = INT_MAX;
  rep (i, s.length() - 2) mini = min(mini, abs(753 - stoi(s.substr(i, 3))));
  cout << mini << endl;
  return 0;
}

Measured memory_bytes: 256
#pragma region
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <list>
#include <iomanip>
#include <cstdint>
#include <bitset>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()

#pragma region UnionFind
struct UnionFind
{
	vector<int> par;

	UnionFind(int n) : par(n, -1) {}
	void init(int n) { par.assign(n, -1); }

	int root(int x)
	{
		if (par[x] < 0) return x;
		else return par[x] = root(par[x]);
	}

	bool issame(int x, int y)
	{
		return root(x) == root(y);
	}

	bool merge(int x, int y)
	{
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y);
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	int size(int x)
	{
		return -par[root(x)];
	}
};
#pragma endregion
#pragma region GCD
int gcd(int a, int b)
{
	if (a%b == 0)return b;
	return gcd(b, a%b);
}
#pragma endregion
#pragma region chmin
template<class T> inline bool chmin(T& a, T b)
{
	if (a > b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma region chmax
template<class T> inline bool chmax(T& a, T b)
{
	if (a < b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma endregion


int main()
{
	int n, m; cin >> n >> m;
	vector<vector<int>> v(n);
	rep(i, m)
	{
		int a, b; cin >> a >> b;
		--a, --b;
		v[a].push_back(b);
		v[b].push_back(a);
	}
	vector<int> res(n, -1);
	res[0] = 0;
	queue<int> q;
	q.push(0);
	while (!q.empty())
	{
		int now = q.front();
		q.pop();
		for (int next : v[now])
		{
			if (res[next] == -1)
			{
				q.push(next);
				res[next] = now + 1;
			}
		}
	}
	cout << "Yes" << endl;
	for (int i = 1; i < n; ++i)cout << res[i] << endl;
}

Measured memory_bytes: 10184
#include<bits/stdc++.h>
using namespace std;
#define ll long long
struct Interval
{
    ll f,s;

};
ll n;
//Interval ans[n+1];
bool sorti(Interval a,Interval b)
{
       if(a.s<b.s)
    return 1;
   else
    return 0;
}
void merger(Interval arr[],ll n)
{
    ll index=0,i;
    sort(arr,arr+n,sorti);
    for(i=1;i<n;i++)
    {
        if(arr[index].s>=arr[i].f)
        {
            arr[index].f=min(arr[i].f,arr[index].f);
            arr[index].s=max(arr[i].s,arr[index].s);
        }
        else
        {
            arr[index]=arr[i];
            index++;
        }
    }
    for(i=0;i<=index;i++)
        cout<<arr[i].f<<" "<<arr[i].s<<endl;
  /*  for(i=0;i<=index;i++)
    {
        ans.f=arr[i].f;
        ans.s=arr[i].s;
    }*/

}
int main()
{
       ll n,k;
       cin>>n>>k;
       ll a[n+1],i;
       for(i=0;i<n;i++)
        cin>>a[i];
       sort(a,a+n);
       ll sum=0;
       for(i=0;i<k;i++)
        sum+=a[i];
       cout<<sum<<endl;
}


Measured memory_bytes: 3640
def main():
    K = int(input())
    List = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
    print(List[K-1])

if __name__ == '__main__':
    main()


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

int main() {
  int n, m;
  cin >> n >> m;
  int t[60];
  rep(i,60) t[i] = 0;
  rep(i,m) {
    int a, b;
    cin >> a >> b;
    t[a - 1]++;
    t[b - 1]++;
  }
  rep(i,n) cout << t[i] << endl;
}

Measured memory_bytes: 256
N, M = map(int, input().split(" "))

a = list(set(map(int, input().split(" "))))
g = a.copy()

while not any(x%2 for x in g): g = [i //2 for i in g]

if not all(x%2 for x in g): print(0); exit(0)

def gcd(a, b):

    while b:

        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd(a, b)


tot = 1

for x in a: tot = lcm(tot, x//2)
print((M//tot+1)//2)

Measured memory_bytes: 11356
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vl=vector<ll>;
ll N,K;
bool isOK(ll trial, vl &A, vl &F) {
    ll k=0;
    for (int i = 0; i < N; i++){
        k+=max(A[i]-trial/F[i],(ll)0);
        if(k>K)return false;
    }
    return true;
}

int main() {
    cin>>N>>K;
    vl A(N),F(N);
    for (int i = 0; i < N; i++){
        cin>>A[i];
    }
    for (int i = 0; i < N; i++){
        cin>>F[i];
    }
    sort(A.begin(),A.end());
    sort(F.begin(),F.end(),greater<ll>());
    ll ok = F[0]*A[N-1];
    ll ng = -1; 
    while (abs(ok - ng) > 1) {
        ll mid = (ok + ng) / 2;

        if (isOK(mid,A,F)) ok = mid;
        else ng = mid;
    }
    cout<<ok<<endl;
}

Measured memory_bytes: 6488
#include <iostream>
#include <stdio.h>
using namespace std;

int BiSearch(int input, int n, int *S) {
    int left = 0;
    int right = n;
    int mid;
    while (left < right) {
        mid = (left + right) / 2;
        if (S[mid] == input) {
            return 1;
        }
        if (input < S[mid]) {
            right = mid;
        } else if (input > S[mid]) {
            left = mid + 1;
        }
    }
    return 0;
}



int main()
{
    /*
    int n = 15;
    int q = 10;
    int S[n] = {0, 0, 1, 1, 2, 2, 3, 3, 3, 5, 6, 6, 8, 9, 9};
    int T[q] = {8, 4, 6 ,5, 0, 2, 1, 7, 9, 3};
    */
    int q, n;
    int S[1000000];
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &S[i]);
    }
    scanf("%d", &q);
    int T[q];
    for (int i = 0; i < q; i++) {
        scanf("%d", &T[i]);
    }

    int out = 0;
    for (int i = 0; i < q; i++) {
        if (BiSearch(T[i], n, S)) {
            out++;
        }
    }
    cout << out << endl;
    return 0;
}



Measured memory_bytes: 3728
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{VecDeque, HashMap, BTreeMap, HashSet, BTreeSet};
#[allow(unused_imports)]
use std::io::{stdout, Write, BufWriter};
#[allow(unused_imports)]
use proconio::marker::{Isize1, Usize1, Bytes, Chars};
#[proconio::fastout]
fn main() {
    proconio::input!{
        n: usize,
        mut k: u64,
        jump_from: [Usize1; n],
    }
    let mut hist = vec![];
    let mut dist = vec![-1; n];
    let mut pos = 0usize;
    let mut loop_len = 1;
    for i in 0i64.. {
        if dist[pos] == -1 {
            dist[pos] = i;
            hist.push(pos);
            pos = jump_from[pos];
        } else {
            loop_len = (i - dist[pos]) as u64;
            break;
        }
    };
    let l = dist[pos] as u64;
    if k > l { k = l + (k - l) % loop_len; }
    println!("{}", hist[k as usize] + 1);
}


Measured memory_bytes: 7816
n=int(input())
l=list(map(int,input().split()))
a1=a2=0
for x in l:
  if x%4==0:
    a1+=1
  elif x%2==0:
    a2+=1
if a1>0:
  a1-=1
  n-=3
  if a2>0:
    a2-=1
if a1*2+a2<n:
  print('No')
else:
  print('Yes')

Measured memory_bytes: 15020
#include <bits/stdc++.h>
using namespace std;
#define SELECTER(_1, _2, _3, SELECT, ...) SELECT
#define REP1(i, n) for(int (i)=0; (i)<(n); (i)++)
#define REP2(i, a, b) for(int (i)=(a); (i)<(b); (i)++)
#define REP(...) SELECTER(__VA_ARGS__, REP2, REP1,) (__VA_ARGS__)
#define MOD 1000000007

template <class T> ostream& operator<<(ostream& os, const vector<T>& v){ os << "{"; for(size_t i=0; i<v.size(); i++) os << v[i] << (i+1==v.size() ? "" : ", "); os << "}"; return os; }
template <class T, class U> ostream& operator<<(ostream& os, const pair<T, U>& p){ return os << "{" << p.first << ", " << p.second << "}"; }

class Comb{
    // テーブルを作るのに O(NlogN)
    // 計算は O(1)
    int N;
    vector<long long> fact_num, fact_den;
    long long bipow(long long n, long long m) {
        if (m == 0) return 1;
        if (m % 2 == 0) {
            n = (n * n) % MOD;
            return bipow(n, m / 2) % MOD;
        } else
            return (n * bipow(n, m - 1)) % MOD;
    }
    void set_table(){
        fact_num.resize(N+1, 0);
        fact_den.resize(N+1, 0);
        vector<long long> fact_denpow(N+1, 0);

        fact_num[0] = 1;
        for(int i=1; i<=N; i++) fact_num[i] = (fact_num[i-1] * i) % MOD;
        for(int i=0; i<=N; i++) fact_denpow[i] = bipow(i, MOD-2);
        fact_den[0] = 1;
        for(int i=1; i<=N; i++) fact_den[i] = (fact_den[i-1] * fact_denpow[i]) % MOD;
    }
public:
    Comb(int N): N(N) { set_table(); }
    // nCk
    long long calc(long long n, long long k){
        if(k > n) return 0;
        return ((fact_num[n] * fact_den[k]) % MOD * fact_den[n-k]) % MOD;
    }
};


int main(){
    long long n, k;
    cin >> n >> k;
    long long ans = 0;
    Comb comb(n);
    for(int i=0; i<=min(n-1, k); i++){
        ans += (comb.calc(n, i) * comb.calc(n-1, i)) % MOD;
        ans %= MOD;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 4992
import java.util.*;

public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    long[] vehicles = new long[5];
    long n = 0L;
    
    long N = sc.nextLong();
    for (int i = 0; i < vehicles.length; i++) {
      vehicles[i] = sc.nextLong();
      n = Math.max(n, maxtime(N, vehicles[i]));
    }
    System.out.println(n + 4);
  }
  
  //最も使われる乗り物の乗車回数を求める
  public static long maxtime(long x, long y) {
    if ((x % y) == 0) {
      return x / y;
    } else {
      return x / y + 1;
    }
  }
}

Measured memory_bytes: 23764
#import sys
#import numpy as np
import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
#import bisect
import collections

n=int(input())
if n==1:
  print(1)
  exit()
a=list(map(int,input().split()))
a.sort()
c = collections.Counter(a)

m=max(a)
ans=0
d=[0]*m
for i in a:
    if d[i-1]==1:
        continue
    for j in range(2,m+1):
        if i*j>m:
            break
        d[i*j-1]=1
    if c[i]==1:
      ans+=1
print(ans)


Measured memory_bytes: 133140
N  = int(input())
L = list(map(int, input().split()))

count = 0

if N <=2:
  print(0)
else:
  for i in range(N-2):
    for j in range(i, N-1):
      if L[i] != L[j]:
        for k in range(j,N):
          if L[i] != L[k]:
            if L[j] != L[k]:

              if L[i] < L[j]:
                if L[j]<L[k]:
                  if L[i] + L[j] > L[k]:
                    count = count + 1
                else:
                  if L[i] + L[k] > L[j]:
                    count = count + 1
              else:
                if L[i]<L[k]:
                  if L[i] + L[j] > L[k]:
                    count = count + 1
                else:
                  if L[j] + L[k] > L[i]:
                    count = count + 1
  print(count)

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

vector<int> to[100005];
const int INF =1001001001;

int main(){
    ll n,m; cin >> n >> m;
    rep(i,m){
        int a,b; cin >> a >> b;
        a--; b--;
        to[a].push_back(b);
        to[b].push_back(a);
    }

    queue<int> q;
    vector<int> dist(n,INF);
    vector<int> pre(n,-1);
    dist[0]=0;
    q.push(0);
    while(!q.empty()){
        int v = q.front(); q.pop();
        for(int u: to[v]){
            if(dist[u] != INF) continue;
            dist[u]=dist[v]+1;
            pre[u]=v;
            q.push(u);
        }
    }

    cout << "Yes" << endl;

    rep(i,n){
        if(i==0) continue;
        int ans=pre[i];
        ++ans;
        cout << ans << endl;
    }
}

Measured memory_bytes: 10500
#include <bits/stdc++.h>
using namespace std;
int n;
long long Sum, A[500005], Res, Ans;
int main()
{
    //freopen("Test.INP","r",stdin);
    //freopen("Test.OUT","w",stdout);
    cin >> n;
    Ans = LONG_MAX;
    for (int i = 1; i <= n; i++)
    {
        cin >> A[i];
        Sum += A[i];
    }
    for (int i = 1; i <= n; i++)
    {
        Res += A[i];
        Ans = min(Ans, abs(Sum - Res*2));
    }
    cout << Ans;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
map<ll, ll> m;
ll a[200000];
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    ll N; cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> a[i];
        m[a[i]]++;
    }
    ll ans = 0;
    for (auto p : m) {
        ll b = p.second;
        ans += 1ll*b*(b-1)/2ll;
    }
    for (int i = 0; i < N; i++) {
        ll k = m[a[i]];
        cout << (ans - (1ll*k*(k-1)/2ll) + (1ll*(k-1)*(k-2)/2ll)) << '\n';
    }
}

Measured memory_bytes: 11136
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define INF 100000000

int main(){
    int N;
    string S;
    cin >> N >> S;
    int ecount = 0;
    for (int i = 0; i < N; i++)
    {
        if (S[i] == 'E')
        {
            ecount++;
        }
        
    }
    
    int people = 0;
    int e_people = 0;
    int w_people = 0;
    for (int i = 0; i < N; i++)
    {
        int now = 0;
        if (S[i] == 'E')
        {
            w_people = N - ecount - (i - e_people);
        } else
        {
            w_people = N - ecount - (i + 1 - e_people);
        }
        now = e_people + w_people;
        people = max(now, people);
        if (S[i] == 'E')
        {
            e_people++;
        }
        
        
    }

    cout << N - people - 1 << endl;
    return 0;
}

Measured memory_bytes: 900
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

r, g, b = map(int, input().split())
K = int(input())

while K > 0 and r >= g:
    g *= 2
    K -= 1
while K > 0 and g >= b:
    b *= 2
    K -= 1

if g > r and b > g:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 9428
#include<algorithm>//sort(all(変数),greater<型名>())　で降順に
#include<bits/stdc++.h>
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#include<queue>//priority_queue<型名> 変数：優先度付きキュー　最大値の探索が早い
#include<set>
#include<stack>
#include<string>
#include<vector>
#define rep0(i,n)  for(ll i=0; i<n; i++)
#define rrep0(i,n) for(ll i=n-1; 0<=i; i--)
#define rep1(i,n)  for(ll i=1; i<=n; i++)
#define rrep1(i,n) for(ll i=n; 1<=i; i--)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define INF 1e18
using ll = long long;
using namespace std;
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; }

int main(){
  int n;  cin >> n;
  string s;  cin>> s;
  string alf = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  rep0(i,s.size()){
    cout << alf[(s[i]-'A'+n)%26];
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define f(i,n) for(int i=0;i<n;i++)
#define P pair<int,int>
#define F first
#define S second
#define mod 1000000007
#define Mod 998244353
#define all(v) v.begin(), v.end()
#define INF LLONG_MAX/3
#define pi 3.14159265359
typedef long long ll;
using namespace std;
int main() {
	ll a;
	long double b;
	cin >> a >> b;
	cout << (ll)(a*b) << endl;
	return 0;
}


Measured memory_bytes: 3736
#include <bits/stdc++.h>
 
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n) for(int i=1;i<=(n);i++)
#define lol long long
#define SUM(n) ((n)+1)*(n)/2 //1〜nまでの総和を求める式
#define mp make_pair
#define fi first
#define se second
#define pu push_back
#define SYOU(x) fixed<<setprecision(x+1) //小数点桁数を指定する
#define abs(x,y) max(x,y)-min(x,y)
#define all(v) v.begin(),v.end()
#define UPDight(a,b) (a+b-1)/b //小数点切り上げ 
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const int MOD=int(1e9)+7; 
using namespace std;
using pii = pair<int, int>;
typedef vector<int> vit;

//最大公約数
lol gcd(lol x, lol y){
  if(x < y) swap(x, y);
  lol r = x % y;
  while(r != 0){
    x = y;
    y = r;
    r = x % y;
  }
  return y;
}

//最小公倍数
lol lcm(lol x, lol y){
  lol a = x * y;
  return (a / gcd(x, y));
}

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

  int a, b, k;
  cin >> k >> a >> b;
  for(int i = a;i <= b;i ++){
    if(i % k == 0){
      cout << "OK\n";
      return 0;
    }
  }
  cout << "NG\n";
  
  return 0;
}


Measured memory_bytes: 3608
import math

def a():
    a,b = map(int,input().split())
    print(a * b)


def b():
    n = int(input())
    a = list(map(int, input().split()))
    max = pow(10,18)

    if 0 in a:
        print(0)
    else:
        mul = 1
        for i in a:
            mul *= i
            if mul > max:
                print(-1)
                break
        else:
            print(mul)



def c():
    print('')



def d():
    print('')


b()

Measured memory_bytes: 22640
# Aizu Problem 0229: Big Hit

import sys, math, os, bisect

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


while True:
    b, r, g, c, s, t = [int(_) for _ in input().split()]
    if t == 0:
        break
    print(100 + 95 * b + 63 * r + 7 * g + 2 * c - 3 * (t - s))

Measured memory_bytes: 7848
#include <iostream>

using namespace std;

int main(){
	int house[5][4][11]={0};
	int n, b, f, r, v;
	
	cin >> n;
	
	for(int i = 1; i <= n; i++){
		cin >> b >> f >> r >> v;
		house[b][f][r] += v;
	}
	
	for(int i = 1; i < 5; i++){
		for(int j = 1; j < 4; j++){
			for(int k = 1; k <11; k++){
				cout <<  " " << house[i][j][k];
			}
			cout << endl;
		}
		for(int w = 1; w <= 20; w++){
			if(i != 4){
				cout << "#";
				if(w == 20) cout << endl;
			}
		}
	}
	
	return 0;
}

Measured memory_bytes: 3108
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
#define INF 1e18
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<"\n";}
typedef long long ll;

int d[110][110];
int h[110][110];
bool g[110][110];
int n, m;

vector<int> restore_path(int start, int end)
{
    vector<int> p;
    int curr = start;
    while (curr != end)
    {
        // nは頂点数
        for (int i = 0; i < n; i++)
        {
            // (curr)---h[curr][i]---(i)---g[i][end]---(end)
            // と
            // (curr)-----------g[curr][end]-----------(end)
            // が一致すれば、iは最短経路に含まれる頂点である
            if (i != curr && h[curr][i] + d[i][end] == d[curr][end])
            {
                curr = i;
                p.push_back(i);
                break;
            }
        }
    }
    return p;
}

signed main()
{
    cin>>n>>m;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            d[i][j]=INF;
            if(i==j) d[i][j]=0;
        }
    }
    vector<int>A(m),B(m),C(m);
    for (int i = 0; i < m; i++)
    {
        int a,b,c;
        cin>>a>>b>>c;
        a--,b--;
        A[i]=a;
        B[i]=b;
        C[i]=c;
        d[a][b]=c;
        d[b][a]=c;
    }

    REP(i,n) REP(j,n) h[i][j]=d[i][j];

    for (int k = 0; k < n; k++)
    {
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < n; j++)
            {
                d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
            }
            
        }
        
    }
    int cnt=0;
    for (int i = 0; i < m; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if(h[A[i]][B[i]]+h[B[i]][j]==d[A[i]][j]){
                cnt++;
                break;
            }
        }
        
    }
    cout<<m-cnt<<endl;
   
        
    return 0;
}

Measured memory_bytes: 512
import sys
N = int(sys.stdin.readline().rstrip())
l = list(map(int, sys.stdin.readline().rstrip().split()))
 
lm = 0
L = 0
for n in range(N):
  if l[n] > lm:
    L += lm
    lm = l[n]
  else:
    L += l[n]
    
if lm < L:
  print('Yes')
else:
  print('No')

Measured memory_bytes: 3060
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main() {
    long long n, k;
    cin >> n >> k;

    vector<long long> v(0);
    for (long long i = 1; i * i <= n; i++) {
        v.push_back(i);
        if (i < n / i) {
            v.push_back(n / i);
        }
    }

    sort(v.begin(), v.end());
    int v_size = v.size();

    long long mod = 1000000007;
    vector<vector<long long>> dp(k, vector<long long>(v_size, 0));
    for (int i = 0; i < v_size; i++) {
        dp[0][i] = v[i];
    }
    for (int i = 1; i < k; i++) {
        dp[i][0] = dp[i - 1][v_size - 1];
        for (int j = 1; j < v_size; j++) {
            dp[i][j] = (v[j] - v[j - 1]) * dp[i - 1][v_size - j - 1] % mod;
        }
        for (int j = 1; j < v_size; j++) {
            dp[i][j] = (dp[i][j] + dp[i][j - 1]) % mod;
        }
    }

    cout << dp[k - 1][v_size - 1] << endl;
}


Measured memory_bytes: 53812
#include "bits/stdc++.h"

using namespace std;

typedef pair<int, int> P;
#define int long long
#define ll long long
#define mod 1000000007
#define INF (1LL<<60)

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


signed main(){

	string s;
	cin >> s;
	int a[3] = {0,0,0};
	for (int i = 0; i < s.length(); i++)
		a[s[i] - 'a']++;
	sort(a, a + 3);

	if (a[2] - a[0] <= 1)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;


	return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main()
{
  int a,b;
   cin>>a>>b;
   if(a>=13)
   cout<<b<<endl;
   else if(a>=6 && a<=12){cout<<b/2<<endl;}
   else{cout<<0<<endl;}
}

Measured memory_bytes: 3652
#include <cstdio>
#include <cstdint>
#include <algorithm>
#include <vector>

int main() {
  size_t N, K;
  scanf("%zu %zu", &N, &K);

  std::vector<intmax_t> a(N);
  for (size_t i=0; i<N; ++i)
    scanf("%jd", &a[i]);

  std::vector<intmax_t> aa(N+1), as(N+1);
  for (size_t i=1; i<=N; ++i) {
    aa[i] = aa[i-1] + a[i-1];
    as[i] = as[i-1] + std::max<intmax_t>(0, a[i-1]);
  }

  intmax_t res=0;
  for (size_t i=0; i+K<N+1; ++i) {
    res = std::max(res,
                   as[i]+std::max<intmax_t>(0, aa[i+K]-aa[i])+(as[N]-as[i+K]));
  }

  printf("%jd\n", res);
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define INF 1e18
#define MOD 1000000007
#define PI M_PI
#define ll long long
#define vi vector<int>
#define all(v) v.begin(), v.end()
#define FOR(i, a, b) for (int i=a; i<b; i++)
#define REP(i, n) for (int i=0; i<n; i++)
#define REPD(i, n) for (int i=n-1; i>=0; i--)
#define print(x) cout << x << endl;
#define debug(x) cout << #x << " = " << endl;

using namespace std;

void solve()
{
    int X;
    cin >> X;
    int a = X / 100;
    int m = X % 100;
    int maxValue = a * 5;
    if (m <= maxValue) {
        print(1);
    } else {
        print(0);
    }
}

int main()
{
    solve();

    return 0;
}


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



int main() {
	int n;
	cin >> n;
	if ((n % 10) == (n % 100)/10 && (n % 100)/10 ==( n % 1000)/100) {
		cout << "Yes" << endl;
		return 0;
	}
	n /= 10;
	if ((n % 10) == (n % 100)/10 && (n % 100)/10 == (n % 1000)/100) {
		cout << "Yes" << endl;
		return 0;
	}
		
	cout << "No" << endl;


	return 0;
}


Measured memory_bytes: 256