akhauriyash/Code-Regression huggingface dataset:
#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 n; cin >> n;
	vector<double> a(n);
	double ans = 0.0;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		ans += (1 / a[i]);
	}

	cout << setprecision(20) << 1 / ans << endl;

	return 0;
}

Measured memory_bytes: 256
//~#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags
//~#pragma GCC option("arch=native","tune=native","no-zero-upper") //Enable AVX
//~#pragma GCC target("avx2")  //Enable AVX
#include<bits/stdc++.h>
using namespace std;

#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define ll long long
#define vi vector<int>
#define pi pair<int,int>
#define mp make_pair
 
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif
 
const int mod=1e9+7;
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
int mul(int a,int b)
{
	return ((a)*1ll*(b))%mod;
}
 
void add(int &a,int b)
{
	a+=b;
	if(a>=mod)a-=mod;
}
 
int sub(int a,int b){
	a-=b;
	if(a<0){
		a+=mod;
	}
	return a;
}
 
int powz(int a,int b)
{
	int res=1;
	while(b)
	{
		if(b&1){
			res=mul(res,a);
		}
		b/=2;
		a=mul(a,a);
	}
	return res;
}
 
template <typename A, typename B>
istream& operator>>(istream& input,pair<A,B>& x) {
	input>>x.F>>x.S;
	return input;
}
 
template <typename A>
istream& operator>>(istream& input,vector<A>& x) {
	for(auto& i:x)
		input>>i;
	return input;
}
 
template<typename A>
ostream& operator<<(ostream& output,vector<A>& x) {
	for(auto& i:x)
		output<<i<<' ';
	return output;
}
 
const int N=1000002;

void solve(){
	int n;
	cin>>n;
	vi a(n);
	cin>>a;
	sort(all(a));
	a.resize(unique(all(a))-a.begin());
	if(a.size()==n){
		cout<<"YES";
	}
	else{
		cout<<"NO";
	}
}
 
signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int tc=1;
	//~cin>>tc;
	for(int _=0;_<tc;_++){
		//~ cout<<"Case #"<<_+1<<": ";
		solve();
		if(_!=tc-1)
		cout<<"\n";
	}
}


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

 int stack[N];
 int n=0;

 int push(int x){
         n++;
         stack[n]=x;
 }

 int pop(){
   int a;
   a=stack[n];
   n--;

   return a;

 }

 int main(){
  int c;
  int x, a, b;

        while ((c=getchar())!=EOF){
                 if (isdigit(c)){
                         ungetc(c, stdin);
                         scanf("%d", &x);
                         push(x);
                 }
                 else {
                         switch(c) {
                         case '+':
                                 b=pop();
                                 a=pop();
                                 push(a+b);
                                 break;
                         case '-':
                                 b=pop();
                                 a=pop();
                                 push(a-b);
                                 break;
                         case '*':
                                 b=pop();
                                 a=pop();
                                 push(a*b);
                                 break;
                         case '/':
                                 b=pop();
                                 a=pop();
                                 push(a/b);
                                 break;
                         case '\n':
                                         printf("%d\n", pop());
                                         return 0;
                                 exit(1);

                         case ' ':
                                 break;

                         default:
                                 n=0;
                                 break;
                         }
           }
     }
     return 0;
}



Measured memory_bytes: 2068
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <iterator>
#include <cmath>
#include <map>
using namespace std;


void func162b() {
  int n;
  long long ans = 0;
  cin >> n;
  for(int i = 1; i <= n; i++){
    if (i % 15 == 0) continue;
    if (i % 3 == 0) continue;
    if(i % 5 == 0) continue;
    ans += i;
  }
  cout << ans << "\n";
}


int main(void) {
  func162b();
  return 0;
}

Measured memory_bytes: 3632
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <queue>

