akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<bitset>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<functional>
#include<list>
#include<map>
#include<iomanip>
#include<iostream>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<vector>
#include<algorithm>
#include<memory.h>
using namespace std;
int n,a[100005]={0},sum=0,num=0;
int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		if(a[i]%4==0)sum++;
		else if(a[i]%2==0)num++; 
	}
	n/=2;
	num/=2;
	sum+=num;
	if(sum>=n)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}


Measured memory_bytes: 640
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		int P      = scanner.nextInt();
		int Q      = scanner.nextInt();
		int R      = scanner.nextInt();
		int sumA   = P + Q;
		int sumB   = Q + R;
		int sumC   = P + R;
		int answer = 0;
		
		if(sumA < sumB) {
			
			answer = sumA;
		}else {
			
			answer = sumB;
		}
		
		if(sumC < answer) {
			
			answer = sumC;
		}
		System.out.println(answer);
	}

}


Measured memory_bytes: 21716
import math


def main():
    n = int(input())
    a = 1
    b = n
    
    ans = n - 1 
    
    for i in range(2, int(math.sqrt(n)) + 1):
        if n % i == 0:
            a = int(i)
            b = int(n / i)
            ans = min(ans, a+b-2)
    print(ans)
        
        
if __name__ == "__main__":
    main()


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

typedef long long ll;
typedef long double ld;
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353

int main() {
    int x, y; cin >> x >> y;
    set<int> a, b, c;
    a.insert(1); a.insert(3); a.insert(5); a.insert(7);
    a.insert(8); a.insert(10); a.insert(12);
    b.insert(4); b.insert(6); b.insert(9); b.insert(11);
    c.insert(2);
    if((a.count(x) && a.count(y)) || (b.count(x) && b.count(y)) || (c.count(x) && c.count(y))) cout << "Yes" << endl;
    else cout << "No" << endl; 
    return 0;
}

Measured memory_bytes: 3616
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define FILL(Itr,n) fill((Itr).begin(),(Itr).end(),n)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;
#define MOD 1000000007

ll ans[100010];

template <class T1, class T2> struct DownUpPair {
    T1 first; T2 second;
    DownUpPair(T1 first, T2 second) : first(first), second(second) {}
    DownUpPair() {}
    bool operator < (const DownUpPair &a) const {
        return (first==a.first) ? (second<a.second) : (first>a.first);
    }
};

int main(){
    
    int N; cin>>N;
    vector<ll> a(N);
    REP(i,N)cin>>a[i];
    
    vector< DownUpPair<ll,ll> > arr(N);
    REP(i,N){
        arr[i].first = a[i];
        arr[i].second = i;
    }
    
    sort(arr.begin(),arr.end());
    
    ll idx = 1e9;
    for(int i=0;i<N-1;i++){
        idx = min(idx,arr[i].second);
        ans[idx] += (i+1) * abs(arr[i+1].first-arr[i].first);
    }
    
    idx = min(idx,arr[arr.size()-1].second);
    ans[idx] += N * arr[arr.size()-1].first;
    
    REP(i,N)cout<<ans[i]<<endl;
    
    return 0;
}

Measured memory_bytes: 4224
#include<bits/stdc++.h>
using namespace std;
#define IOS std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define debug(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define IN freopen("in.txt", "r", stdin);
#define endl '\n'
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
typedef long long ll;
typedef vector<int> VI;
typedef pair<int, int> pii;
const int inf = 0x3f3f3f3f;

const int N = 510;

int H[N][N];
int occ[N][N];
int dx[]={0,-1,1,0},dy[]={-1,0,0,1};

