akhauriyash/Code-Regression huggingface dataset:
n, l = map(int, input().split(' '))

tmp = [i for i in range(l, n + l)]
original = sum(tmp)

if l >= 0:
    result = original - tmp[0]
elif 0 in tmp:
    result  = original
else:
    result = original - tmp[len(tmp) - 1]

print(result)


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

const int N = 111111;
int a[N];
int n, k;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> k;
    int maxi = 0;
    for(int i = 1; i <= n; i++) {
        cin >> a[i];
        if(a[i] == k) {
            cout << "POSSIBLE" << endl;
            return 0;
        }
        maxi = max(maxi, a[i]);
    }
    if(n < 2 || maxi < k) {
        cout << "IMPOSSIBLE" << endl;
        return 0;
    }
    int g = a[1];
    for(int i = 2; i <= n; i++) {
        g = __gcd(g, a[i]);
    }
    cout << (k % g == 0 ? "POSSIBLE" : "IMPOSSIBLE") << endl;
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define enter putchar('\n')
#define space putchar(' ')
#define MAXN 1005
//#define ivorysi
using namespace std;
typedef long long int64;
typedef double db;
template<class T>
void read(T &res) {
    res = 0;char c = getchar();T f = 1;
    while(c < '0' || c > '9') {
	if(c == '-') f = -1;
	c = getchar();
    }
    while(c >= '0' && c <= '9') {
	res = res * 10 + c - '0';
	c = getchar();
    }
    res *= f;
}
template<class T>
void out(T x) {
    if(x < 0) {x = -x;putchar('-');}
    if(x >= 10) {
	out(x / 10);
    }
    putchar('0' + x % 10);
}
int N;
int64 a[MAXN],dp[MAXN];
int fr[MAXN];
int op[MAXN],tot;

void Solve() {
    read(N);
    for(int i = 1 ; i <= N ; ++i) read(a[i]);
    int64 ans = a[1];
    for(int i = 1 ; i <= N ; ++i) {
	dp[i] = a[i];fr[i] = 0;
	for(int j = 2 ; j <= i ; j += 2) {
	    if(dp[i - j] + a[i] > dp[i]) {
		dp[i] = dp[i - j] + a[i];
		fr[i] = i - j;
	    }
	}
	ans = max(ans,dp[i]);
    }
    out(ans);enter;
    int a = N;
    for(int i = N ; i >= 1 ; --i) {
	if(dp[i] == ans) {
	    for(int j = N ; j > i ; --j) {op[++tot] = j;--a;}
	    int t = i,c = 0;
	    while(fr[t]) {
		++c;
		int mid = (fr[t] + 1 + a - c) >> 1;
		for(int j = mid ; j > fr[t] ; --j) {op[++tot] = j;}
		a -= (a - c - fr[t]);
		t = fr[t];
	    }
	    for(int j = 1 ; j < t ; ++j) op[++tot] = 1;
	    break;
	}
    }
    out(tot);enter;
    for(int i = 1 ; i <= tot ; ++i) {
	out(op[i]);enter;
    }
}
int main() {
#ifdef ivorysi
    freopen("f1.in","r",stdin);
#endif
    Solve();
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(void){
    int d;

    cin>>d;

    switch(d){
        case 25:
        cout<<"Christmas"<<endl;
        break;
        case 24:
        cout<<"Christmas Eve"<<endl;
        break;
        case 23:
        cout<<"Christmas Eve Eve"<<endl;
        break;
        case 22:
        cout<<"Christmas Eve Eve Eve"<<endl;
        break;
    }


    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
    int A,B,C,D ;
    int l,r;
    scanf("%d %d %d %d",&A,&B,&C,&D);
    l = A + B;
    r = C + D;
    if(l>r){
        printf("Left\n");
    }else if(l<r){
        printf("Right\n");
    }else{
        printf("Balanced\n");
    }
    return 0;
}

Measured memory_bytes: 888
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int A1 = scan.nextInt();
		int A2 = scan.nextInt();
		int A3 = scan.nextInt();

		System.out.println(A1+A2+A3 >= 22?"bust":"win");

		scan.close();

	}

}


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

diff = [0] * n
for i in range(n):
    d = a[i] - (i + 1)
    diff[i] = d