using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<n;++i)
#define mod (ll)(1e9+7)
#define FIX(a) ((a)%mod+mod)%mod
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define fi first
#define se second
#define pb push_back
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
vvll combi(51,vll(51,1));
void combination(){
    combi[1][0]=1;
    combi[1][1]=1;
    for(int n=2;n<=50;n++){
        combi[n][0]=1;
        for(int k=1;k<=n-1;k++){
            combi[n][k]=combi[n-1][k]+combi[n-1][k-1];
        }
        combi[n][n]=1;
    }
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,a,b;
    cin >> n >> a >> b;
    vll v(n);
    REP(i,n){
        cin >> v[i];
    }
    sort(ALL(v));
    vll rs(n);
    REP(i,n){
        rs[i]=v[i];
    }
    rs.erase(unique(rs.begin(),rs.end()),rs.end());
    vll id((int)rs.size(),0);
    REP(i,n){
        id[lower_bound(rs.begin(),rs.end(),v[i])-rs.begin()]+=1LL;
    }
    ll bunbo = 1;
    ll bunsi = 0;
    ll num = 0;
    int rss = (int)rs.size();
    combination();
    for(int i=a;i<=b;i++){
        ll value = 0;
        ll rem = i;
        for(int j=rss-1;j>=0;j--){
            /*if(id[j]<rem&&j==0){
                value+=(ll)id[j]*rs[j];
                double tmp = (double)value/(double)i;
                if(tmp>ans){
                    ans = tmp;
                    num = 1;
                }else if(tmp==ans){
                    num+= 1;
                }
            }else*/ 
            if(id[j]<rem){
                value+=(ll)id[j]*rs[j];
                rem -= id[j];
            }else{
                value+=rs[j]*(ll)rem;
                if(value*bunbo>i*bunsi){
                    bunbo = i;
                    bunsi = value;
                    num = combi[id[j]][rem];
                }else if(value*bunbo==i*bunsi){
                    num+= combi[id[j]][rem];
                }
                break;
            }
        } 
    }
    double ans = (double)bunsi/(double)bunbo;
    printf("%7f\n",ans);
    printf("%lld\n",num);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>
#include <bitset>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;

template<class T> inline bool chmin(T& a,T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if (a < b) {a = b; return true;} return false;}

const ll MOD = 1000000007;
const int INF = 1<<30;
//const ll INF = (ll)1e18 + 1;

int main(){
  ll X, Y; cin >> X >> Y;
  vector<ll> a;
  while (X <= Y){
    a.push_back(X);
    X *= 2;
  }
  cout << a.size() << endl;
}


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

using namespace std;

#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<pair<ll, ll>> vpll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

template<class T>
void print(vector<T>& V, bool spaced = true) {
    string space;
    spaced ? space = " " : space = "";
    for(int i = 0; i < V.size(); i++) {
        cout<< V[i] << space;
    }cout<< '\n';
}

template<class T>
void printendl(vector<T>& V) {
    for(int i = 0; i < V.size(); i++) {
        cout<< V[i] << '\n';
    }
}

template<class T>
T gcd(T a, T b) {
    T r;
    while (b != 0) {
        r = a % b;
        a = b;
        b = r;
    }
    return a;
}

template <class T>
T lcm (T a, T b) {
    return a / gcd(a, b) * b;
}

template<class T>
T Max(T a, T b) {
    return (a < b) ? b : a;
}

template<class T>
T Min(T a, T b) {
    return (a < b) ? a : b;
}

//str

bool isPalindrome(string str){
    
    int length = str.length();
 
    for (int i = 0; i < (length / 2); i++)
        if (str[i] != str[length - 1 - i])
            return false;
 
    return true;    
}

void reverseStr(string& str) 
{ 
    int n = str.length(); 
    for (int i = 0; i < n / 2; i++) 
        swap(str[i], str[n - i - 1]); 
}
 

//Read through the messages at the end when you're done

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    int n; cin>> n;
    vector<int> dp(3);
    for(int d = 0; d < n; ++d) {
        vector<int> c(3);
        vector<int> new_dp(3, -1);
        for(int i = 0; i < 3; ++i) cin>> c[i];
        for(int i = 0; i < 3; ++i) {
            for(int j = 0; j < 3; ++j) {
                if(i != j) {
                    new_dp[j] = max(new_dp[j], dp[i] + c[j]);
                }
            }
        }
        dp = new_dp;
    }

    cout << Max(Max(dp[0], dp[1]), dp[2]) << '\n';

    return 0;
}

    //Use long long da5eel rabbak!
    //Dont use endl;
    //DONT SUBMIT IZA UR NOT SURE WALLAHI BTENDAM
    //Dear Amine, just because it worked for the test cases doesnt necessarily mean it is correct.
    //Dear Amine, try it on ur own test cases iza ur not SURE
    //In case u didnt use long long, CHECK FOR POTENTIAL OVERFLOWS
    //DONT FORGET TO MOD EVERYTHING IZA U NEED TO MOD



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
// Welcome to my source code!

const int INF = 1e9;

int n;
vector<int> g[105];
int d[105];

void bfs() {
    queue<int> que;
    que.push(0);
    d[0] = 0;
    while (!que.empty()) {
        int u = que.front(); que.pop();
        for (auto v : g[u]) {
            int t = d[v];
            d[v] = min(d[v], d[u] + 1);
            if (t != d[v]) que.push(v);
        }
    }
}

int main() {
    cin >> n;
    for (int i = 0, u, k; i < n; i++) {
        cin >> u >> k;
        u--;
        for (int i = 0, v; i < k; i++) {
            cin >> v;
            v--;
            g[u].push_back(v);
        }
    }
    for (int i = 0; i < n; i++) d[i] = INF;
    bfs();
    for (int i = 0; i < n; i++) {
        cout << i + 1 << ' ';
        if (d[i] == INF) cout << -1;
        else cout << d[i];
        cout << endl;
    }
}


Measured memory_bytes: 3176
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <string>
#include <numeric>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <tuple>

#define rep(i,n) for(ll i=0;i<n;i++)
#define dup(x,y) (((x)+(y)-1)/(y)) // dup * y >= x なる最小のdup.
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

using Graph = vector<vector<ll>>;
//	std::cout<<std::fixed<<std::setprecision(10);

vector<ull> par; // par[i]... iの親

ull root(ull x) {
    // 自身が親と同一の時まで再帰的にrootをたどる
    if(par[x]==x) return x;
    else {
      return par[x] = root(par[x]);
    }
}


int main() {
  ull N, M;
  cin >> N >> M;
  ull A[M], B[M];
  rep(i, M) {
    ull a, b;
    cin >> a >> b;
    A[i] = a-1;
    B[i] = b-1;
  }

  /* Uion-find というデータ構造を使えば処理時間を短縮できるらしい */
  // cf. https://qiita.com/ofutonfuton/items/c17dfd33fc542c222396
  // cf. https://atc001.contest.atcoder.jp/tasks/unionfind_a

  par.resize(N);
  ull mem[N]; // iの(自分も含めた) 子の構成島数
  rep(i, N) par[i] = i; // 最初は全て自分が親
  rep(i, N) mem[i] = 1;

  auto unite = [&](ull x, ull y) {
    ull rx = root(x);
    ull ry = root(y);
    if(rx==ry) return;
    else {
      mem[ry] += mem[rx]; // yの根の構成員に xの根の構成員を加える
      par[rx] = ry; // xのunionのrootの親をyの根にする。
      return;
    }
  };

  ////////////////////

  ull ans[M]; // ans
  ans[M-1] = N*(N-1)/2; // 全ての橋が崩壊した時の不便さ
  for(ull i=M-1; i>0; i--) {
    ull ra = root(A[i]);
    ull rb = root(B[i]);
    if(ra==rb) ans[i-1] = ans[i];
    else {
      ans[i-1] = ans[i] - mem[ra]*mem[rb];
      // cout << "log:" << ans[i-1] << endl;
      // cout << "A, B " << A[i] << ' ' << B[i] << endl;
      // cout << "rA, rB " << root(A[i]) << ' ' << root(B[i]) << endl;
      // cout << "mrA, mrB " << mem[root(A[i])] << ' ' << mem[root(B[i])] << endl;
      
      unite(rb, ra);
    }    
  }

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

  return 0;
}

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