void dfs(int x,int y){
    int need=H[x][y]+occ[x][y];
    for(int i=0;i<4;i++){
        int xx=dx[i]+x,yy=dy[i]+y;
        if(H[xx][yy]>need){
            H[xx][yy]=need;
            dfs(xx,yy);
        }
    }
}
int main(){
    IOS;
    int n;cin>>n;
    for(int i=1;i<=n;i++)for(int j=1;j<=n;j++){
        H[i][j]=min(min(i,n-i+1),min(j,n-j+1))-1;
        occ[i][j]=1;
    }
    int res=0;
    for(int i=1,id,x,y;i<=n*n;i++){
        cin>>id;
        x=id/n;
        if(id%n)x++;
        y=id%n;
        if(!y)y=n;
        occ[x][y]=0;
        res+=H[x][y];
        dfs(x,y);
    }
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 21056
#include <bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	cin >> s;
	if (s == "Sunny")
		cout << "Cloudy";
	else if (s == "Rainy")
		cout << "Sunny";
	else
		cout << "Rainy";
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N,M,ans = 0,q;
  vector<string> v;
  cin >> N;
  string s[N];
  for(int i = 0;i < N;i++){
    cin >> s[i];
    bool flag = 1;
    for(int j = 0;j < v.size();j++)if(s[i] == v[j])flag = 0;
    if(flag)v.push_back(s[i]);
  }
  cin >> M;
  string t[M];
  for(int i = 0;i < M;i++){
    cin >> t[i];
    bool flag = 1;
    for(int j = 0;j < v.size();j++)if(t[i] == v[j])flag = 0;
    if(flag)v.push_back(t[i]);
  }
  for(int i = 0;i < v.size();i++){
    q = 0;
    for(int j = 0;j < N;j++)if(v[i] == s[j])q++;
    for(int j = 0;j < M;j++)if(v[i] == t[j])q--;
    ans = max(ans,q);
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <cmath>
#include <map>
#include <iomanip>

using namespace std;
using ll = long long;

int main() {
	ll N;
	cin >> N;
	vector<ll> a(N);
	ll cntodd = 0;
	ll cnt4 = 0;
	for (ll i = 0; i < N; i++)
	{
		cin >> a[i];
		if (a[i] % 4 == 0) {
			cnt4++;
		}
		if (a[i] % 2 == 1) {
			cntodd++;
		}
	}
	if (cnt4 >= cntodd || (cnt4 - cntodd == -1 && cnt4 + cntodd == N)) {
		cout << "Yes" << endl;
	}
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <numeric>
#include <utility>
#include <iomanip>

using namespace std;
using int64 = long long;

struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa;

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i=0; i<n; i++) cin >> a[i];

    sort(a.begin(), a.end());
    int maxn = a.back();
    a.pop_back();

    int ans_n = INT_MAX;
    int ans = maxn;
    for (auto i : a) {
        if (ans_n >= abs(i-maxn/2)) {
            ans_n = abs(i-maxn/2);
            ans = i;
        }
    }

    cout << maxn << " " << ans << endl;
}


Measured memory_bytes: 3228
H , W = map(int,input().split())

s = [0] * H

for i in range(H) :
    s[i] = list(input())

# 端をゼロパディング
L = [[0 for _ in range(W+2)] for _ in range(H+2)]
R = [[0 for _ in range(W+2)] for _ in range(H+2)]
U = [[0 for _ in range(W+2)] for _ in range(H+2)]
D = [[0 for _ in range(W+2)] for _ in range(H+2)]

for i in range(1,H+1) :
    for j in range(1,W+1) :
        # 左上から
        if s[i-1][j-1] == '#' :
            L[i][j] = 0
            U[i][j] = 0
        else :
            L[i][j] = L[i][j-1] + 1
            U[i][j] = U[i-1][j] + 1
        # 右下から
        if s[-i][-j] == '#' :
            R[-i-1][-j-1] = 0
            D[-i-1][-j-1] = 0
        else :
            R[-i-1][-j-1] = R[-i-1][-j] + 1
            D[-i-1][-j-1] = D[-i][-j-1] + 1

ans = 0

for i in range(1,H+1) :
    for j in range(1,W+1) :
        point = L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3
        if ans < point :
            ans = point

print(ans)

Measured memory_bytes: 311816
#include <stdio.h>

int main(void)
{
	int height[10];
	int temp;
	int i, j, k;

	for(i=0; i<=9; i++){
		scanf("%d", &height[i]);
	}

	for(j=0; j<=9; j++){
		for(k=j; k<=9; k++){
			if( height[j] < height[k] ){
				temp = height[k];
				height[k] = height[j];
				height[j] = temp;
			}
		}
	}

	for(i=0; i<=2; i++){
		printf("%d\n", height[i]);
	}

	return 0;
}

Measured memory_bytes: 0
ratio_8,ratio_10 = map(int,input().split())
min = 10000
for price in range(1,1010):
  if int(price*0.08) == ratio_8 and int(price*0.1) == ratio_10:
    if min > price:
      min = price

print(min) if min < 10000 else print("-1")

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

#define ll long long 

ll gcd(ll a, ll b) {
    return (a ? gcd(b%a, a) : b); 
}

ll lcm(ll a, ll b) {
    return a * b / gcd(a, b); 
}


int main() {
    ios::sync_with_stdio(0); 

    
    int n, m; 
    cin >> n >> m;
    vector<ll> a(n); 
    for (int i = 0; i < n; i++) cin >> a[i]; 
    ll ans = 1; 
    for (auto x : a) ans = lcm(ans, x);

    bool ok = true; 
    for (auto x : a) {
        if (not (  (ans / x) & 1 ) ) ok = false ; 
    }

    if (ok) {
        ans = int((double)m/ans + 0.5); 

    } else 
        ans = 0; 

    cout << ans << "\n"; 

    return 0; 
}



Measured memory_bytes: 1024
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
use std::io::*;
use std::str::FromStr;

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

//const MAX:usize = 100006;
//const INF:u64 = u64::max_value();

fn main() {
    let n:u32 = read();
    let a:Vec<u32> = (0..n).map(|_| read()).collect();
    let b:Vec<u32> = (0..n).map(|_| read()).collect();
    let c:Vec<u32> = (0..n-1).map(|_| read()).collect();

    let mut ans:u32 = 0;
    for i in 0..n {
        let i = i as usize;
        ans += b[a[i] as usize -1];
        if i == 0 {continue}
        if a[i] == a[i-1]+1 {
            ans += c[a[i-1] as usize -1];
        }
    }

    println!("{}" ,ans);
}

Measured memory_bytes: 4352
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt();
    
    String[] S = new String[N];

    for (int i = 0; i < N; i++) {
      S[i] = sc.next();
    }

    sc.close();

    String result = "Three";

    for (int i = 0; i < N; i++) {
      if (S[i].equals("Y")) {
        result = "Four";
      }
    }
    
    System.out.println(result);
 
  }

}

Measured memory_bytes: 21588
n=int(input())
d={chr(i):0 for i in range(ord("a"),ord("z")+1)}

st=input()
for s in [chr(i) for  i in range(ord("a"),ord("z")+1)]:
        d[s] = st.count(s)

for i in range(n-1):
    A=input()
    for s in [chr(i) for  i in range(ord("a"),ord("z")+1)]:
        d[s] = min(d[s], A.count(s))
ans=""
for a,b in d.items():
    ans+= a*b
print(ans)

Measured memory_bytes: 9140
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>

using namespace std;

int main(){
	char s1[128];
	char s2[128];

	scanf("%s", s1);
	scanf("%s", s2);

	int l1 = strlen(s1);
	int l2 = strlen(s2);

	if(l1>l2){
		printf("GREATER\n");
		return 0;
	}else if(l1<l2){
		printf("LESS\n");
		return 0;
	}else{
		for(int i=0;i<l1;i++){
			if(s1[i]>s2[i]){
				printf("GREATER\n");
				return 0;
			}else if(s1[i]<s2[i]){
				printf("LESS\n");
				return 0;
			}
		}
	}

	printf("EQUAL\n");
	return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define pb push_back
#define FOR(i, a, b) for(int i = a; i < b; ++i)
#define FORE(i, a, b) for(int i = a; i <= b; ++i)
#define FORD(i, a, b) for(int i = a; i >= b; --i)
#define El "\n"
typedef long long int ll;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll n;
	cin>>n;
	ll m=n;
	ll ans=0;
	while(m)
	{
	    ans+=m%10;
	    m=m/10;
	}
	if(n%ans==0)
	cout<<"Yes";
	else
	cout<<"No";
	return 0;
}


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