diff = sorted(diff)
if n % 2 == 1:
    x = diff[n // 2]
else:
    x = (diff[(n // 2) - 1] + diff[n // 2]) // 2

ans = 0
for i in range(n):
    ans += abs(diff[i] - x)

print(ans)

Measured memory_bytes: 30860
a,b,c,x,y=map(int,input().split())
if c-(a+b)*(1/2)>=0:
    print(a*x+b*y)
else:
    z=min(x,y)*2
    ans1=int(a*x+b*y+(c-(a+b)*(1/2))*z)
    z=max(x,y)*2
    if x-z/2<0:
        x=0
    else:
        x=int(x-z/2)
    if y-z/2<0:
        y=0
    else:
        y=int(y-z/2)
    ans2=a*x+b*y+c*z
    print(min(ans1,ans2))



Measured memory_bytes: 3064
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N = int(input())
    A = list(map(int, input().split()))

    ans = 0

    for i in range(N):
        ans += 1 / A[i]

    ans = 1 / ans
    print(ans)


if __name__ == '__main__':
    solve()


Measured memory_bytes: 38384
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Iterator;

class Graph2 {
	private int totalVertex;
	private int totalEdge;
	private int[][] adjList;
	private int[] inDegree;
	private int[] outDegree;
	private LinkedList<Integer> pre = new LinkedList<Integer>();
	private int[] visited;
	private LinkedList<Integer> post = new LinkedList<Integer>();
	//adjacency list of edges
	public Graph2() { 
		totalVertex = 0; 
		totalEdge = 0; 
		adjList = null;
		inDegree = outDegree = null;
	}
	//given graph is in edge list
	public void loadEdgeList() {
		Scanner in = new Scanner(System.in);
		totalVertex = in.nextInt();
		totalEdge = in.nextInt();
		adjList = new int[totalVertex][totalVertex];
		outDegree = new int[totalVertex];
		inDegree = new int[totalVertex];
		for(int i = 0; i < totalVertex; i ++) outDegree[i] = inDegree[i] = 0;
		for(int i = 0; i < totalEdge; i ++) {
			int u = in.nextInt();
			int v = in.nextInt();
			adjList[u][outDegree[u]] = v;
			outDegree[u] ++;
			inDegree[v] ++;
		}
		in.close();
		visited = new int[totalVertex];
		for(int i = 0; i < totalVertex; i ++) {
			visited[i] = 0;
		}
	}
	public void DFS(int s) {
		pre.add(s); //ordering of the vertices based on when they are "discovered"
		visited[s] = 1;
		for(int i = 0; i < outDegree[s]; i ++) {
			int w = adjList[s][i]; 
			//if(!pre.contains(w)) { //using this won't pass the last test case (time exceeds)
			if(visited[w] == 0) {
				DFS(w);
			}
		}
		post.add(s); //ordering of the vertices after completion of DFS
	}
	public LinkedList<Integer> topSortDFS() {
		for(int i = 0; i < totalVertex; i ++) {
			if(inDegree[i] == 0) DFS(i);
		}	
		LinkedList<Integer> s = new LinkedList<Integer>();
		Iterator<Integer> it = post.iterator();
		while(it.hasNext()) {
			int u = it.next();
			s.add(0, u);
		}
		return s;
	}
	public LinkedList<Integer> topSortQueue() {
		LinkedList<Integer> q = new LinkedList<Integer>();
		LinkedList<Integer> s = new LinkedList<Integer>();
		int i;
		for(i = 0; i < totalVertex; i ++) {
			if(inDegree[i] == 0) q.add(i);
		}
		while(!q.isEmpty()) {
			int u = q.remove(0); //take the first one
			s.add(u);
			for(i = 0; i < outDegree[u]; i ++) {
				int v = adjList[u][i];
				inDegree[v] --; 
				if(inDegree[v] <= 0) {
					q.add(v);
				}
			}
		}
		return s;
	}	
}

public class Main {
	public static void main(String argv[]) {
		Graph2 g = new Graph2();
		g.loadEdgeList();
		LinkedList<Integer> s = g.topSortDFS();
		//LinkedList<Integer> s = g.topSortQueue();
		Iterator<Integer> it = s.iterator();
		while(it.hasNext()) System.out.println(it.next());
	}
}


Measured memory_bytes: 561596
#include <iostream>
#include <numeric>
#include <iomanip>
using namespace std;

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

	long long ret = 0;
	for (long long i = 0; i < n; ++i) {
		long long x, y;
		cin >> x >> y;
		if ((x*x + y * y) <= d * d) {
			++ret;
		}
	}
	cout << ret << endl;

	return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
int main () {
  string S;
  cin >> S;
  if(S.size() % 2 == 1){
    cout << "No" << endl;
    return 0;
  }
  for(int i = 0; i < S.size() / 2; i++){
    if(S.substr(i * 2, 2) != "hi"){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
*this << "[";
for (auto it = d.b; it != d.e; ++it)
*this << ", " + 2 * (it == d.b) << *it;
ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define cool ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int  long long int
#define pb push_back
#define fe first
#define lb lower_bound 
#define ub upper_bound
#define pii pair<pair<int,int>,pair<int,int> >
#define se second
#define endl "\n"
#define pi pair<int, int>
#define mi          map<int,int>
#define mii         map<pi,int>
#define vi vector<int> 
#define vvi vector<vi>
#define bs   binary_search
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rep1(i,a,b) for(int i=a;i<=b;i++)	
#define all(c) (c).begin(),(c).end()
#define sz(x)       (int)x.size() 
#define PI 3.14159265358979323846

 const int N=2e5+5;

 int mod= 1e9+7;
 int dx[4]={0,0,+1,-1};
 int dy[4]={+1,-1,0,0};  
 
 
int po(int a, int b) {
	a %= mod;
	int res = 1;
	while (b > 0) {
		if (b & 1)
			res = (res * a) % mod;
		a =(a*a) % mod;
		b >>= 1;
	}
	 return res;	
   }



	
void solve() {
       
    int x;
    cin>>x;
    int ct=0,val=100;
    
    while(1) {
		   val+=(1*val)/100;
		   ct++;
		   if(val>=x) {
			     cout<<ct<<endl;
			     return;
			   }
		}
   
 }

    
int32_t main() {
	cool;
	int t=1;	

	//cin>>t;
	while(t--)
	  solve();

return 0;	   
}


Measured memory_bytes: 3508
import sys

def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while a % b > 0:
        a, b = b, a % b
    return b

def solve():
    K = int(input())
    ans = 0
    for i in range(1, K + 1):
        for j in range(1, K + 1):
            ab = gcd(i, j)
            for c in range(1, K + 1):
                ans += gcd(ab, c)
    print(ans)

    return 0

if __name__ == "__main__":
    solve()

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

vector<int> G[100];
int d[100];

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

	int m, n;
	cin >> m >> n;
	for(int i = 0; i < n; i++) {
		int a, b;
		cin >> a >> b;
		a--, b--;
		G[a].push_back(b);
		d[b]++;
	}

	queue<int> q;
	for(int i = 0; i < m; i++) {
		if(d[i] == 0) q.push(i);
	}

	vector<int> ans;
	while(q.size()) {
		int k = q.front();
		q.pop();
		ans.push_back(k);
		for(auto v : G[k]) {
			d[v]--;
			if(d[v] == 0) q.push(v);
		}
	}

	for(auto a : ans) {
		cout << a + 1 << endl;
	}
}

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

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

  ll ans=1ll*(n/k)*(n/k)*(n/k);;
  if(k%2==0){
    k/=2;
    ans += 1ll*((n/k+1)/2)*((n/k+1)/2)*((n/k+1)/2);
  }

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//INSERT ABOVE HERE
signed main(){
  Int n,m;
  cin>>n>>m;
  vector<Int> a(m);
  for(Int i=0;i<m;i++) cin>>a[i];

  Int odd=0;
  for(Int i=0;i<m;i++) odd+=a[i]&1;
  if(odd>=3){
    cout<<"Impossible"<<endl;
    return 0;
  }
  //assert(0);

  if(n&1){
    assert(odd==1);
    for(Int i=1;i<m;i++)
      if(a[i]&1) swap(a[0],a[i]);
    assert(a[0]&1);
    for(Int i=0;i<m;i++){
      if(i) cout<<" ";
      cout<<a[i];
    }
    cout<<endl;
    cout<<((a[0]/2)+(m-1)+1)<<endl;
    for(Int i=0;i<a[0]/2;i++) cout<<2<<" ";
    for(Int i=1;i<m;i++) cout<<a[i]<<" ";
    cout<<1<<endl;
    return 0;
  }
  //assert(0);
  
  if(odd==0){
     for(Int i=0;i<m;i++){
      if(i) cout<<" ";
      cout<<a[i];
    }
    cout<<endl;
    cout<<(1+(m-1)+1+(a[m-1]-2>0))<<endl;
    cout<<1<<" ";
    for(Int i=0;i<m-1;i++) cout<<a[i]<<" ";    
    cout<<1;
    if(a[m-1]-2>0) cout<<" "<<a[m-1]-2<<endl;
    else cout<<endl;
    return 0;
  }
  //assert(0);
  
  assert(odd==2);
  if(a[0]%2==0){
    for(Int i=1;i<m;i++)
      if(a[i]&1) swap(a[0],a[i]);
  }
  if(a[m-1]%2==0){
    for(Int i=1;i<m-1;i++)
      if(a[i]&1) swap(a[m-1],a[i]);
  }
  for(Int i=0;i<m;i++){
    if(i) cout<<" ";
    cout<<a[i];
  }
  cout<<endl;
  cout<<((a[0]/2)+1+(m-2)+(a[m-1]/2))<<endl;
  for(Int i=0;i<a[0]/2;i++) cout<<2<<" ";
  cout<<2;
  for(Int i=1;i<m-1;i++) cout<<" "<<a[i];
  for(Int i=0;i<a[m-1]/2;i++) cout<<" "<<2;
  cout<<endl;
  
  return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double PI=acos(-1);
const double EPS=1e-10;

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	int n,k,c;
	cin>>n>>k>>c;
	string s;
	cin>>s;
	vector<int> left,right;
	int ind=0;
	while(ind<n){
		if(s[ind]=='x'){
			ind++;
		}else{
			left.push_back(ind);
			ind=ind+c+1;
		}
	}
	ind=n-1;
	while(ind>=0){
		if(s[ind]=='x'){
			ind--;
		}else{
			right.push_back(ind);
			ind=ind-c-1;
		}
	}
	reverse(begin(right),end(right));
	vector<int> ans;
	rep(i,n){
		if(s[i]=='x') continue;
		int cnt=0;
		auto itr1=lower_bound(begin(left),end(left),i);
		auto itr2=upper_bound(begin(right),end(right),i);
		cnt+=itr1-begin(left);
		cnt+=end(right)-itr2;
		if(itr1==begin(left)){
			if(cnt<k){
				ans.push_back(i+1);
			}
			continue;
		}
		itr1--;
		if(itr2!=end(right)){
			int diff=*itr2-*itr1;
			if(diff<=c) cnt--;
		}
		if(cnt<k){
			ans.push_back(i+1);
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 4236
import heapq
n, m = map(int, input().split())
byte = [[] for _ in range(100001)]

for _ in range(n):
    a, b = map(int, input().split())
    byte[a].append(b)
search = []
day = 1
ans = 0
while day-1 != m:
    for b in byte[day]:
        heapq.heappush(search, -b)
    if not search:
        day += 1
        continue
    tmp = -heapq.heappop(search)
    ans += tmp
    day += 1

print(ans)





Measured memory_bytes: 24044
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(int i=0;i<n;++i)
#define REPR(i,n) for(int i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(int i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define INF 999999999
#define SUR 1000000007
#define pb(a) push_back(a)
#define pf(a) push_front(a)
#define MP make_pair

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

using namespace std;

typedef pair<int,int> pii;

int main(){

  string s;
  cin >> s;

  int ans = 0;

  REP(i,3){
    if(s[i] == '1'){
      ans++;
    }
  }

 cout << ans << "\n";
  return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <vector>
#include <list>

using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	if (n == m) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
 #include<algorithm>
 using namespace std;
 int main()
 {
 char s[10];
 scanf("%s", s);
 sort(s, s + 4);
 printf((s[0] == s[1] && s[1] != s[2] && s[2] == s[3]) ? "Yes\n" : "No\n");
 }

Measured memory_bytes: 128
N, M, Q = gets.chomp.split.map(&:to_i)
qArr = Q.times.map { gets.chomp.split.map(&:to_i) }

ans = 0

mArr = [*1..M]
mArr.repeated_combination(N) do |a|
    score = 0
    for i in 0..(Q-1) do
        score += qArr[i][3] if a[qArr[i][1] - 1] - a[qArr[i][0] - 1] == qArr[i][2]
    end
    # puts score
    ans = score if score > ans
end

puts ans

Measured memory_bytes: 14360
#include<bits/stdc++.h>
using namespace std;
using ll  = long long;
using vl  = vector<ll>;
using vi  = vector<int>;
#define _GLIBCXX_DEBUG
#define IO_STREAM cin.tie(0);ios::sync_with_stdio(false)
#define all(x) x.begin(),x.end()
#define rep(i,sta,end) for(int i=sta;i<end;++i)
#define lcm(a,b) (a)/__gcd((a),(b))*(b)
#define pb push_back
const ll INF = 1000000000000000;
const ll MOD = 1000000007;
const double PI = acos(-1);
//||
#define DBG(a,b,c,d) //cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<endl
//DBG("","","","");

signed main(){
	IO_STREAM;
	int N;
	cin>>N;
	string S;
	cin>>S;
	ll ans=0;
	rep(i,0,N-2){
		if(S.substr(i,3)=="ABC") ans++;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 3596
#include<iostream>
using namespace std;
int num[3] = { 1,2,3 };
int main()
{
	int a = 0, b = 0;
	cin >> a >> b;
	for (int i = 0; i < 3; i++)
	{
		if (num[i] == a || num[i] == b)
		{
			continue;
		}
		cout << num[i];
	}
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.IO;

class Program
{
    static void Main(string[] args)
    {
        int N = int.Parse(Console.ReadLine());
        int[] A = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        Console.WriteLine(A.Count(a => a % 2 != 0) % 2 == 0 ? "YES" : "NO");
    }
}


Measured memory_bytes: 12120
#include <iostream>
using namespace std;
int main(void){
    int a,b,c;
    cin >> a >> b >> c;
    
    if(a==b)
        printf("%d",c);
    else if(b==c)
        printf("%d",a);
    else if(c==a)
        printf("%d",b);
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

    int m = s.size(), n = t.size();

    int current = 0, best = 0;
    for (int i = 0; i < m - n + 1; i++) {
        current = 0;
        for (int j = 0; j < n; j++) {
            if (s[i + j] == t[j]) {
                current++;
            }
        }
        best = max(best, current);
    }
    cout << n - best << endl;

    return 0;
}


Measured memory_bytes: 3596
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

using namespace std;

const long long int MOD = 1000000007;

int main() {
  long long int H, W, K;
  cin >> H >> W >> K;
  
  vector<long long int> ways(W);
  ways[0] = 1;
  for (int i = 1; i < W; i++) {
    if (i == 1) {
      ways[i] = 2;
    } else {
      ways[i] = (ways[i - 1] + ways[i - 2]) % MOD;
    }
  }
  
  vector<vector< long long int> > grid(H + 1, vector<long long int>(W));
  
  grid[0][0] = 1;
  long long int temp;
  for (int i = 1; i <= H; i++) {
    for (int j = 0; j < W; j++) {
      temp = 1;
      if (j > 0) {
        temp = (temp * ways[j - 1]) % MOD;
      }
      if (j < W - 1) {
        temp = (temp * ways[W - j - 2]) % MOD;
      }
      grid[i][j] = (grid[i][j] + grid[i - 1][j] * temp) % MOD;
      
      if (j > 0) {
        temp = 1;
        if (j > 1) {
          temp = (temp * ways[j - 2]) % MOD;
        }
        if (j < W - 1) {
          temp = (temp * ways[W -j - 2]) % MOD;
        }
        grid[i][j] = (grid[i][j] + grid[i - 1][j - 1] * temp) % MOD;
      }
      
      if (j < W - 1) {
        temp = 1;
        if (j < W - 2) {
          temp = (temp * ways[W - j - 3]) % MOD;
        }
        if (j > 0) {
          temp = (temp * ways[j - 1]) % MOD;
        }
        grid[i][j] = (grid[i][j] + grid[i - 1][j + 1] * temp) % MOD;
      }
    }
  }
  
  cout << grid[H][K - 1] << endl;

  return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int f[110][10][5],a[20];
int p[110][20],ans=-0x7fffffff,n;
void dfs(int k){
	if(k>10){
		int sum=0;
		for(int i=1;i<=10;i++){
		//	cout<<a[i];
			sum+=a[i];
		}
		//cout<<endl;
		if(sum==0)return;
		int t[110]={0},ss=0;
		for(int i=1;i<=n;i++)
			for(int j=1;j<=5;j++)
				for(int k=1;k<=2;k++)
					if(f[i][j][k]==1 && a[(j-1)*2+k]==1)
						t[i]++;
		for(int i=1;i<=n;i++)
			ss+=p[i][t[i]];
		ans=max(ans,ss);
		return;
	}
	dfs(k+1);
	a[k]=1;
	dfs(k+1);
	a[k]=0;
}
int main(){
	cin>>n;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=5;j++)
			for(int k=1;k<=2;k++)
				scanf("%d",&f[i][j][k]);
	for(int i=1;i<=n;i++)
		for(int j=0;j<=10;j++)
			scanf("%d",&p[i][j]);
	dfs(1);
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
'''
問題：
    すぬけ君の管理する研究室の扉にはロックがかかっており、解錠にはセキュリティコードを入力する必要があります。

    セキュリティコードは 4 桁の数字列です。
    セキュリティコードが「入力しづらい」とは、同じ数字が連続する箇所が存在することを言います。

    現在のセキュリティコード S が与えられます。
    S が「入力しづらい」なら Bad を、そうでなければ Good を出力してください。
'''

'''
制約：
    S は半角数字のみからなる長さ 4 の文字列
'''

def abc131a(s: str) -> str:
    if s[0] == s[1]:
        return 'Bad'
    elif s[1] == s[2]:
        return 'Bad'
    elif s[2] == s[3]:
        return 'Bad'
    else:
        return 'Good'

s = str(input())
print(abc131a(s))


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

int main(){
    string S;
    cin >> S;
    cout << S.at(0) <<S.at(1) << S.at(2) <<endl;
}


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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define vec vector
#define ll long long
#define pb push_back

int n;
vec<vec<int>> win;
vec<int> score;

void solve(int node)
{
	vec<int> keep(win[node].size());
	rep(i, win[node].size()) {
		if (score[win[node][i]] == - 1) solve(win[node][i]);
		keep[i] = score[win[node][i]];
	}
	sort(keep.begin(), keep.end());
	reverse(keep.begin(), keep.end());
	int ans = 0;
	rep(i, keep.size()) {
		ans = max(ans, keep[i] + i + 1);
	}
	score[node] = ans;
}	


int main(void)
{
	cin >> n;
	win.resize(n);
	score.resize(n);
	rep(i, n) score[i] = - 1;
	rep(i, n - 1) {
		int get;
		cin >> get;
		get--;
		win[get].pb(i + 1);
	}

	solve(0);
	cout << score[0] << endl;
	return 0;
}


Measured memory_bytes: 15488
// Undone
#include <bits/stdc++.h>
#define int long long
#define double long double
#define INF 1e18
#define MOD 1000000007
using namespace std;
signed main() {
  int N, M, P;
  while (cin>>N>>M>>P, N+M+P) {
    int sum = 0, cnt;
    for (int i = 0; i < N; i++) {
      int x; cin >> x;
      sum += x;
      if (i + 1 == M) cnt = x;
    }
    int ans = (cnt == 0) ? 0 : (((100-P)/100.)*sum*100.)/cnt;
    cout << ans << endl;
  }
}




Measured memory_bytes: 2984
let cost = Array.get [| 2; 5; 5; 4; 5; 6; 3; 7; 6 |]

let () = Scanf.scanf "%d %d" @@ fun n m ->
  let as_ = Array.init m @@ fun m -> Scanf.scanf "%c%d" @@ fun _ a -> a in
  let dp = Array.make (n + 10) (-1, []) in
  dp.(0) <- (0, []);
  for i = 0 to n - 1 do
    Array.iter (fun a ->
      if 0 <= fst dp.(i) then
        dp.(i + cost (a - 1)) <-
          max dp.(i + cost (a - 1)) @@ (fst dp.(i) + 1, a :: snd dp.(i))) as_
  done;
  List.iter print_int (snd dp.(n));
  print_newline ()


Measured memory_bytes: 5120
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

int main(){
    int n;
    scanf("%d",&n);
    while(n!=0){
        vector<int> s;
        int sum=0;
        REPR(i,n-1){
            int sn;
            scanf("%d",&sn);
            s.push_back(sn);
        }
        sort(s.begin(),s.end());
        FOR(i,1,s.size()-1){
            sum=sum+s[i];
        }
        int ave=sum/(n-2);
        printf("%d\n",ave);
        scanf("%d",&n);
    }
    return 0;
}


Measured memory_bytes: 3132
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,d,x,a,c=0;
  cin>>n>>d>>x;
  for(int i=0;i<n;i++){
    cin>>a;
    for(int j=0;j*a+1<=d;j++){
      c++;
    }
  }
  cout<<c+x;
}

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

int main() {
    ll H, N;
    cin >> H >> N;
    vector<ll> A(N);
    ll sum = 0;
    rep(i, N) {
        cin >> A[i];
        sum += A[i];
    }

    if (sum >= H) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 1024
#include <stdio.h>
int main(void){
    // Your code here!
    int num1,num2,num3;
    
    scanf("%d%d%d",&num1,&num2,&num3);
    
    if(num1+num2+num3 == 17){
        printf("YES\n");
    }
    else{
        printf("NO\n");
    }
}


Measured memory_bytes: 128
#include <cstdio>

using namespace std;

int main() {
    int x, sum = 0, i;
    
    scanf("%d", &x);
    
    for (i = 1; ; i++) {
        sum += x;
        if (sum % 360 == 0) break;
    }
    
    printf("%d\n", i);
    
    return 0;
}


Measured memory_bytes: 1728
s=[input() for _ in range(2)]
a_len=len(s[0])
b_len=len(s[1])
if s[0]==s[1]:
    print("EQUAL")
elif a_len>b_len:
    print("GREATER")
elif a_len<b_len:
    print("LESS")
else:
    t=sorted(s)
    if s[0]==t[0]:
        print("LESS")
    else:
        print("GREATER")

Measured memory_bytes: 3064
M,z,s=998244353,1,0
N,*A=map(int,open(0))
d=[1]+[0]*7**6
e=[1]+[0]*7**6
for a in A:
 i=s;s+=a;z*=3
 while~i:d[i+a]+=d[i]%M;d[i]*=2;e[i+a]+=e[i]%M;i-=1
i=s
while i*2>=s:z=(z-d[i]*3)%M;i-=1
print((z+~s%2*e[s//2]*3)%M)

Measured memory_bytes: 142156
#include<iostream>
#include<string>
using namespace std;
#define MAXS 1000

int DP[MAXS+1][MAXS+1];

int main(){
    string s1,s2;cin>>s1>>s2;
    int a=s1.size(),b=s2.size();
    for(int i=0;i<=a;i++){
        DP[i][0]=i;
    }
    for(int j=0;j<=b;j++){
        DP[0][j]=j;
    }
    for(int i=1;i<=a;i++){
        for(int j=1;j<=b;j++){
            DP[i][j]=0;
        }
    }
    for(int i=0;i<a;i++){
        for(int j=0;j<b;j++){
            DP[i+1][j+1]=min(DP[i+1][j],DP[i][j+1])+1;
            DP[i+1][j+1]=min(DP[i+1][j+1],DP[i][j]+(s1[i]==s2[j]?0:1));
        }
    }
    cout<<DP[a][b]<<endl;
    return 0;
}



Measured memory_bytes: 7128
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef pair<int, int> ii;

const int N = 2e5+100, INF = 1e9;

int dp[N][2];

signed main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	string s;cin >> s;
	int n = s.size();
	for(int i=0 ; i<=n+10 ; i++)
		dp[i][0] = dp[i][1] = -INF;

	for(int i=n-1 ; i>=0 ; i--){
		// 2
		int cur = max(0, dp[i+2][0]);
		if(i >= n-3 || s[i] != s[i+2] || s[i+1] != s[i+3])
			cur = max(cur, max(0, dp[i+2][1]));
		if(i < n-1)
			dp[i][1] = cur + 1;
		// 1
		cur = max(0, dp[i+1][1]);
		if(i >= n-1 || s[i] != s[i+1])
			cur = max(cur, dp[i+1][0]);
		dp[i][0] = cur + 1;
	}

	cout << max(dp[0][0], dp[0][1]) << "\n";
 	return 0;
}
















Measured memory_bytes: 2196
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = 1000000007;
ll INFL = 1ll << 60;
ll INF = 1 << 30;

int main() {
  ll a, b, c;
  cin >> a >> b >> c;
  for (int i = 0; i < 100000; i++) {
    if (c % a == 0) {
      cout << "YES" << endl;
      return 0;
    }
    c += b;
  }
  cout << "NO" << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <limits.h>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <string>
#define ll long long
#define ull unsigned long long
#define ms(a) memset(a,0,sizeof(a))
#define pi acos(-1.0)
#define INF 0x7f7f7f7f
#define lson o<<1
#define rson o<<1|1
const double E=exp(1);
const int maxn=1e6+10;
const int mod=1e9+7;
using namespace std;
int vis[maxn];
int a[maxn];
int b[maxn];
int _;
bool init(int n)
{
	int res=0;
	if(n)
	{
		while(n)
		{
			b[res++]=n%10;
			n/=10;
		}
	}
	else
	{
		b[0]=0;
		res++;
	}
	for(int i=0;i<res;i++)
		for(int j=0;j<_;j++)
			if(b[i]==a[j])
				return false;
	return true;
}
int main(int argc, char const *argv[])
{
	ios::sync_with_stdio(false);
	int n,k;
	cin>>n>>k;
	int x;
	for(int i=0;i<k;i++)
	{
		cin>>x;
		vis[x]=1;
	}
	_=0;
	for(int i=0;i<10;i++)
	{
		if(vis[i])
			a[_++]=i;
	}
	for(int i=n;;i++)
	{
		if(init(i))
		{
			cout<<i<<endl;
			return 0;
		}
	}
	return 0;
}

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

using namespace std;

#define u64             uint64_t
#define i64             int64_t
#define mod             1000000007
#define inf             1e18
//mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(10);
    cout << fixed;
    /**************************/
    
    int n;
    cin >> n;
    
    int ans;

    if(n % 1000 == 0)
    {
        n = 0;
    }
    while(n > 0)
    {
        n -= 1000;
    }
    cout << abs(n) << endl;

    /**************************/
    cerr << endl << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    return 0;
}


Measured memory_bytes: 3780
#include<iostream>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<vector>
#include<array>
#include<string>
#include<stack>
#include<queue>
#include<algorithm>
#include<cassert>
#include<functional>
#include<random>
#include<complex>
#include<bitset>
#include<chrono>
#include<boost/multiprecision/cpp_int.hpp>
#define int int64_t
#define uint uint64_t
#define REP(i, a, b) for (int64_t i = (int64_t)(a); i < (int64_t)(b); i++)
#define rep(i, a) REP(i, 0, a)
#define EACH(i, a) for (auto i: a)
#define ITR(x, a) for (auto x = a.begin(); x != a.end(); x++)
#define ALL(a) (a.begin()), (a.end())
#define HAS(a, x) (a.find(x) != a.end())
#define Min(x) *min_element(ALL(x))
#define Max(x) *max_element(ALL(x))
#define Unique(L) (L.erase(unique(ALL(L)), L.end()))
#define veccat(v1, v2) std::copy((v2).begin(),(v2).end(),std::back_inserter(v1)/*v1の後ろにv2を入れる*/)
#define intmax (std::numeric_limits<int64_t>::max() / 4)
using namespace std;
typedef boost::multiprecision::cpp_int bigint;
const double EPS = 1e-9;
const double PI = acos(-1.0);


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

	int N, K;
	cin >> N >> K;
	vector<int>A(N);
	rep(i, N)cin >> A[i];

	int ipos = 0;
	rep(i, N)if (A[i] == 1)ipos = i;

	int ans = 0;
	int L;
	for (L = ipos; L > 0; L -= K - 1)ans++;
	for (int R = N - ipos - 1 + L; R > 0; R -= K - 1) {
		ans++;
	}
	cout << ans << endl;


	return 0;
}



Measured memory_bytes: 1024
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<deque>
using namespace std;
const int N=2e5+5;
struct node{
    int u,v,nxt;
}edge[N];
int head[N],mcnt;
void add_edge(int u,int v){
    mcnt++;
    edge[mcnt].u=u;
    edge[mcnt].v=v;
    edge[mcnt].nxt=head[u];
    head[u]=mcnt;
}
bool vis[N];
int check(int u){
    for(int i=head[u];i;i=edge[i].nxt){
        int v=edge[i].v;
        if(!vis[v])
            return v;
    }
    return -1;
}
int n,m;
deque<int>q;
int main()
{
    scanf("%d%d",&n,&m);
    int u,v;
    for(int i=1;i<=m;i++){
        scanf("%d%d",&u,&v);
        add_edge(u,v);
        add_edge(v,u);
    }
    q.push_back(u);
    q.push_back(v);
    vis[u]=1;
    vis[v]=1;
    while(1){
        u=check(q.front());
        if(u==-1)
            break;
        vis[u]=1;
        q.push_front(u);
    }
    while(1){
        v=check(q.back());
        if(v==-1)
            break;
        vis[v]=1;
        q.push_back(v);
    }
    printf("%d\n",q.size());
    while(!q.empty()){
        printf("%d ",q.front());
        q.pop_front();
    }
}


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

using namespace std;

int main() {

	int n;
	cin >> n;
	long long res = 1;
	double res2 = 1;
	long long a;
	double b;
	for (int i = 0; i < n; i++) {
		cin >> a;
		b = a;
		res *= a;
		res2 *= b;
	}

	cout << ((res2 > pow(10,18) || res>1000000000000000000) ? -1 : res) << endl;

}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
#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 each(a,x) for(auto a : (x))
#define all(a) (a).begin(),(a).end()
#define chmin(a,b) ((a) = min((a),(b)))
#define chmax(a,b) ((a) = max((a),(b)))
#define in_range(x,l,r) ((l)<=(x) && (x)<(r))
#define printvec(a) rep(i,a) cout << a[i] << " \n"[i+1==(a).size()];
#define fs first
#define sc second
#define em emplace
#define eb emplace_back
#define sz size()
#define MP make_pair
using namespace std;
typedef long long ll;
typedef double D;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<pll> vp;

const ll INF = 1e8;
const D EPS = 1e-8;
const ll MOD = 1e9+7;

int main(){
  ll n;
  cin >> n;
  vl a(n+1,0), partial_max(n+1,0), ans(n);
  map<ll,ll> cnt;
  rep(i,n){
    cin >> a[i+1];
    partial_max[i+1] = max(partial_max[i], a[i+1]);
  }

  rrep(i,n){
    cnt[-a[i+1]]++;
    if(partial_max[i] != partial_max[i+1]){
      while(-cnt.begin()->fs > partial_max[i]){
	pll tmp = *cnt.begin();
	ans[i] += tmp.sc * (-tmp.fs - partial_max[i]);
	cnt.erase(tmp.fs);
	cnt[-partial_max[i]] += tmp.sc;
      }
    }
  }

  rep(i,n) cout << ans[i] << endl;
}


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

int main() {
	int N;
	long A, B, X[100010], ans=0;
	cin >> N >> A >> B;
	for(int i=0; i<N; ++i){
	    cin >> X[i];
	    if(i>0) ans += min(B, A*(X[i]-X[i-1]));
	}
	cout << ans << endl;
	return 0;
}


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

int main()
{
	int h, w;
	cin >> h >> w;
	vector<vector<int>> ret(h, vector<int>(w,0));
	vector<string> mat(h);
	
	for (int i = 0; i < h; ++i) {
		cin >> mat[i];
		for (int j = 0; j < w; ++j) {
			if (mat[i][j] == '.') {
				ret[i][j] = 1;
			}
		}
	}

	for (int i = 0; i < h; ++i) {
		for (int j = 1; j < w-1; ++j) {
			if (mat[i][j] == '#') {
				if (mat[i][j - 1] == '#') {
					ret[i][j] = 1;
					ret[i][j - 1] = 1;
				}
				if (mat[i][j + 1] == '#') {
					ret[i][j] = 1;
					ret[i][j + 1] = 1;
				}
			}
		}
	}

	for (int j = 0; j < w; ++j) {
		for (int i = 1; i < h - 1; ++i) {
			if (mat[i][j] == '#') {
				if (mat[i-1][j] == '#') {
					ret[i][j] = 1;
					ret[i-1][j] = 1;
				}
				if (mat[i+1][j] == '#') {
					ret[i][j] = 1;
					ret[i+1][j] = 1;
				}
			}
		}
	}

	bool isOk = true;
	for (int i = 0; i < h; ++i) {
		for (int j = 0; j < w; ++j) {
			if (ret[i][j] == 0) {
				isOk = false;
			}
		}
	}

	if (isOk) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <unordered_map>
#define REP(i, START, n, STEP) for(int i = START; i < (n); i += (STEP))
#define rep(i, n) REP(i, 0, n, 1)
using namespace std;

typedef long long int ll;
typedef pair<int, int> P;

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

	vector<P> a(n);

	rep(i, n) {
		cin >> a[i].first;
		a[i].second = i + 1;
	}
	sort(a.begin(), a.end());
	rep(i, n) {
		cout << a[i].second << " ";
	}

	return 0;
}


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


typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;

#define pb push_back
#define popb pop_back
#define si size()
#define be begin()
#define en end()
#define le length()
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second

#define forz(i,n) for( int i=0;i<n;i++)
#define forl(i, n) for(int i = 0; i<= n; i++)
#define deci(n)  fixed<<setprecision(n)
#define high(n) __builtin_popcount(n)
#define parity(n) __builtin_parity(n)
#define ctz(n)  __builtin_ctz(n)
// #define mod 1000000007
#define mod2 998244353
#define kira ios::sync_with_stdio(0), cin.tie(0),cout.tie(0)

using namespace std;

void cpc()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w" , stdout);
#endif
}
lli power(lli x, lli y)
{
	lli res = 1;     // Initialize result
	// lli p = mod;
	x = x ; // Update x if it is more than or
	// equal to p

	if (x == 0) return 0; // In case x is divisible by p;

	while (y > 0)
	{
		// If y is odd, multiply x with result
		if (y & 1)
			res = (res * x);

		// y must be even now
		y = y >> 1; // y = y/2
		x = (x * x);
	}
	return res;
}

// lli mod(lli x)
// {
// 	if (x < 0)
// 		x = -x;
// 	return x;
// }



int main()
{
	
	// kira;
	// lli n;d
	string s;
	cin >> s;
	if (s == "ARC")
	{
		cout << "ABC" << endl;
	}
	else
	{
		cout << "ARC" << endl;
	}
	return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define fi first
#define se second
#define For(i, a, b) for (int i = (a); i <= (b); ++i)
#define Ford(i, a, b) for (int i = (a); i >= (b); --i)
#define endl '\n'
#define debug(a) cout << a << endl
using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;

const ll maxN = 1e18;
const ll minN = -1e18;
const ll MOD = 1e9 + 7;

const ll limit = 2e5 + 5;
const ll limit1 = 1e6 + 5;
const ll limit2 = 1e3 + 5;
const ll limit3 = 1e4 + 5;

ll test;
ll n, k, x;
string s;
ll res = 0, sum = 0, ans = 0, kd, hkd;
bool ok = false;
ll dp[limit3];

void FastIn(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
}

void ReadIn(){
    cin >> n >> k;
    For(i, 1, k){
        cin >> x;
        For(j, 1, x){
            cin >> kd;
            dp[kd]++;
        }
    }
    For(i, 1, n){
        if(dp[i] == 0) res++;
    }
    cout << res;
}
int main(){
    FastIn();
    ReadIn();
}
/*
* Ctrl + Shift + K Delete Line
* Ctrl + / TOGGLE LINE COMMENT
Ctrl + F Find
* Ctrl + H  REPLACE
* shift + alt + f FORMAT CODE DOCUMENT
Shift + alt + uparrow/downarrow Copy line up/down
Ctrl + ]/[ INDENT/OUTDENT LINE
Quy Hoạch Động
2 kiểu
+ Đếm cách
+ Dùng ít nhất
*/


Measured memory_bytes: 3648
N, M, K = map(int, input().split(' '))
A_ls = [0] + list(map(int, input().split(' ')))
for i in range(N):
    A_ls[i + 1] += A_ls[i]
B_ls = [0] + list(map(int, input().split(' ')))
for i in range(M):
    B_ls[i + 1] += B_ls[i]
b_cnt, rst = M, 0 
for a_cnt in range(N + 1):
    if A_ls[a_cnt] > K:
        break
    while A_ls[a_cnt] + B_ls[b_cnt] > K and b_cnt >= 0:
        b_cnt -= 1
    rst = max(rst, a_cnt + b_cnt)
print(rst)

Measured memory_bytes: 45192
#include<bits/stdc++.h>
using namespace std;
#define int long long
constexpr int mu = 1e9;
signed main(){
    int a[200000],n,k;
    cin>>n>>k;
    for(int i=0;i<n;i++) cin>>a[i];
    sort(a,a+n);
    int lb = -(mu*mu) ,ub =mu*mu;// 二分区间范围。
    while(ub - lb>1){
        int mid = (lb+ub)/2,cnt=0;//cnt 用来统计对的数量。
        for(int i=0;i<n;i++){
            if(a[i] < 0){
                cnt +=n- (lower_bound(a,a+n,(long double )mid/a[i])-a);
            }
            else if( a[i] >0){
                cnt += upper_bound(a,a+n,(long double)mid/a[i])-a;
            }
            else if( mid >= 0){
                // a[i]为0 且 任意值x >=0的话就有n对。
                cnt+=n;
            }
            // 去掉本身重复的。
            if( a[i] * a[i] <= mid) cnt--;
        }

        //判定条件，注意cnt是对数;
        (cnt>=2*k?ub:lb) = mid;
    }
    cout<<ub<<endl;
}

Measured memory_bytes: 5128
s=input()

if s[0]!="A":
  ans="WA"
else:
  c_cnt=s.count("C",2,len(s)-1)
  cnt=s.count("C")
  if c_cnt!=1 or c_cnt!=cnt:
    ans="WA"
  else:
    s=s.replace("C","c")
    if s[1:].islower():
      ans="AC"
    else:
      ans="WA"
    
print(ans)

Measured memory_bytes: 9048
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip> // setprecision
#include <complex> // complex
#include <math.h> 
#define enld '\n'
using namespace std;
using ll = long long;
using P = pair<int,int>;
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const int dx[8] = {1, 0, -1, 0,1,1,-1,-1};
const int dy[8] = {0, 1, 0, -1,1,-1,1,-1};
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; }
// ---------------------------------------------------------------------------


int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  while(1){
    int N,M;
    cin >> N >> M;
    if(N == 0 && M == 0) break;
    vector<vector<P>> G(M);
    int r;
    cin >> r;
    vector<int> t(r),n(r),m(r),s(r);
    for(int i=0; i<r; i++){
      cin >> t[i] >> n[i] >> m[i] >> s[i];
      m[i]--;
    }
    for(int i=0; i<r; i++){
      if(s[i] == 1){
        for(int j=i+1; j<r; j++){
          if(n[i]==n[j] && m[i]==m[j] && s[j]==0){
            G[m[i]].emplace_back(P(t[i],t[j]-1));
            break;
          }
        }
      }
    }
    int Q;
    cin >> Q;
    for(int i=0; i<Q; i++){
      int ts,te,m;
      cin >> ts >> te >> m;
      m--;
      int ans = 0;
      for(int j=ts; j<te; j++){
        for(int k=0; k<G[m].size(); k++){
          if(G[m][k].first <= j && j<=G[m][k].second){
            ans++;
            break;
          }
        }
      }
      cout << ans << "\n";
    }
  }
  return 0;
}


Measured memory_bytes: 3428
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;

int main(){
    int N;
    cin >> N;
    char S[N+1], c;
    int K;
    scanf("%s", S);
    cin >> K;
    c = S[K-1];
    for(int i = 0; i < N;i++){
        if(S[i] == c) cout << c;
        else cout << '*';
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int[] l = new int[200001];
        int N = sc.nextInt();
        int K = sc.nextInt();
        int ans = 0;
        for(int i = 0;i < N;i++)    l[sc.nextInt()]++;
        Arrays.sort(l);
        for(int i = 0;i < 200001-K;i++)   ans += l[i];
        System.out.println(ans);
    }
}

Measured memory_bytes: 66148
#include<stdio.h>
int main()
{
    int n, i,sum, t , min, m;
    min=99999;
    scanf("%d %d",&n, &sum);
    t=n;
    while(n--)
    {
        scanf("%d",&m);
        if(m<min) min=m;
        sum-=m;
    }
    t+=sum/min;
    printf("%d\n",t);
}


Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>
#include <cmath>
static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

const auto pi = acos(-1);

int main() {
    double a, b, x;
    cin >> a >> b >> x;
    double ok = 0, ng = 90;
    for (int i = 0; i < 100; ++i) {
        auto mid = (ok+ng)/2, m = (mid)/180*pi;
        if(a*sin(m) <= b*sin((90-mid)/180*pi)){
            (x <= a*a*a*tan(m)/2+(b*cos(m)-a*sin(m))*a*a/cos(m) ? ok : ng) = mid;
        }else {
            (x <= a*b*b/2/tan(m) ? ok : ng) = mid;
        }
    }
    printf("%.10lf\n", ok);
    return 0;
}

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

int main(){
    int a,b,c,d,e,f;
    cin>>a>>b>>c>>d>>e>>f;
    set<int>water;
    set<int>sugar;
    for(int i=0;100*i<=f;i++){
        for(int j=0;100*j<=f;j++){
            water.insert(100*a*i+100*b*j);
        }
    }
    for(int i=0;c*i<=f;i++){
        for(int j=0;d*j<=f;j++){
            sugar.insert(i*c+j*d);
        }
    }
    double ans=-2000000.0,tmp;
    int  wans,sans;
    for(auto  watersum : water){
        for(auto sugarsum : sugar){
            int sum=watersum+sugarsum;
            int sugarmax=watersum*e/100;
            if(sum>f||sum==0||sugarmax<sugarsum)continue;
            else{
                tmp=(double(100*sugarsum)/double(sum));
                if(tmp>ans){
                    ans=tmp;
                    wans=sum;
                    sans=sugarsum;
                }
            }
        }
    }
    cout<<wans<<" "<<sans<<endl;
    return 0;

}

Measured memory_bytes: 3900
// Author: pankaj_m05 
// Problem: B
//Created: 17.05.2020 17:34:43

#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define f_in(file) freopen(file, "r", stdin)
#define f_out(file) freopen(file, "w", stdout)
#define sz(a) int((a).size())
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(c) c.begin(), c.end()
#define tr(c,i) for(typeof(c).begin() i = c.begin(); i != c.end(); i++)
#define present(c,x) (c.find(x) != c.end())  // Set and Maps
#define cpresent(c,x) (find(allc,x) != c.end()) // Vectors
using namespace std;

typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair< int, int > ii;
typedef long long ll;

const int mod = 1e9 + 7;

int main(void) { 
	fast
	int k;
	string s;
	cin >> k >> s;
	int len = s.length();
	if(len <= k) 
		cout << s << '\n';
	else {
		for(int i = 0; i < k; ++i)
			cout << s[i];
		cout << "..." << '\n';
	}
	return 0;
}                                          

Measured memory_bytes: 3652