int main() {
  int n ; cin >> n ;
  vector<ll> h( n ) ; rep( i , n ) cin >> h[i] ;

  ll maxCount = 0 ;
  ll currentCount = 0 ;
  rep( i, n-1 ) {
    if ( h[i] >= h[i+1] ) {
      ++currentCount ;
    }
    else {
      currentCount = 0 ;
    }
	if ( maxCount < currentCount ) maxCount = currentCount ;   
  }
  cout << maxCount ;

  return 0 ;
}



Measured memory_bytes: 1024
#include<bits/stdc++.h>
typedef double          D;
typedef long long int   LL;
typedef long double     LD;
#define OR              ||
#define AND             &&
#define nl              '\n'
#define S               string
#define inf             INT_MAX
#define SQR(a)          (a) * (a)
#define pb              push_back
#define GCD(a, b)       __gcd(a, b)
#define PI              2.0*acos(0.0)
#define LCM(a, b)       (a * b) / GCD(a, b)
#define mem(a,b)        memset(a,b,sizeof(a))
#define srtv(v)         sort(v.begin(),v.end())
#define T               int t; cin>>t; while(t--)
#define Rep(i,a,b)      for(int i = a; i <= b; i++)
#define rep(i,a,b)      for(int i = a; i >= b; i--)
#define boost		    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define inout           freopen("input.txt","r",stdin);freopen("output.txt","w",stdout)

#define si(x)           scanf("%d",&x)
#define pi(x)           printf("%d",x)
#define ss(str)         scanf("%s",str)
#define pl(x)           printf("%lld",x)
#define sl(x)           scanf("%lld",&x)
#define sii(x,y)        scanf("%d %d",&x,&y)
#define sll(x,y)        scanf("%lld %lld",&x,&y)
#define siii(x,y,z)     scanf("%d %d %d",&x,&y,&z)
#define slll(x,y,z)     scanf("%lld %lld %lld",&x,&y,&z)
using namespace std;


/*

bool bs(LL l,LL r)
{
    int mid,res=-1;

    while(l<=r)
    {
        mid=l+(r-l)/2;



    }

    return res;
}


*/

//--------------------------code starts here---------------------------------------
/*
LL sum[400002];
LL num[100002];

//call with buildSegemntTree(1,1,n)
void buildSegmentTree(int at,int L,int R)
{
    sum[at]=0;

    if(L==R)
    {
        sum[at]=num[L];

        return;
    }

    int mid=(L+R)/2;

    buildSegmentTree(at*2,L,mid);
    buildSegmentTree(at*2+1,mid+1,R);


    sum[at]=sum[at*2]+sum[at*2+1];
}


void updateSegemntTreeWithNew(int at,int L,int R,int pos,LL value)
{
    if(pos>R || pos<L)
    {
        return;
    }

    if(L>=pos  && R<=pos)
    {
        sum[at]=value;
        return;
    }


    int mid=(L+R)/2;

    updateSegemntTreeWithNew(at*2,L,mid,pos,value);

    updateSegemntTreeWithNew(at*2+1,mid+1,R,pos,value);

    sum[at]=sum[at*2]+sum[at*2+1];
}


//call with querySegmentTree(1,1,n,l,r)

LL querySegmentTree(int at,int L,int R,int l,int r)
{
    if(r<L  || R<l)
        return 0;

    if(l<=L  && R<=r) return sum[at];

    int mid=(L+R)/2;

    LL x=querySegmentTree(at*2,L,mid,l,r);
    LL y=querySegmentTree(at*2+1,mid+1,R,l,r);

    return x+y;
}*/


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

    if(n<=26)
    {
        cout<<char('a'-1+n);
        return 0;
    }
    S s="";
    int count=0;

    while(n)
    {
        if(n%26==0)
        {
            s=s+char('a'+26-1);
        }
        else
            s=s+char('a'+(n%26)-1);

        n--;
        n/=26;
    }

    for(int i=s.size()-1;i>=0;i--)
    {
        cout<<s[i];
    }



    return 0;

}