set <int> factors;
int n;
long long a[10005];

int maks_potega[1000005];
int curr_pot[1000005];

void fact(int x, int tab[]){
	vector <int> f;
	for (int i = 2; i*i <= x; ++i){
		while (x % i == 0){
			f.push_back(i);
			x /= i;
		}
	}
	if (x != 1)
		f.push_back(x);
	sort(f.begin(),f.end());
	int el = -1, cnt = 0;
	for (int i = 0; i < f.size(); ++i){
		factors.insert(f[i]);
		if (el == -1){
			el = f[i];
			cnt = 1;
		}
		else if (el == f[i])
			cnt++;
		else{
			tab[el] = max(tab[el],cnt);
			el = -1;
			i--;
		}
	}
	tab[el] = max(tab[el],cnt);
}
const int mod = 1e9+7;
long long pot(long long a, long long b){
	if (b == 0)
		return 1;
	if (b == 1)
		return a;
	if (b % 2 == 0){
		long long t = pot(a,b/2);
		return 1LL * t * t % mod;
	}
	else{
		long long t = pot(a,b-1);
		return 1LL * t * a % mod;
	}
}


int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin >> n;
	for (int i = 1; i <= n; ++i)
		cin >> a[i];

	for (int i = 1; i <= n; ++i)
		fact(a[i],maks_potega);

	long long lcm = 1;
	for (auto u: factors)
		for (int j = 1; j <= maks_potega[u]; ++j){
			lcm *= u;
			if (lcm >= mod)
				lcm %= mod;
		}
	long long res = 0;
	for (int i = 1; i <= n; ++i){
		res += lcm * pot(a[i],mod-2);
		if (res >= mod)
			res %= mod;
	}
	cout << res << "\n";
}

Measured memory_bytes: 5376
import sys
def res(N,bia,s0):
  if N%4==1:
    N2=int(N/2)+1
  else:
    N2=int(N/2)
  print(N2+bia)
  sn=input()
  if sn=='Vacant':
    sys.exit()
  elif sn==s0:
    res(N2,bia,s0)
  else:
    if N==3:
      print(bia+2)
      sys.exit()
    res(N-N2+1,N2+bia-1,s0)
N=int(input())
print(0)
s0=input()
if s0=='Vacant':
  sys.exit()
res(N,0,s0)

Measured memory_bytes: 3660
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int[][] X = new int[N][4];
         
        for(int i = 0; i < N; i++) {
            for(int j = 0; j < 4; j++) {
                X[i][j] = stdIn.nextInt();
            }
        }
         
        for(int i = 0; i < N; i++) {
            if(X[i][2] - 5 > 0) {
                if(X[i][3] - 2 > 0) {
                    int ans = (int) ((X[i][0]*X[i][2] + X[i][1] * X[i][3]) * 0.8);
                    System.out.println(ans);
                }
                else {
                    if((X[i][0] * X[i][2] + X[i][1] * 2) * 0.8 < X[i][0] * X[i][2] + X[i][1] * X[i][3]) {
                        int ans = (int) ((X[i][0] * X[i][2] + X[i][1] * 2) * 0.8);
                        System.out.println(ans);
                    }
                    else {
                        System.out.println(X[i][0] * X[i][2] + X[i][1] * X[i][3]);
                    }
                }
            }
            else if(X[i][3] - 2 > 0) {
                if((X[i][0] * 5 + X[i][1] * X[i][3]) * 0.8 < X[i][0] * X[i][2] + X[i][1] * X[i][3]) {
                    int ans = (int) ((X[i][0] * 5 + X[i][1] * X[i][3]) * 0.8);
                    System.out.println(ans);
                }
                else {
                    System.out.println(X[i][0] * X[i][2] + X[i][1] * X[i][3]);
                }
            }
            else {
                if((X[i][0] * 5 + X[i][1] * 2) * 0.8 < X[i][0] * X[i][2] + X[i][1] * X[i][3]) {
                    int ans = (int) ((X[i][0] * 5 + X[i][1] * 2) * 0.8);
                    System.out.println(ans);
                }
                else {
                    System.out.println(X[i][0] * X[i][2] + X[i][1] * X[i][3]);
                }
            }
        }
    }
         
}

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

#define FOR(i,a,b)    for (int i=(a)  ;i<(b) ;i++)
#define RFOR(i,a,b)   for (int i=(b)-1;i>=(a);i--)
#define REP(i,n)      for (int i=0    ;i<(n) ;i++)
#define RREP(i,n)     for (int i=(n)-1;i>=0  ;i--)
#define EACH(i,a,b)   for (int i=(a)  ;i<=(b);i++)
#define ALL(a)        (a).begin(),  (a).end()
#define RALL(a)       (a).rbegin(), (a).rend()

const int MOD = 1e9 + 7;
const int INF = 1 << 29;
const double EPS = 1e-10;

typedef long long ll;

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

  int N;
  cin >> N;
  int X[N];
  REP(i,N) cin >> X[i];

  auto mm = minmax_element(X, X+N);
  int ans = INF;
  EACH(p, *mm.first, *mm.second) {
    int sum = 0;
    for(int xi : X) {
      sum += (xi - p) * (xi - p);
    }
    ans = min(ans, sum);
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3612
#include<iostream>
//#include<cctype>
using namespace std;
int main(){
    char ch, chr, wor ;
    while(1){
      scanf("%c", &ch);
      if (ch == '\n')break;
      if('a' <= ch && ch <= 'z') ch= toupper(ch);
      else if('A' <= ch && ch <= 'Z') ch = tolower(ch);
        cout << ch;
    }
    cout<<endl;
    return 0;
}


Measured memory_bytes: 3156
MOD = 10 ** 9 + 7
INF = 10 ** 10
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)
from bisect import bisect_left,bisect_right
from collections import deque

def main():
    n = int(input())
    food = []
    ans = 0
    for _ in range(n):
        a,b = map(int,input().split())
        ans -= b
        food.append(a + b)
    
    food.sort(reverse = True)
    for i in range(n):
        if i%2 == 0:
            ans += food[i]
    print(ans)
if __name__ =='__main__':
    main()  

Measured memory_bytes: 7732
#include <bits/stdc++.h>
using namespace std;
int main () {
	int n; cin >> n;
	int lst = 0; long long ans = 0;
	for (int i = 0; i < n; i++) {
		int x; cin >> x;
		if (x < lst) ans += lst - x;
		else lst = x;
	}
	cout << ans << endl;
	return 0;
}


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

#define llong long long
#define fr(i,l,r) for(i=(l);i<(r);i++)
#define min(p,q)((p)<(q)?(p):(q))


int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

int main(void)
{
	//変数の宣言
	int n;
	int a[200010];
	int r=0;
	
	//よく使う変数
	int i,j,k;
	int flag=0;
	int ans=0;
	long int count=0;
	int sum=0;
	int temp,temp1,temp2;
	int max,min;
	int len;
	//データの読み込み
	
	//データの読み込み
	scanf("%d",&n);
	
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	
//	printf("nは%dです\n", n);
//	printf("データの読み込み終了\n");
	//実際の処理
	
	
	for(i=0;i<n;i++){
		flag=0;
		while(flag==0){
//			printf("a[i]=%d,sum=%d\n",a[i],sum);
//			printf("a[r]=%d,sum=%d,a[r]|sum=%d,a[r]+sum=%d\n",a[r],sum,a[r]|sum,a[r]+sum);
			temp1=a[r]|sum;
			temp2=a[r]+sum;
			if(temp1==temp2&&r<n){
				sum=sum+a[r];
				r++;
			}else{
				count=count+r-i;
//				printf("i=%d,r=%d count=%d\n",i,r,count);
				sum=sum-a[i];
				flag=1;
			}
		}
	}
	
	
//	printf("計算部分終了\n");
	
	//出力
	
	printf("%ld",count);
	
//	printf("結果の出力終了\n");
	
	return 0;
}



Measured memory_bytes: 896
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.NoSuchElementException;
import java.util.Random;

class Main {
	public static void main(String[] args) {
		new Main().run();
	}
	
	void run() {
		FastScanner sc=new FastScanner();
		PrintWriter pw=new PrintWriter(System.out);
		char[] cs=sc.next().toCharArray();
		Arrays.sort(cs);
		pw.println(cs[0]=='a'&&cs[1]=='b'&&cs[2]=='c'?"Yes":"No");
		pw.close();
	}
	
	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}


class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public int nextInt() {
    	return Integer.parseInt(next());
    }
    
    public long nextLong() {
    	return Long.parseLong(next());
    }
}

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

using namespace std;
typedef long long ll;

// #define DEBUG


main()
{

#ifdef DEBUG
    cout << "DEBUG MODE" << endl;
    ifstream in("input.txt"); //for debug
    cin.rdbuf(in.rdbuf());    //for debug
#endif

    int n, m, c, ans;
    cin >> n >> m;
    int dp_list[n+1];
    for (int j = 0; j <= n; j++)
        dp_list[j] = j;
    for (int i = 0; i < m; i++){
        cin >> c;
        for (int j = 0; j <= n; j++)
        {
            if (j + c <= n)
                dp_list[j + c] = min(dp_list[j + c], dp_list[j] + 1);
            // cout << dp_list[j] << " ";
        }
        // cout << endl;
    }

    cout << dp_list[n] << endl;
    return 0;
}


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

int main()
{
    int a,b=0;
    
    while (cin >> a >> b){
        a+=b;
    for (b=1; a>=10; b++) {
        a = a / 10;
    }
        cout << b << endl;
    }
}

Measured memory_bytes: 1160
k,x = map(int,input().split())
l = x - k + 1
r = x + k
if l < -100000:
  r -= l + 100000
  l = -100000
if r > 100001:
  l -= r - 100001
  r = 100001
A = range(l,r,1)
print(' '.join(map(str,A)))

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
typedef long long ll;
int main() {
  int n, l, sum = 0, mx = 0;
  cin >> n;
  rep(i,n)
  {
    cin >> l;
    sum += l;
    mx = max(mx, l);
  }
  if (sum <= mx * 2) {
    cout << "No";
  } else {
    cout << "Yes";
  }
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)

constexpr int MAX_N = 100000, MAX_K = 1000;

int N, K;
int fld[2*MAX_K][2*MAX_K], S[4*MAX_K+1][4*MAX_K+1], S_mod[2*MAX_K+1][2*MAX_K+1];

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

  int ox, oy;
  rep( i, N )
  {
    int x, y;
    char c;
    scanf( "%d%d %c", &x, &y, &c );

    if( c == 'W' )
      y += K;

    x %= 2*K;
    y %= 2*K;
    //++fld[(x+add)%(2*K)][y%(2*K)];
    //++fld[x%(2*K)][(y+add)%(2*K)];
    
    ++S[x][y];
    --S[x][y+K];
    --S[x+K][y];
    ++S[x+K][y+K];

    ++S[x+K][y+K];
    --S[x+K][y+2*K];
    --S[x+2*K][y+K];
    ++S[x+2*K][y+2*K];

    /*nx = (x+add)%(2*K), ny = y%(2*K);
    left = std::max( 0, nx-K ), bottom = std::min( 2*K-1, ny+K );
    
    ++S[left][ny];
    --S[nx+1][ny];
    --S[left][bottom];
    ++S[nx+1][bottom];*/
  }

  rep( i, 4*K+1 ) rep( j, 4*K )
    S[i][j+1] += S[i][j];
  rep( i, 4*K ) rep( j, 4*K+1 )
    S[i+1][j] += S[i][j];

  rep( i, 4*K ) rep( j, 4*K )
    S_mod[i%(2*K)][j%(2*K)] += S[i][j];

  int ans = 0;
  rep( i, 2*K ) rep( j, 2*K )
    ans = std::max( ans, S_mod[i][j] );

  printf( "%d\n", ans );

  return 0;
}

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