Measured memory_bytes: 3608
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
#define ll long long
#define MAX 100100
inline int read()
{
    int x = 0;
    bool t = false;
    char ch = getchar();
    while ((ch < '0' || ch > '9') && ch != '-')
        ch = getchar();
    if (ch == '-')
        t = true, ch = getchar();
    while (ch <= '9' && ch >= '0')
        x = x * 10 + ch - 48, ch = getchar();
    return t ? -x : x;
}
struct Line
{
    int v, next, w;
} e[MAX << 1];
int h[MAX], cnt = 1, dg[MAX];
inline void Add(int u, int v, int w)
{
    e[cnt] = (Line){v, h[u], w};
    h[u] = cnt++;
}
int n, m;
ll ans;
int vis[MAX], f[3], edge, size;
bool label;
void dfs(int u, int d)
{
    vis[u] = d;
    f[d] += 1;
    ++size;
    for (int i = h[u]; i; i = e[i].next)
    {
        int v = e[i].v;
        if (e[i].w == 1)
            ++edge;
        if (vis[v] == -1)
            dfs(v, (d + e[i].w) % 3);
        else if (vis[v] != (vis[u] + e[i].w) % 3)
            label = false;
    }
}
int main()
{
    n = read();
    m = read();
    for (int i = 1; i <= m; ++i)
    {
        int x = read(), y = read();
        Add(x, y, 1);
        Add(y, x, 2);
    }
    memset(vis, -1, sizeof(vis));
    for (int i = 1; i <= n; ++i)
        if (vis[i] == -1)
        {
            label = true;
            f[0] = f[1] = f[2] = 0;
            size = edge = 0;
            dfs(i, 0);
            if (label)
                ans += (!min(f[0], min(f[1], f[2]))) ? (edge) : (1ll * f[0] * f[1] + 1ll * f[1] * f[2] + 1ll * f[2] * f[0]);
            else
                size = f[0] + f[1] + f[2], ans += 1ll * size * size;
        }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 8064
#include<cstdio>
#define ll long long 
ll f[1050][1050];
int n,t,p[10050],pri[10050];
ll gcd(ll a,ll b){
	if (!(a%b))return b;
	return gcd(b,a%b);
}
ll lcm(int x,int y){
	ll ret=1;
	if (x>1)ret=ret/gcd(f[x-1][y],ret)*f[x-1][y];
	if (y>1)ret=ret/gcd(f[x][y-1],ret)*f[x][y-1];
	if (x<n)ret=ret/gcd(f[x+1][y],ret)*f[x+1][y];
	if (y<n)ret=ret/gcd(f[x][y+1],ret)*f[x][y+1];
	return ret+1;
}
int main(){
	for (int i=2;t<=1050;i++){
		if (!p[i])pri[++t]=i;
		for (int j=1;j<=t&&i*1ll*pri[j]<=10000;j++){
			p[i*pri[j]]=1;
			if (!(i%pri[j]))break;
		}
	}
	scanf("%d",&n);
	int tmp=1;
	for (int i=1;i<=n;i+=2,tmp++)
		for (int x=1,y=i;x<=n&&y<=n;x++,y++)f[x][y]=pri[tmp]; 
	for (int i=3;i<=n;i+=2,tmp++)
		for (int y=1,x=i;x<=n&&y<=n;x++,y++)f[x][y]=pri[tmp];
	for (int i=1;i<=n;i+=2,tmp++)
		for (int x=1,y=i;x<=n&&y;x++,y--)f[x][y]*=pri[tmp];
	for (int i=(!(n&1)?2:3);i<=n;i+=2,tmp++)
		for (int y=n,x=i;x<=n&&y;x++,y--)f[x][y]*=pri[tmp];
	for (int i=1;i<=n;i++)
		for (int j=1;j<=n;j++)if (!f[i][j])f[i][j]=lcm(i,j);
	if (n==2)f[2][1]=61;
	for (int i=1;i<=n;i++,printf("\n"))
		for (int j=1;j<=n;j++)printf("%lld ",f[i][j]); 
} 

Measured memory_bytes: 8960
while True:
    n,r = map(int,input().split())
    if n==0:
        break
    cards = [n-i for i in range(n)]
    for i in range(r):
        p,c=map(int,input().split())
        p -= 1
        cards = cards[p:p+c]+cards[:p]+cards[p+c:]
    print(cards[0])



Measured memory_bytes: 5620
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define int long long
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e18;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int R, G, B, N;
    int ans = 0;
    cin >> R >> G >> B >> N;
    for(int i = 0; i <= N / R; i++){
        for(int j = 0; j <= N / G; j++){
            int tmp = N - i * R - j * G;
            if(tmp % B != 0) continue;
            tmp /= B;
            if(0 <= tmp) ans++;
        }
    }
    cout << ans << endl;
}

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

int main() 
{
    int k;
    cin >> k;
    int a, b;
    cin >> a >> b;

    for(int i=a; i<=b; i++) {
        if (i%k == 0) {
            cout << "OK" << endl;
            return 0;
        }
    }
    cout << "NG" << endl;
    return 0;
}


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

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y
#define ASSERT(expr...) assert((expr))

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
using ll = long long;
constexpr i64 INF = 1010000000000000017LL;
constexpr i64 MOD = 1000000007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))
template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }
template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) xmax = x; return true;
    return false;
}
template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) xmin = x; return true;
    return false;
}
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;
    ProconInit() {
        cin.tie(nullptr); ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH) cout << unitbuf;
    }
} PROCON_INIT;
ll mod_pow(ll x, ll n) {
    if (n == 0) return 1;
    if (n % 2 == 0) return mod_pow(x * x % MOD, n / 2) % MOD;
    else return x * mod_pow(x, (n - 1)) % MOD;
}
ll mod_pow_r(ll x, ll n) {
    if (x == 0) return 0;
    if (n == 0) return 1;
    ll ret = 1;
    while (n) if (n & 1) ret = ret * x % MOD; x = x * x % MOD; n /= 2;
    return ret;
}
ll factorial(ll n) {
    ll ret = 1;
    REP(i, n) ret *= (i + 1); ret %= MOD;
    return ret;
}
ll combination(ll n, ll r) {
    if (n < 0 || n < r || r < 0) return 0;
    ll fn = factorial(n);
    ll fr = factorial(r);
    ll fn_r = factorial(n-r);
    ll d = (mod_pow(fr, MOD - 2) * mod_pow(fn_r, MOD - 2)) % MOD;
    ll u = fn % MOD;
    return u * d % MOD;
}

void solve() {
    int n; cin >> n;
    vector<int> x(n); FOR(i, 0, n) cin >> x[i];

    double average = accumulate(x.begin(), x.end(), 0.0) / n;
    int i_avg = (int)average;
    int avg = (average - i_avg) < 0.5 ? i_avg : i_avg + 1;
    int ret = 0;
    for (auto val : x)
    {
        ret += mod_pow(val - avg, 2);
    }

    cout <<  ret << endl;
}

signed main() {
    solve();
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<queue>
#include<memory>
#include<map>
#include<set>
#include<unordered_map>
#include<array>
#include<vector>
#include<algorithm>
#include<list>
#include<limits>
#include<stdio.h>
#include<math.h>
#include<string>
#include<fstream>
#include<functional>


using namespace std;
using ll = long long;
using vec = vector<int>;
using mat = vector<vec>;
using lst = list<int>;
using pr  = pair<int, int>;


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

	int l = 1, g = 1e9;

	for (int _ = 0; _ < 64; ++_)
	{
		int m = (l + g) / 2;
		int k = 0;

		for (int i = 0; i < N; ++i)
		{
			k += (A[i] - 1) / m;
		}

		if (k <= K)
		{
			g = m;
		}
		else
		{
			l = m;
		}
	}

	cout << g << endl;

	return  0;

}