using namespace std;
using ll = long long;

int main()
{
  int a,b,c=0,d,e,f=1001;
  cin >> a >> b;
  e = a;
  while (a--) {
    cin >> d;
      c+= d;
      if (d < f) {
        f = d;
      }
  }
  cout << ((b-c)/f) + e << endl;
  return 0;
}


Measured memory_bytes: 3560
#include<bits/stdc++.h>
using namespace std;
#define Sheryang main
typedef long long ll;
#pragma GCC optimize(3)
#define HEAP(...) priority_queue<__VA_ARGS__ >
#define heap(...) priority_queue<__VA_ARGS__,vector<__VA_ARGS__ >,greater<__VA_ARGS__ > >
template<class T> inline T min(T &x,const T &y){return x>y?y:x;}
template<class T> inline T max(T &x,const T &y){return x<y?y:x;}
int read()
{
    int x=0,f=1;	char c=getchar();
    while(c<'0'||c>'9')	{if(c=='-') f=-1;c=getchar();}
    while(c>='0'&&c<='9')	{x=x*10+c-'0';c=getchar();}
    return x*f;
}
struct ios
{
	inline char gc()
	{
		static const int IN_LEN=1<<18|1;
		static char buf[IN_LEN],*s,*t;
		return (s==t)&&(t=(s=buf)+fread(buf,1,IN_LEN,stdin)),s==t?-1:*s++;
	}
	template <typename _Tp> inline ios & operator >> (_Tp&x)
	{
		static char ch,sgn; ch = gc(), sgn = 0;
		for(;!isdigit(ch);ch=gc())
		{	
			if(ch==-1)return *this;sgn|=ch=='-';
		}
		for(x=0;isdigit(ch);ch=gc())x=(((x<<2)+x)<<1)+(ch^'0');
		sgn&&(x=-x); return *this;
	}
}io;
const int maxn = 1e5 + 7;
const int mod = 1e9 + 7;
/** keep hungry and keep calm! **/

/**
就是一个立方体切一刀，使得切出的两部分的体积之差最小
a*b*c的立方体，每条边长度就是ab,ac,bc
只要有一条边是偶数
那么从这条边中间切开，两部分体积相同，差为0
如果每条边都是奇数
那肯定会差一个面的大小
输出面积最小的一个面就可以 
**/
ll a,b,c;
int main()
{
	cin >> a >> b >> c;
	if(a % 2 == 0 || b % 2 == 0 || c % 2 == 0)
		cout << 0 << endl;
	else
		cout << min(min(a*b,a*c),b*c) << endl;
	return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))

import numpy as np

A = sorted(A)
B = np.cumsum(A)

mem = N
for i in range(N-1):
    if 2*B[i] >= A[i+1]:
        mem = min(i, mem)
    else:
        mem = N
print(N-mem)

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

using ll = long long;

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

  set<int> used;
  vector<int> path;
  int now = 0;
  while (used.count(now) == 0) {
    path.push_back(now);
    used.insert(now);
    now = A[now];
  }

  int initial = find(path.begin(), path.end(), now) - path.begin();
  int T = path.size() - initial;

  if (K < initial) {
    cout << path[K] + 1 << endl;
    return 0;
  } else {
    cout << path[(K - initial) % T + initial] + 1 << endl;
  }
}

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

int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	int k;
	cin>>k;
	int arr[32]={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};
	cout<<arr[k-1];
    return 0;	
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<sstream>
#include<iomanip>
#include<limits>
#include<deque>
#include<map>
#include<list>
#include<set>
#include <unordered_set>
#include<vector>
#include<cmath>
#include<cstdio>
#include<memory>
#include<bitset>
#include<stack>
#include<functional>
#include<queue>
#include<regex>
#include<time.h>
#include<type_traits>

using namespace std;
using ll = long long;

constexpr ll MOD = 1000000007;
constexpr ll INF = 1050000000;
constexpr ll LONGINF = 1050000000000000000;