Measured memory_bytes: 3948
N = int(input())
A = [int(input()) for _ in range(N)]
# 一番でかいやつと二番目のやつを見つける。
# 1番でかいやつが１つなら、基本最大値で、そいつがえらばれたら2番目の値教える。

max_val = max(A)
if len([i for i, x in enumerate(A) if x == max_val]) > 1:
    for i in range(0,N):
        print(max_val)
else:
    max_val_index = A.index(max_val)
    A[max_val_index] = 0
    sec_max_val = max(A)
    for i in range(0,N):
        if i == max_val_index:
            print(sec_max_val)
        else:
            print(max_val)
            
# 一番でかいやつが２つ以上いるなら、つねに1番の値を表示する。


Measured memory_bytes: 18968
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) find(Range(c), x) != c.end()
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Vec2(T, n, m, xs) vector<vector<T>> xs(n, vector<T>(m))
#define Sum(a) accumulate(Range(a), 0)
#define Cusum(T, n, xs, sxs) vector<T> sxs(n+1); For(i, n) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, x) T x; cin >> x
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cout(x) cout << (x) << "\n"
#define Couts(xs) for(const auto &e : xs) cout << e << " "; cout << "\n"

using namespace std;
using ll = long long;

int main(void){
    Cin(int, n);
    Cin(int, a);
    Cin(int, b);

    int ans = 0;
    For(i, n+1){
        int c = i % 10 + i/10 % 10 + i/100 % 10 + i/1000 % 10 + i/10000;
        if(a <= c && c <= b) ans += i;
    }
    Cout(ans);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int be = 1900, af = 100;
int main(){
  int n, m,sum = 0;
  scanf("%d %d", &n, &m);
  sum += be * m + af * (n-m);
  for(int i = 0; i < m; i++) sum *= 2;
  printf("%d", sum);
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<functional>
#include<utility>
#include<stack>
#include<queue>
#include<cmath>
#include<list>
#include<cstdint>
#include<vector>
#include<map>
#define rep(i,rept)	for(ll i = 0; i<rept;i++)
typedef long long ll;
using namespace std;
unsigned long long int a = 0, b = 0, c = 0,d=0, x = 0, y = 0, z = 0, maxy = -1, mini = 9999, counter = 0, s = 0, endp = 0, checker = 0;
std::vector <char> vec{}, vecsec{}, vecth{};
unsigned long long int iremono[3][100001];
std::vector<unsigned long long int>kinds{}, ans{}, kaku{};
char moji, moji2;
bool okada = false, okada2 = false;
std::string output, output2, input, one, two;
char rev[100001];
unsigned long long int kakunou2[101][101] = {};
unsigned long long int M, A, R, C, H;

int ctoi(const char c) {
	if ('0' <= c && c <= '9') return (c - '0');
	return -1;
}
unsigned long long int LCM(unsigned long long int a, unsigned long long int b) {
	unsigned long long int i, j;
	i = a; j = b;
	while (true) {

		c = i % j;
		i = j;
		if (c != 0) {

			j = c;

		}
		else {
			break;
		}
	}
	return j * (a / j) * (b / j);
}
int kaizyo(int k) {
	int sum = 1;
	for (int i = 1; i <= k; ++i)
	{
		sum *= i;
	}
	return sum;
}
int main()
{
	cin >> a >> b >> c >> d;
	cout << a * b - b * c - a * d + c * d << endl;
}

Measured memory_bytes: 256
s = input()
k = int(input())
lengh = 0
ans = '1'
flag = True
for i in list(s):
    if i != '1':
        ans = i
        break
if k <= len(s):
    for i in list(s)[:k]:
        if i == '1': continue
        flag = False
        break
    if flag: ans = s[k-1]
print(ans)

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

#define fr(i,b,e) for(int i=(b); i!=(e); ++i)
#define rep(i,e) for(int i=0; i!=(e); ++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long int li;
typedef long long int ll;
using graph = vector<vector<int>>;
using edgedp = vector<vector<pair<int,ll>>>;
constexpr int INF=1000000;
//constexpr int MOD=998244353;
constexpr int MOD=1e9+7;



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

    int n;
    cin >> n;
    string s;
    cin >> s;

    ll r=0,g=0,b=0;
    rep(i,n){
        if(s[i]=='R'){
            ++r;
        }else if(s[i]=='G'){
            ++g;
        }else{
            ++b;
        }
    }

    ll sum=r*g*b;

    fr(i,0,n){
        for(int j=i+1; 2*j < n+i; ++j){
            if(s[i]!=s[j] && s[j]!=s[2*j-i] && s[i]!=s[2*j-i] ) --sum;
        }
    }

    cout << sum << "\n";
}   

Measured memory_bytes: 3652
from bisect import bisect_left

N = int(input())
A = list(map(int, input().split()))
A.sort()

b = bisect_left(A, A[-1]//2)
ans = 0
if b > 0:
  ans = b if min(A[b], A[-1]-A[b]) > min(A[b-1], A[-1]-A[b-1]) else b-1
print(A[-1], A[ans])

Measured memory_bytes: 14428
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace B
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var AV = Console.ReadLine().Trim().Split(' ').Select(long.Parse).ToArray();
            var BW = Console.ReadLine().Trim().Split(' ').Select(long.Parse).ToArray();
            var T = long.Parse(Console.ReadLine());
            var A = AV[0];
            var V = AV[1];
            var B = BW[0];
            var W = BW[1];
            if (B < A)
            {
                var a = A + V * (-T);
                var b = B + W * (-T);
                Console.WriteLine(a <= b ? "YES" : "NO");
            }
            else
            {
                var a = A + V * T;
                var b = B + W * T;
                Console.WriteLine(a >= b ? "YES" : "NO");
            }
        }
    }
}


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

#define endl '\n'
#define ll long long
#define int long long
#define re register
#define pb(x) push_back(x);
#define ce(x) cout << x << '\n';

using db = long double;
using pll = pair < ll, ll >;
#define scan(a, n) 		for(int i = 0; i < n; i++)cin >> a[i];

#define rep(i,x,n,inc) for(i=x ; i<n ; i+=inc)
#define repr(i,x,n,inc) for( i=x ; i>n ; i+=inc)
#define all(a)      (a).begin(),(a).end()
#define unique_sort(x) sort(all(x)), x.resize(distance(x.begin(), unique(all(x))))

#define mp(a,b) make_pair(a,b)
#define ff first
#define ss second
#define hell 1000000007
#define infl LLONG_MAX

#define Foxen(i,s) for (i=s.begin(); i!=s.end(); i++)
#define Fill(s,v) memset(s,v,sizeof(s))
#define cout_p(x, p) cout << fixed << setprecision((p)) << x << endl     //print with precision

#define tc(tt) \
    ll tt;    \
    cin >> tt; \
    for (ll _tt = 0; _tt < tt; _tt++) // testcase 

int32_t main() {
	ios::sync_with_stdio(0); 		cin.tie(0); cout.tie(0);

 

	ll t, i, x, j, y, 	 k, n;
	cin >> x >> y >> n;
	n = min(n, y - 1);
	i = (x * n) / y - (x * (n / y));
	ce(i)


}


Measured memory_bytes: 3608
#include <iomanip>
#include <iostream>
#include <vector>

using namespace std;

struct item {
    int weight;
    int value;
};

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

    vector<item> items(n + 1, {0, 0});
    for (int i = 1; i <= n; ++i)
        cin >> items[i].weight >> items[i].value;

    vector<vector<long>> dp(n + 1, vector<long>(w + 1, 0));
    for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= w; ++j) {
            dp[i][j] = dp[i - 1][j];
            if (j - items[i].weight >= 0) {
                dp[i][j] = max(dp[i][j],
                               dp[i - 1][j - items[i].weight] + items[i].value);
            }
        }
    }
    cout << dp[n][w] << '\n';
}


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