int main() {
	int a, b; cin >> a >> b;
	vector<int> x(1000);
	for (int i = 1; i <= 999; i++) {
		x[i] = x[i - 1] + i;
	}

	int sa = b - a;

	for (int i = 1; i <= 999; i++) {
		if (x[i] - x[i - 1] == sa) {
			cout << x[i-1] - a << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 256
import numpy as np
N, M, C = map(int, input().split())
B = np.array(list(map(int, input().split())))
cnt = 0
for i in range(N):
    A = np.array(list(map(int, input().split())))
    if np.dot(A, B) + C > 0:
        cnt += 1
print(cnt)



Measured memory_bytes: 12392
/*
 KUNAL RAUT (ZUKONIT14)  :- "DO WHAT YOU LIKE!"
 -PICT,PUNE! :)
 */
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define ld long double
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define mod9 1000000009
#define pi 3.1415926535
#define MAXN 1000005
#define N 1000001
#define MAX2N 1*1000 + 10
#define all(v) v.begin(), v.end()
#define ms(s, n) memset(s, n, sizeof(s))
#define prec(n) fixed<<setprecision(n)
#define forci(p,n) for(ll i=p;i<(ll)n;i++)
#define forcj(p,n) for(ll j=p;j<(ll)n;j++)
#define bolt ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define bits(a) __builtin_popcount(a)
#define test ll t;cin>>t;for(ll testi=1;testi<=t;testi++)
#define djokovic  freopen("input00.txt", "r", stdin);freopen("output00.txt", "w", stdout);
ll gcd(ll a, ll b) {    if (b == 0) return a;    return gcd(b, a % b);}
ll lcm(ll a, ll b) {    return (a / gcd(a, b) * b);}
ll expo(ll x, ll y) {
    ll res = 1; x = x % mod; while (y > 0) {
        if (y & 1)res = (1ll * res * x) % mod;
        y = y >> 1; x = (1ll * x * x) % mod;
    } return res;
}
ll ncr(ll n, ll r) { ll res = 1; if (r > n - r)r = n - r; for (ll i = 0; i < r; i++) {  res *= n - i;  res /= i + 1; } return res;}
ll max(ll a, ll b) {return (a > b) ? a : b;}
bool prime(ll n) {ll i; for (i = 2; i <= sqrt(n); i++) {if (n % i == 0)return false;} return true;}
bool sortbysec(const pair<ll, ll> &a, const pair<ll, ll> &b)
{   if (a.second == b.second)
        return a.first < b.first;
    return (a.second < b.second);
}
//https://www.youtube.com/watch?v=WTJSt4wP2ME

ll rr[] = {0, 1, 1, 1, 0, -1, -1, -1,};
ll cc[] = {1, 1, 0, -1, -1, -1, 0, 1};
ll n, m, x, y, k, a[MAXN], p[MAXN];
void solve()
{
    string s; cin >> s;
    bool ans = false;
    forci(0, s.length())     if (s[i] == '7')   ans = true;
    cout << (ans ? "Yes" : "No");
}
signed main()
{
    bolt;
    //djokovic;
    solve();
}




Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
double a,b,x;
int main(){
    scanf("%lf%lf%lf",&a,&b,&x);
    //cin>>a>>b>>x;
    if (a*a*b>=x*2)
    {
        double tanx=a*b*b/(2*x);
        double ans=180*atan(tanx)/(acos(-1));
        printf("%.10f\n",ans);
        //cout<<180*atan(tanx)/(acos(-1))<<endl;
    }
    else
    {
        double y=2*b-2*x/(a*a);
        double tanx=y/a;
        double ans=180*atan(tanx)/(acos(-1));
        printf("%.10f\n",ans);
       // cout<<180*atan(tanx)/(acos(-1))<<endl;
    }
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }

        static void Solve()
        {
            var N = Sarray()[0];
            WriteLine(N / 3);
        }
        static long Mod = 998244353;
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static public (T a, T b) Slice2<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)));
        }
        static public (T a, T b, T c) Slice3<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)));
        }
    }
}

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

typedef long long ll;
const int maxn = 500005;

inline int gi()
{
	char c = getchar();
	while (c < '0' || c > '9') c = getchar();
	int sum = 0;
	while ('0' <= c && c <= '9') sum = sum * 10 + c - 48, c = getchar();
	return sum;
}

char s[maxn];
int n, a[maxn], b[maxn];

int main()
{
	scanf("%s", s + 1); n = strlen(s + 1);
	ll sum = 0;
	for (int i = 1; i <= n; ++i) a[i] = s[i] == '<' ? a[i - 1] + 1 : 0;
	for (int i = n - 1; ~i; --i) b[i] = s[i + 1] == '>' ? b[i + 1] + 1 : 0;
	for (int i = 0; i <= n; ++i) sum += max(a[i], b[i]);
	printf("%lld\n", sum);

	return 0;
}


Measured memory_bytes: 4608
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int ab = scanner.nextInt() + scanner.nextInt();
        int cd = scanner.nextInt() + scanner.nextInt();

        System.out.println((ab > cd) ? "Left" : (ab == cd) ? "Balanced" : "Right" );

    }
}


Measured memory_bytes: 23764
def examA():
    A, B = LI()
    ans = A*B
    print(ans)
    return

def examB():
    N = I()
    A = LI()
    for a in A:
        if a==0:
            print(0)
            return
    ans = 1
    for a in A:
        ans *= a
        if ans>10**18:
            print(-1)
            return
    print(ans)
    return

def examC():
    A, B = list(map(float,input().split()))
    ans = int(A*B)
    print(ans)
    return

def examD():
    def factorization(n):
        arr = defaultdict(int)
        temp = n
        for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
            if temp % i == 0:
                cnt = 0
                while temp % i == 0:
                    cnt += 1
                    temp //= i
                arr[i] = cnt
        if temp != 1:
            arr[temp] = 1
        if arr == []:
            arr[n] = 1
        return arr
    C = [0,1,3,6,10,15,21,28,36,45]
    N = I()
    F = factorization(N)
    ans = 0
    #print(F)
    for f in F.values():
        for i in range(10):
            if C[i]>f:
                ans += i-1
                break
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 1<<60
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examD()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Measured memory_bytes: 76744
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(int argc, char const *argv[]) {
  int temp,mini=10,summ=0;
   for(int i=0;i<5;i++){
     std::cin >> temp;
     if(temp%10!=0){
       mini = min(mini, temp%10);
       temp += 10 - temp%10;
     }
     summ += temp;
   }
   std::cout << summ - 10 + mini << '\n';;

  return 0;
}

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