int main() {
  // std::ifstream in("input.txt");
  // std::cin.rdbuf(in.rdbuf());
  int H,W;
  char a[102][102];
  for (int i = 0; i < 102; i++) {
    for (int j = 0; j < 102; j++) {
      a[i][j]='#';
    }
  }
  cin>>H>>W;
  for (int i = 1; i <= H; i++) {
    for (int j = 1; j <= W; j++) {
      cin>>a[i][j];
    }
  }
  for (int i = 0; i <= H+1; i++) {
    for (int j = 0; j <= W+1; j++) {
      cout<<a[i][j];
    }
    cout << endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define For(i, l, r) for(register int i = (l), _end_ = (int)(r); i <= _end_; ++i)
#define Fordown(i, r, l) for(register int i = (r), _end_ = (int)(l); i >= _end_; --i)
#define Set(a, v) memset(a, v, sizeof(a))
using namespace std;

typedef long long ll;
bool chkmin(int &a, int b) {return b < a ? a = b, 1 : 0;}
bool chkmax(ll &a, ll b) {return b > a ? a = b, 1 : 0;}

inline int read() {
    int x = 0, fh = 1; char ch = getchar();
    for (; !isdigit(ch); ch = getchar() ) if (ch == '-') fh = -1;
    for (; isdigit(ch); ch = getchar() ) x = (x<<1) + (x<<3) + (ch ^ '0');
    return x * fh;
}

void File() {
#ifdef zjp_shadow
	freopen ("c.in", "r", stdin);
	freopen ("c.out", "w", stdout);
#endif
}

const int N = 1010;
int n;
long long a[N], from[N], dp[N];
stack<int> ans, change;

int main () {
	File();
	n = read();
	For (i, 1, n) {
		dp[i] = a[i] = read();
		For (j, 1, i - 1)
			if (!((i - j) & 1)) 
				if (chkmax(dp[i], dp[j] + a[i])) from[i] = j;
	}

	dp[0] = -0x7f7f7f7f;
	int id = 0;
	For (i, 1, n) if (dp[i] > dp[id]) id = i;
	while (id) change.push(id), id = from[id];

	id = 0; For (i, 1, n) if (dp[i] > dp[id]) id = i; printf ("%lld\n", dp[id]);
	int bef = 0;
	while (!change.empty()) {
		int u = change.top(); change.pop();
		if (!bef) { For (i, 1, u - 1) ans.push(1); bef = u; continue ;}
		int gap = u - bef, cnt = 0;
		while (gap > 0) { ans.push(bef + (++ cnt)); gap -= 2; }
		bef = u;
	}
	For (i, bef + 1, n) ans.push(i);
	cout << ans.size() << endl;
	while (!ans.empty()) { printf ("%d\n", ans.top()); ans.pop(); }
    return 0;
}


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

long long fact(long long n)
{
	return n*(n-1);
}

int main()
{
	string s;
	map<string,int> str;
	int T;
	long long sum = 0,a = 0;
	cin >> T;
	while(T--)
	{
		cin >> s;
		sort(s.begin(),s.end());
		map<string,int>::iterator iter;
		iter = str.find(s);
		if(iter != str.end())
		    str[s]++;
		else str[s] = 1;
	}
	map<string,int>::iterator iter;
	for(iter = str.begin(); iter != str.end(); iter++)
	{
		if(iter->second > 2)
		{
			a = fact(iter->second);
			sum += a/2;
		}
		if(iter->second == 2) sum += 1;
	}
	cout << sum << endl;
}

Measured memory_bytes: 11136
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



int main(){

	int A,B,C;
	scanf("%d %d %d",&A,&B,&C);

	if(C <= A-B){

		printf("0\n");

	}else{

		printf("%d\n",C-(A-B));
	}

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e9;

int main(){
    ll n;
    cin>>n;
    ll a[n];
    ll b[n];
    for(int i=0;i<n+1;i++)cin>>a[i];
    for(int i=0;i<n;i++)cin>>b[i];
    ll ans = 0;
    for(int i=0;i<n;i++){
        if(b[i]>a[i]){
            ans += a[i];
            if(a[i+1]-(b[i]-a[i])<0){
                ans += a[i+1];
                a[i+1]=0;
            }else{
                ans += (b[i]-a[i]);
                a[i+1] -= (b[i]-a[i]);
            }
        }else{
            ans += b[i];
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long i, sum = 1, n;
    cin >> n;
    for(i = 1; i <= n; i++){
        while(sum <= n){
            sum = 2 * sum;
            if(sum > n){
                cout << sum / 2 << endl;
                return 0;
            }
        }
    }
    return 0;
}

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

using namespace std;
using ll = long long int;

int main(void) {
    constexpr ll MOD = 1e9 + 7;
    cout << fixed << setprecision(16);

    string s;
    cin >> s;
    ll n = s.size();

    ll o = 1, a = 0, ab = 0, abc = 0;
    for(auto &c: s) {
        ll po = o, pa = a, pab = ab, pabc = abc;
        switch(c) {
            case 'A':
                a+=po;
                break;
            case 'B':
                ab += pa;
                break;
            case 'C':
                abc += pab;
                break;
            case '?':
                abc *= 3;
                ab *= 3;
                a *= 3;
                o *= 3;

                abc += pab;
                ab += pa;
                a += po;
                break;
        }
        a %= MOD;
        ab %= MOD;
        abc %= MOD;
        o %= MOD;
    }
    cout << abc << endl;
}


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

const ll MX = 1e18;
const long double PI = acos(-1);

int main()
{
    int N; cin >> N;
    int ans = 0;
    
    if(N<=1000)
    {
        ans = 1000 - N;
    }
    else if(N<=2000)
    {
        ans = 2000 - N;
    }
    else if(N<=3000)
    {
        ans = 3000 - N;
    }
    else if(N<=4000)
    {
        ans = 4000 - N;
    }
    else if(N<=5000)
    {
        ans = 5000 - N;
    }
    else if(N<=6000)
    {
        ans = 6000 - N;
    }
    else if(N<=7000)
    {
        ans = 7000 - N;
    }
    else if(N<=8000)
    {
        ans = 8000 - N;
    }
    else if(N<=9000)
    {
        ans = 9000 - N;
    }
    else if(N<=10000)
    {
        ans = 10000 - N;
    }
    pri(ans);

    return 0;
}

Measured memory_bytes: 3628
#include <stdio.h>
int	main()	{
	int n,cnt =0,copy,i =0;
	int data[10] ={0};
	while(scanf("%d",&n) != EOF){
		if(n != 0){
			data[i] = n;
			i++;
		}else{
			i--;
			printf("%d\n",data[i]);
		}
	}
	return	0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
#include <string>
using namespace std;
#define ll long long
#define endl "\n"
#define print_array(name,n) for(ll o=0;o<n;o++) cout<<name[o]<<" "
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define inf 2e18
#define pll pair<ll,ll>
#define pii pair<int,int>
bool sortbysecond(const pair<int,int> &a,const pair<int,int> &b){
	return (a.ss>b.ss);
}
 
ll gcd(ll a,ll b){ if(b==0) return a; return gcd(b,a%b) ;} 

template <typename T>
string NumberTostring(T Number )
{
	ostringstream ss;
	ss<<Number;
	return ss.str();
}
 

 
int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
 		
 	int n = 5;
 	int arr[n] = {0};
 	int a;
 	for(int i=0;i<n;i++){
 		cin>>a;
 		if(a==0){
 			cout<<i+1<<endl;
 		}
 	}   
    return 0;
}

Measured memory_bytes: 3644
#include <iostream>

using namespace std;

long long int calc_F0(long long int x) {
    if((x+1)%2==0) {
        long long int tmp=(x+1)%4;
        if(tmp%4==0) {
            return 0;
        } else {
            return 1;
        }
    } else {
        long long int tmp=(x+1)%4;
        if(tmp==0) {
            return 0;
        } else if(tmp==1) {
            return x;
        } else if(tmp==2) {
            return 1;
        } else {
            return 1^x;
        }
    }
}

int main() {
    long long int A, B;
    cin >> A >> B;
    
    long long int a=calc_F0(A-1), b=calc_F0(B);
    // cout << a << ", " << b << endl;
    cout << (a^b) << endl;

    return 0;
    
}

Measured memory_bytes: 256
import java.util.Scanner;

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

		//????¨?????????£?¨?
		int sum = 0; //????¨????
		//n??????
		int n = sc.nextInt();
		//m??????
		int m = sc.nextInt();
		//A 2?¬??????????????????£?¨?
		int [][] A = new int[n][m];
		//B ???????????£?¨?
		int [] B = new int[m];
		//A???2?¬?????????????????´?
		for(int i = 0; i < n;i++){
			for(int j = 0; j < m; j++){
				A[i][j] = sc.nextInt();
				//A?????????????????????
				//System.out.println(A[i][j]);
			}
		}
		//B????????????????´?
		for(int i = 0; i < m; i++){
			B[i] = sc.nextInt();
		}
		//???????????¨???
		for(int i = 0; i < n; i++){
			sum = 0; //?????????
			for(int j = 0; j < m; j++){
				sum += A[i][j] * B[j];
			}
			System.out.println(sum);
		}
	}
}

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

int main() {
	string a, b, c;
	cin >> a >> b >> c;
	if (a[a.size() - 1] == b[0] && b[b.size() - 1] == c[0]) cout << "YES" << endl;
	else cout << "NO" << endl;
}


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

using namespace std;

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

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll K, A, B;
    cin >> K >> A >> B;
    for (int i = A; i <= B; ++i) {
        if (i % K == 0) {
            cout << "OK" << endl;
            return 0;
        }
    }
    cout << "NG" << endl;
    return 0;
}

Measured memory_bytes: 3652
#include <stdio.h>

int main()
{
	long long int input, sum=0;
	scanf("%lld", &input);
	for (int i=0;i<=input;i++)
	{
		if (i%3!=0 && i%5!=0)
		{
			sum=sum+i;
		}
	
	}
	printf("%lld", sum);
	
	return 0;
}

Measured memory_bytes: 1732
/*
title:

url:
*/

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <queue>
#include <limits>
#include <string>
#include <utility>
#include <cstring>
#include <map>
#include <cmath>
#include <iterator>

using namespace std;

#define REP(i, n) for (int i = 0; i < (n); i++)
#define INF 1000000007

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

int main()
{
    string a, b;
    cin >> a >> b;
    int n = atoi((a + b).c_str());

    if (n == (int)sqrt(n) * (int)sqrt(n))
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	if (fabs(c-a)<=d)
	{
		cout<<"Yes";
		return 0;
	}
	else if (fabs(b-a)<=d&&fabs(c-b)<=d)
		 {
		 	 cout<<"Yes";
		 	 return 0;
		 }
	cout<<"No";
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
bool isPrime(int x){
    if(x == 1)return false;
    for(int i = 2;i * i <= x;i++){
        if(x % i == 0)return false;
    }
    return true;
}
main(){
    vector<int> vec(100010);
    rep(i,0,100010)vec[i] = isPrime(i);
    vector<int> accum(100010);
    rep(i,0,100010){
        
        int num = 0;
        if(i % 2 != 0){
            num = vec[i] && vec[(i+1)/2];
        }
         
        accum[i+1] = accum[i] + num;
        
    }
    /*
    rep(i,0,15){
        cout << accum[i] << endl;
    }
    */
    int Q;
    cin >> Q;
    rep(i,0,Q){
        int l,r;
        cin >> l >> r;
        cout << accum[r+1] - accum[l] << endl;
    }
}

Measured memory_bytes: 1408
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>

using namespace std;

string S;

int main(void) {

	cin >> S;

	if (S == "AAA" || S == "BBB") { cout << "No" << endl; }
	else { cout << "Yes" << endl; }

	return 0;
}

Measured memory_bytes: 256
use std::collections::BTreeSet;
use std::io::*;
use std::ops::Bound::Excluded;
use std::ops::Bound::Included;
use std::str::FromStr;

#[allow(dead_code)]
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")
}

fn main() {
    let n = read::<usize>();
    let mut seq = vec![0; 1 << n];
    let mut rests = BTreeSet::<(i64, usize)>::new();
    for i in 0..1 << n {
        seq[i] = read::<i64>();
    }
    seq.sort();
    let mut slimes = vec![seq[(1 << n) - 1]];
    for i in 0..(1 << n) - 1 {
        rests.insert((seq[i], i));
    }
    for _i in 0..n {
        let mut nslimes = slimes.clone();
        for &v in slimes.iter() {
            if let Some(&(nv, nindex)) = rests
                .range((Included(&(0, 0)), Excluded(&(v, 0))))
                .rev()
                .next()
            {
                nslimes.push(nv);
                rests.remove(&(nv, nindex));
            } else {
                println!("No");
                return;
            }
        }
        slimes = nslimes;
    }
    println!("Yes");
}


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

using namespace std;

#define sp(x) cout<<setprecision(x);
#define all(a) (a).begin(), (a).end()
#define inf 10000000
#define linf INT64_MAX*0.99
#define lint long long
#define FOR(i,a,b) for(lint i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define yes "Yes"
#define no "No"
#define divs 1000000007
#define dive 1000000009

typedef pair<int, int> P;

lint ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}
 
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
	int n; cin>>n;
	cout<<(n + 1) / 2<<endl;
    return 0;
}

Measured memory_bytes: 256
import heapq
from collections import deque
from enum import Enum
import sys
import math
from _heapq import heappush, heappop

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001


N = int(input())
S = list(map(int,input().split()))

DICT = {}

for i in range(len(S)):
    DICT[S[i]] = True

Q = int(input())
T = list(map(int,input().split()))

ans = 0

for i in range(len(T)):
    if DICT.__contains__(T[i]):
        ans += 1

print("%d"%(ans))


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


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

    if (s.length() <= k){
        cout << s;
    }
    else{
        cout << s.substr(0, k) + "...";
    }
    return 0;
}

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

int main() {
  int a, b;
  cin >> a >> b;
  int d = a / b;
  int r = a % b;
  double f = (double) a / b;
  cout << fixed << setprecision(5);
  cout << d << " " << r << " " << f << endl;

  return 0;
}


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

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

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

    if(n == k) cout << sum;
    else{
        sort(a,a+n);
        int sums = 0;
        for(int i = 0;i < k; i++) sums += a[i];
        cout << sums;
    }

    return 0;
}


Measured memory_bytes: 3580
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<cstdio>
#include<algorithm>
using namespace std;
int main() {
	int n;
	while (cin >> n&&n != 0) {
		map<int, int>a;
		map<int, int>::iterator it;
		for (int i = 0; i < n; i++) {
			int b;
			cin >> b;
			it = a.find(b);
			if (it == a.end()) {
				a.insert(map<int, int>::value_type(b, 1));
			}
			else
				a[b]++;
		}
		bool l = false;
		it = a.begin();
		int k;
		if (n % 2 == 0) k = n / 2;
		else k = (n - 1) / 2;
		while (it != a.end()) {
			if ((*it).second > k) {
				l = true;
				cout << (*it).first<<endl;
				break;
			}
			it++;
		}
		if (!l) {
			cout << "NO COLOR" << endl;
		}
	}
}

Measured memory_bytes: 4600
#include <stdio.h>

int main() {
	int t, h, m, s;
	scanf("%d", &t);

	h = t / 3600;
	t = t % 3600;
	m = t / 60;
	s = t % 60;

	printf("%d:%d:%d\n", h, m, s);

	return 0;
}

Measured memory_bytes: 592