/*第二引数で第一引数を割ったときの切り上げの計算*/
long long int maxtime(long long int x, long long int y) {
	return(x + y - 1) / y;

}
/*最大公約数*/
long long int lcm(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;

	if (number2 > number1) {
		m = number2;
		n = number1;
	}
	long long int s = -1;
	while (s != 0) {
		s = m % n;
		m = n;
		n = s;
	}
	return m;
}
/*最大公倍数*/
long long int gcd(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;
	return m / lcm(m, n) * n;
}
int dp[120][10200] = {};
int main() {
	int d[3];
	for (int i = 0; i < 3; i++) {
		int a;
		cin >> a;
		d[i] = a;
	}
	int sum = 100000;
	for (int i = 0; i < 3; i++) {
		int k1 = 0;
		for (int j = 0; j < 3; j++) {
			if (i == j) {
				continue;
			}
			for (int k = 0; k < 3; k++) {
				if (i == k || j == k) {
					continue;
				}
				sum = min(abs(d[j]-d[i])+abs(d[k]-d[j]), sum);

			}
		}
	}
	cout << sum;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
	// your code goes here
	int n;
	cin>>n;
	int height[n];
	for(int i=0;i<n;i++)
	cin>>height[i];
    int dp[n];
    dp[0]=0;
    dp[1]=abs(height[0]-height[1]);
    for(int i=2;i<n;i++)
    dp[i]=min(dp[i-2]+abs(height[i]-height[i-2]),dp[i-1]+abs(height[i]-height[i-1]));
    cout<<dp[n-1];
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <sstream>
#include <limits>
#include <numeric>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
using namespace std;

int main ()
{
	int S;
	cin >> S;

	int s = S % 60;
	int m = (S % 3600) / 60;
	int h = S / 3600;
	
	cout << h << ":" << m << ":" << s << endl;

	return 0;
}


Measured memory_bytes: 3072
#include <cstdio>
#include <algorithm>
using namespace std;
 
int N, A[200];
 
int main()
{
	int dmin = 100;
	scanf("%d", &N);
	for (int i = 0; i < N; ++i) {
		int A;
		scanf("%d", &A);
		int d = 0;
		while (A % 2 == 0) {
			A /= 2;
			++d;
		}
		dmin = min(dmin, d);
	}
	printf("%d\n", dmin);
	return 0;
}

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

int main(){
  string a;
  cin >> a;
  if (a[0] == a[1]){
    cout << "Bad" << endl;
  }
  else if (a[1] == a[2]){
    cout << "Bad" << endl;
  }
  else if (a[2] == a[3]){
  	cout << "Bad" << endl;
  }
  else {
    cout << "Good" << endl;
  }
}


Measured memory_bytes: 256
s = list(input())
if (s[0]=="R" and s[1]=="R" and s[2]=="R"):
  print(3)
elif (s[0]=="R" and s[1]=="R") or (s[1]=="R" and s[2]=="R"):
         print(2)
elif s[0]!="R" and s[1]!="R" and s[2]!="R":
         print(0)
else:
         print(1)



Measured memory_bytes: 8976
import java.util.*;

public class Main {

    public static void main(String[] args) {
	    // write your code here
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        PriorityQueue<Integer> queue = new PriorityQueue<>();

        for(int i = 0; i < n; i++) {
            queue.add(sc.nextInt());
        }

        int ans = 0;
        for(int i = 0; i < n - 1; i++) {
            ans += queue.poll();
        }
        ans += queue.poll() / 2;

        // 出力
        System.out.println(ans);
    }
}


Measured memory_bytes: 21972
#include <bits/stdc++.h>
//#define cin (type == 0?cin:fin)
//#define cout (type == 0?cout:fout)
#define tcn cin.tie(0);
#define tct cout.tie(0);
#define r_0 return 0
#define ll long long
#define fr first
#define se second
#define TIME ios_base::sync_with_stdio(0);
using namespace std;

const long long N = 2e5 + 7;
const long long MrBeast = 1e9;

ll T = 1, n, m, x, a[N], b[N], used[N], u[N], cnt, ans, mx = -1;
vector < string > v;
int type = 0;
set< ll > st;
pair< ll ,ll > p[N];
string s, str;
int bs( ll x, ll l, ll r )
{
    ll mid = (l + r) / 2;
    if ( a[mid] < x ){
        l = mid + 1;
        bs( x, l, r );
    }
    else if ( a[mid] > x ) {
        r = mid - 1;
        bs( x, l, r );
    }
    else
    return cout << mid, 0;
}
int main()
{
    TIME
    //ifstream  fin("swap.in");
    //ofstream  fout("swap.out");
     cin >> n;
     cin >> m >> x;
     for ( int i=m; i<= x; i ++ ){
        if ( i % n == 0 ){
            cout << "OK";
            return 0;
        }
     }
     cout << "NG";
}


Measured memory_bytes: 3616
#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> pp;
const int INF = 1e9;
const int MOD = 1000000007;

 
int main() {
        int h,w,k;
        cin >> h >> w >> k;
        vector<vector<int>> choco(h,vector<int>(w,0));
        rep(i,h){
                string s;
                cin >> s;
                rep(j,w){
                        if(s[j] =='1') choco.at(i).at(j) ++;
                }
        }
        
        int ans = INF;
        rep(i,pow(2,h-1)){
                bool ok = true;
                vector<int> cut(h);
                int idx = 0;
                rep(j,h-1){
                        if(i >> j & 1) {cut.at(j) = idx; idx ++;}
                        else cut.at(j) = idx;
                }
                cut.at(h-1) = idx;
                vector<int> cnt(idx+1);
                int res = idx;
                rep(col,w){
                        bool ok1 = true,ok2 = true;
                        rep(row,h){
                            if(choco.at(row).at(col) == 1){
                                cnt.at(cut.at(row)) ++;
                            }
                        }
                        rep(www,idx+1){
                                if(cnt.at(www) > k) ok1 = false;
                        }
                        if(ok1 == false){
                                res ++;
                                rep(i,idx+1){
                                        cnt.at(i) = 0;
                                }
                                rep(ppp,h){
                                        if(choco.at(ppp).at(col) == 1){
                                                cnt.at(cut.at(ppp)) ++;
                                        }
                                }
                                rep(ppp,cnt.size()){
                                        if(cnt.at(ppp) > k) ok = false;
                                }
                        }
                }
                //cout << "RES" << res << endl;
                if(ok) ans = min(ans,res);             

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




Measured memory_bytes: 256
N = int(input())
a = [int(i) for i in input().split()]
m = None
x = 0
y = 0
y = sum(a)

for i in range(len(a)-1):
	x += a[i]
	y -= a[i]
	if(m == None or m > abs(x - y)):
		m = abs(x - y)
print(m)

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

using namespace std;
typedef long long ll;

int ans;
ll n;

void dfs(ll cur) {
	if (cur<=n) {
		ll tmp=cur;
		int ok1=0, ok2=0, ok3=0;
		while(tmp) {
			int t=tmp%10;
			ok1|=(t==3);
			ok2|=(t==5);
			ok3|=(t==7);
			tmp/=10;
		}
		if (ok1&&ok2&&ok3) ans++;
	}
	else return; 
	dfs(cur*10+3);
	dfs(cur*10+5);
	dfs(cur*10+7);
}

int main() {
	scanf("%lld", &n);
	dfs(0);
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>
#include <numeric>
#include <utility>
#include <random>
#include <chrono>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>

using namespace std;

using LL = long long;
using ULL = unsigned long long;
using PII = pair<int, int>;
using PIL = pair<int, LL>;
using PLL = pair<LL, LL>;
// const int mod = 1e9 + 7;
// const int mod = 998244353;

inline void quickread() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

int f[100010], h[100010];
int n;

inline void work() {
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
    }
    f[2] = abs(h[1] - h[2]);
    for (int i = 3; i <= n; ++i) {
        f[i] = min(f[i - 2] + abs(h[i] - h[i - 2]), f[i - 1] + abs(h[i] - h[i - 1]));
    }
    cout << f[n] << "\n";
}

int main() {
    // freopen("input.txt", "r", stdin);
    quickread();
    work();
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,n) for(int i=(a); i<(n); i++)
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;

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

    int n, m; cin >> n >> m;
    vector<int> vec(n, -1);
    rep(i, m) {
        int x, y; cin >> x >> y;
        x--;
        if (vec[x]!= -1 && vec[x]!=y) {
            cout << -1 << endl;
            return 0;
        } else {
            vec[x] = y;
        }
    }

    if ((n==1 && vec[0]==0)||(n==1&&m==0)) {
        cout << 0 << endl;
        return 0;
    }

    rep(i, pow(10, n)) {
        int x = i;
        int keta = 0;
        vector<int> tmp;
        while (x) {
            keta++;
            tmp.push_back(x%10);
            x /= 10;
        }
        if (keta!=n) continue;
        reverse(tmp.begin(), tmp.end());
        bool flag = true;
        rep(i, n) {
            if (vec[i]!=-1 && vec[i]!=tmp[i]) flag = false;
        }
        if (flag) {
            cout << i << endl;
            return 0;
        }
    }

    cout << -1 << endl;
}

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

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; }
using Graph = vector<vector<int>>;
/* 4方向への隣接頂点への移動を表すベクトル */
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

const long long INF = 1LL << 60;

int main(){
        int N;
    cin >> N;
    cout << N*N*N << endl;

}

Measured memory_bytes: 256
from itertools import combinations

def python_list_add(in1, in2):
   return list(map(sum, zip(in1, in2)))

N, M, X = map(int, input().split())
T = []
C = []
min = 10000000

for n in range(N):
    C.append(list(map(int, input().split())))

for bi in range(2**N):
    rikai = [0]*(M+1)
    low = False
    for i in range(N):
        b = 2**i
        if bi & b != 0:
            for j in range(M+1):
                rikai[j] = rikai[j] + C[i][j]
                #if rikai[0] > min:
                    #break
    #print(rikai)
    if rikai[0] < min:
        for m in range(1, M+1):
            if rikai[m] < X:
                low = True
                #print('low rikai')
                break
        if low == False:
            min = rikai[0]
if min == 10000000:
    print('-1')
else:
    print(min)

Measured memory_bytes: 9128
#include<stdio.h>
#define N 100

int main(){
    int M[N][N];
    int i,j,n,u,k,v;
    
    scanf("%d",&n);
    
    for( i=0; i<n; i++){
        for(j=0; j<n; j++){
            M[i][j]=0;
        }
    }
    
    for( i=0; i<n; i++){
        scanf("%d%d",&u,&k);
        u--;
        for(j=0; j<k; j++){
            scanf("%d",&v);
            v--;
            M[u][v]=1;
        }
    }
    for(i=0; i<n; i++){
        for(j=0; j<n; j++){
            if(j) printf(" ");
            printf("%d",M[i][j]);
        }
        printf("\n");
    }
    return 0;
}


Measured memory_bytes: 2108
<?php
fscanf(STDIN,"%d %d %d %d %d",$W,$H,$x,$y,$r);
if($x-$r<0||$x+$r>$W){
	echo "No\n";
}else if($y-$r<0||$y+$r>$H){
	echo "No\n";
}else{
	echo "Yes\n";
}

Measured memory_bytes: 6524
#include<bits/stdc++.h>
using namespace std;
#define MAXN 100010
typedef long long ll;
ll n,a,b;
ll c[MAXN];


bool judge(ll x){//对二分的值进行判断
    ll sum=0;
    for(ll i=1;i<=n;i++){   
        ll j=c[i]-x*b;      //减去x个b  
        if(j>0) {       //若小于零就不可以用a方式炸了
            if(j%(a-b)==0)  sum+=j/(a-b);//减去x*b后剩下的量/（a-b）就是可以用a方式炸几次
            else sum+=j/(a-b)+1;
        }
        if(sum>x)   return false;       //x次a方式炸不完全就排除 
    }

return true;
}

int main(){

    cin>>n>>a>>b;
    ll max1=0;
    for(ll i=1;i<=n;i++){
        cin>>c[i];
        max1=max(max1,c[i]);        //找出最大右边界 减少二分次数
    }
    ll l=1; ll r=max1;
        while(r>l){
        ll mid=(l+r)/2;
        if(judge(mid))   r=mid;
        else l=mid+1;
    }

    cout<<r<<endl;

return 0;}

Measured memory_bytes: 1024