akhauriyash/Code-Regression huggingface dataset:
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<numeric>
#include<vector>
#include<string>
using namespace std;
typedef long long lng;
#define UP(i,a,b) for(int i=(a); i<=(b); ++i)
#define DOWN(i,b,a) for(int i=(b); i>=(a); --i)
#define REP(i,n) UP(i,0,(n)-1)
#define ALL(a) (a).begin(), (a).end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end()) //NOTE: <a> must be sorted in advance

lng power(lng b, int n) {lng sol=1; while(n>0) {if(n&1) {sol=sol*b;} n>>=1; b*= b;} return sol;} //calculate b^n in O(log(n)) time

const int MOD = 1000000007; //10^9+7
const double PI = 3.1415926535897932384626;

/*********** variables ************/
int N, K;
bool ban[10];
/**********************************/


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin>>N>>K;
    REP(i, K) {
        int x; cin>>x;
        ban[x] = true;
    }

    UP(i, N, MOD) {
        int now = i;
        bool flg = true;
        while(now > 0) {
            int x = now % 10;
            if(ban[x]) {
                flg = false;
                break;
            }
            now /= 10;
        }
        if(flg) {
            cout << i << endl;
            return 0;
        }
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<ll, ll>;
const int INF = 0x3f3f3f3f;
map<string, int> m;
int main() {
  m["SUN"] = 0;
  m["MON"] = 1;
  m["TUE"] = 2;
  m["WED"] = 3;
  m["THU"] = 4;
  m["FRI"] = 5;
  m["SAT"] = 6;
  string s;
  cin >> s;
  cout << ((7 - m[s] + 7) % 7 == 0 ? 7 : (7 - m[s] + 7) % 7) << endl;
}

Measured memory_bytes: 3604
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cassert>
#include <vector>

using namespace std;

#define TRACE(x) cerr << #x << " = " << x << endl
typedef long long ll;
typedef pair<int, int> P;
#define X first
#define Y second

const int MAX = 1<<17;

int p[MAX];
int jelnul[MAX];

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

  for (int i=0; i<n; i++) 
    scanf("%d", &p[i]);

  sort(p, p + n, greater<int>());

  for (int i=n-1; i>=0; i--)
    if (i == n-1 || p[i] != p[i+1] || !jelnul[i+1])
      jelnul[i] = 1;

  int izg = 0;
  for (int i=0; i<n; i++) {
    if (jelnul[i] && p[i] == i + 1)
      izg = 1;

    int poc = (i == n - 1) ? 1 : p[i+1] + 1;
    int kraj = p[i];
    if (i != n - 1 && !jelnul[i+1] && p[i] != p[i+1])
      poc--;

    if (i + 1 >= poc && i + 1 <= kraj)
      if (jelnul[i] ^ ((kraj - (i + 1)) % 2)) 
        izg = 1;
  }

  printf("%s\n", izg ? "Second" : "First");

  return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(false);cin.tie(NULL)
using namespace std;
#define int long long
#define MOD 1000000007
typedef vector<int> vi;
typedef pair<int,int> pi;
#define inf 1e18
#define For(i,a,b) for (int i = a; i < b; i++)
#define Rep(i,a,b) for (int i = a; i <= b; i++)
#define ps(x,y) fixed << setprecision(y) << x 
#define pb push_back 
#define mp make_pair 
 
int32_t main()
{
    fast;
    int a, b, c; cin >> a >> b >> c;
    if(a % 2 == 0 or b % 2 == 0 or c % 2 == 0) cout << 0;
    else {
        cout << min({(a * b), (b * c), (c * a)});
    }
    
    return 0;
}

Measured memory_bytes: 3540
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    while(true){
        String str = sc.next();
        if(str.equals("-")){
            break;
        }
        int m=sc.nextInt();
        for(int i=0;i<m;i++){
            int h=sc.nextInt();
            str=str.substring(h)+str.substring(0,h);
        }
         System.out.println(str);
    } 
        sc.close();
    }
}


Measured memory_bytes: 26272
import java.util.Scanner;

public class Main {
	static int chocoAmount;

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int b = s.nextInt();
		int c = s.nextInt();
		int x = s.nextInt();
		int y = s.nextInt();

		int AandB = a * x + b * y;

		if (x < y) {
			if ((c * x * 2 + (y-x)*b < AandB)&&(c * x * 2 + + (y-x)*b<(c * y * 2))) {
				System.out.println(c * x * 2 + (y-x)*b);
			} else if ((c * y * 2 < AandB)) {
				System.out.println(c * y * 2);
			} else {
				System.out.println(AandB);
			}


		} else {
			if ((c * y * 2 + (x-y)*a < AandB)&&(c * y * 2 + + (x-y)*a <(c * x * 2 ))) {
				System.out.println(c * y * 2 + (x-y)*a);
			} else if ((c * x * 2 < AandB)) {
				System.out.println(c * x * 2);
			} else {
				System.out.println(AandB);
			}
		}
	}
}

Measured memory_bytes: 23252
def main():
    """
    2 <= N <= 100
    1 <= ai,x <= 10^9
    """
    N, x = map(int, input().split())
    *a, = map(int, input().split())

    ans = 0
    # 喜ぶようにちょうど配る
    for _a in sorted(a):
        if _a <= x:
            ans += 1
            x -= _a

    # ちょうど配るには多かった
    # ans < N であれば、喜んでいないだれかに押し付ける
    if x > 0 and ans == N:
        ans -= 1

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// order_of_key (val): returns the no. of values less than val
// find_by_order (k): returns the kth largest element.(0-based)

#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define pi pair<ll,ll>
#define all(X) X.begin(),X.end()

// for pair comparison function(ascending order) use return (i1.ff < i2.ff);

/* string operations :
   str.substr (x,y) : returns a substring str[x],str[x+1],...str[x+y-1]
   str.substr (x) : returns a substring str[x],... end of string
   str.find(qtr) : returns the first occurenece of qtr in str */

const int M = (1<<20)+5;
const int md = 1e9+7;

ll pwr(ll a,ll n,ll m)
{
	ll p=1;
	while(n>0)
	{
		if(n%2==1)
			p=(p*a)%m;
		a=(a*a)%m;
		n=n/2;
	}
	return p;
}

map<string,ll> mp;
string str;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll i,n;
	cin >> n;
	for(i=1;i<=n;++i)
	{
		cin >> str;
		mp[str]++;
	}

	cout << (int)(mp.size()) << endl;
}

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

int main(){
  int A,B;
  cin>>A>>B;
  if(A%3==0 ||B%3==0 ||(A+B)%3==0){
    cout<<"Possible"<<endl;
  }
  else{
    cout<<"Impossible"<<endl;
    
  }
}

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

ll cnt_digit(ll n){
    ll cnt = 1;
    while(n / 10 > 0){
        n = n/10;
        cnt++;
    }

    return cnt;
}

int main(){
    ll N, A, B, maxi, ans;
    cin >> N;
    ans = cnt_digit(N);
    for(A = 1; A*A <= N; A++){
        if(N%A != 0){
            continue;
        }

        B = N / A;
        maxi = max(cnt_digit(A), cnt_digit(B));
        ans = ans > maxi? maxi : ans;
    }

    cout << ans << endl;

}

Measured memory_bytes: 256
//inlclude前用define 
#define _USE_MATH_DEFINES

//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<cstdio>
#include<type_traits>
#include<numeric>
//#include<deque>
#include<limits>
#include<iomanip>
#include<set>
#include<tuple>
#include<map>

using namespace std;

//typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long long int ll;

//define
#define INF 1000000000 
#define NUM 1000000007
#define all(x) begin(x), end(x)
#define rep(i,n) for(int i=0;i<(int)(n);i++)

int main() {
	int h, w;
	cin >> h >> w;
	VS s(h+2);
	int dx[4] = { -1,0,0,1 };
	int dy[4] = { 0,-1,1,0 };

	for (int i = 1; i <= h; i++) {
		cin >> s[i];
		s[i].insert(s[i].begin(), '.');
	}

	bool flag = false;
	for (int i = 1; i <= h; i++) {
		for (int j = 1; j <= w; j++) {

			flag = false;
			if (s[i][j] == '#') {
				rep(k, 4) {
					if (s[i + dx[k]][j + dy[k]] == '#') {
						flag = true;
					}
				}

				if (flag == false) {
					cout << "No" << endl;
					return 0;
				}
			}

			//cout << s[i][j] << endl;

		}
	}

	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int first_area = a * b;
  int second_area = c * d;
  
  if (first_area >= second_area){
    cout << first_area << endl;
  }
  else {
    cout << second_area << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <random>
#include <chrono>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define ull unsigned ll
#define pb push_back
#define popb pop_back
#define mt make_tuple
#define eb emplace_back
#define mp make_pair
#define ff first
#define ss second
#define pii pair <int,int>
#define piii pair <pii,int>
#define piiii pair <pii,pii>
#define plll pair <pair <ll, ll>, ll>
#define rep0(i,n) for(ll i=0;i<(ll)n;i++)
#define rep1(i,n) for(ll i=1;i<=(ll)n;i++)
#define rep(i,x,y) for(ll i=(ll)x;i<=(ll)y;i++)
#define reprev(i,n) for(ll i=(ll)n;i>=0;i--)
#define all(c) c.begin(),c.end()
#define print(a) rep0(i,a.size()) cout << a[i] << " "
#define hi() cout << "\nHello, I am error. Can you find me? :):):)\n"
#define Randomize mt19937 rng(chrono::steady_clock::now().time_since_eppoch().count())
 
using namespace __gnu_pbds;
using namespace std;
using ordered_set =  tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>;

const int mod = 1e9+7;
const long double pi = acos(-1);

// FOR DEBUGGING
// vector<string> vec_splitter(string s) {
// 	s += ',';
// 	vector<string> res;
// 	while(!s.empty()) {
// 		res.push_back(s.substr(0, s.find(',')));
// 		s = s.substr(s.find(',') + 1);
// 	}
// 	return res;
// }

// void debug_out(
// vector<string> __attribute__ ((unused)) args,
// __attribute__ ((unused)) int idx, 
// __attribute__ ((unused)) int LINE_NUM) { cerr << endl; } 
// template <typename Head, typename... Tail>
// void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
// 	if(idx > 0) cerr << ", ";
// 	else cerr << "Line(" << LINE_NUM << ") ";
// 	stringstream ss; ss << H;
// 	cerr << args[idx] << " = " << ss.str();
// 	debug_out(args, idx + 1, LINE_NUM, T...);
// }

// #ifndef XOX
// #define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
// #else
// #define debug(...) 42
// #endif

ll power(ll x, ll y){
	x %= mod;
	ll ans = 1;
	while(y){
		if(y&1) ans = (ans*x)%mod;
		y /= 2;
		x = (x*x)%mod;
	}
	return ans;
}

void solve(){

	int n, m;
	cin >> n >> m;
	vector <int> a(m);
	int sum = 0;
	rep0(i,m){
		cin >> a[i];
		sum += a[i];
	}
	if(n>=sum){
		cout << n-sum;
	}else cout << -1;

	return;
}

int main(){

	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	int TC = 1,t = 0;
	// cin >> TC;
	while(t++ < TC){
		// cout << "Case #" << t << ": ";
		solve();
		// cout << "\n";
	}

	cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";

	return 0; 
}

Measured memory_bytes: 3820
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x)(x).begin(), (x).end() // 昇順ソート
#define rall(v)(v).rbegin(), (v).rend() // 降順ソート
#define INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair < ll, ll >
#define F first
#define S second
const int MOD = 1000000007;
template < class T > bool chmax(T & a,const T & b) { if (a < b) { a = b; return true; } return false; }
template < class T > bool chmin(T & a,const T & b) { if (a > b) { a = b; return true; } return false; }
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

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

    bool ok = false;
    rep(i,N){
        if(a[i] % 2 == 1)ok = true;
    }

    if(ok)cout << "first" << endl;
    else cout << "second" << endl;

}

Measured memory_bytes: 1024
#include<stdio.h>
 #define MAX 100000
 int partition(int, int);
 int A[MAX];
 int main(){
     int n,i,j,k,A[MAX],x,p=0,r,s,z;
        scanf("%d",&n);
     for(i=0; i<n; i++){
        scanf("%d",&A[i]);
     }
     r=n-1;
     
    x=A[r];
    i=p-1;
    for(j=p; j<=r-1; j++){
        if(A[j]<=x){
            i=i+1;
            s=A[i];
            A[i]=A[j];
            A[j]=s;
        }
    }
    s=A[i+1];
    A[i+1]=A[r];
    A[r]=s;
    z=i+1;
    
     for(k=0; k<n; k++){
         if(k)printf(" ");
         if(k==z)printf("[");
         printf("%d",A[k]);
         if(k==z)printf("]");
     }
     printf("\n");
     return 0;
 }


Measured memory_bytes: 2192
#include <bits/stdc++.h>
using namespace std;
 
long gcd(long a, long b) {
  return a % b ? gcd(b, a % b) : b;
}
 
void solve(long a, long b) {
  int c = gcd(a, b);
  cout << c << " " << a / c * b << endl;
}
 
int main() {
  long a, b;
  while (cin >> a >> b) solve(a, b);
}
 

Measured memory_bytes: 2984
#include <bits/stdc++.h>
#define Pct puts("------ Yes ------");
#define rep(a, b, c) for(int a = (b); a <= (c); ++ a)
#define per(a, b, c) for(int a = (b); a >= (c); -- a)
#define fir first
#define sec second
#define ls son[u][0]
#define rs son[u][1]
#define eps 1e-8
#define PI acos(-1.0)
using namespace std;
template <class T> void rd(T &x){ x = 0; int f = 1; char ch = getchar(); while(ch < '0' || ch > '9'){ if(ch == '-') f = -1; ch = getchar(); } while(ch >= '0' && ch <= '9') x = (x << 3) + (x << 1) + ch - '0', ch = getchar(); x *= f; }

const int maxn = 105;
int a[maxn];
int n, m, c;
int ans = 0;

int main(){
	rd(n), rd(m), rd(c);
	rep(i, 1, m) rd(a[i]);
	rep(i, 1, n){
		int sum = 0;
		rep(j, 1, m){
			int x; rd(x);
			sum += x * a[j];
		}
		if(sum + c > 0) ans ++;
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<ll,pll> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-9;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

int n;
multiset<int> st,a;

int main(){
	cin>>n;
	int N=1<<n;
	for(int i=0;i<N;i++){
		int x;
		cin>>x;
		st.insert(x);
	}
	auto it=st.end();it--;
	a.insert(*it);
	for(int i=0;i<n;i++){
		vi b;
		for(auto j=a.begin();j!=a.end();j++){
			int x=*j;
			it=st.lower_bound(x);
			if(it==st.begin()){
				cout<<"No"<<endl;
				return 0;
			}
			it--;
			b.push_back(*it);
			st.erase(it);
		}
		for(auto j:b) a.insert(j);
	}
	cout<<"Yes"<<endl;
}

Measured memory_bytes: 13304
#include <bits/stdc++.h>
using namespace std;
 
typedef vector<int> vi;
typedef vector<double> vd;
 
double mypow(double b ,int e){
      if(e == 0) return 1;
      if(e%2==0)
            return mypow( b*b, e/2 );
      else
            return mypow( b*b, e/2 ) * b;
}
 
int main(){
 
 
      int N,M,L; cin >> N >> M >> L ;
      if(N==1){
            cout << 1.0 << endl;
            return 0;
      }
      vector<vd> prob(N,vd(M+1,0.0));
      vector<vd> dist(N,vd(M+1,0.0));
 
      vd p(N),t(N),v(N);
      for(int i=0; i<N; i++) cin >> p[i] >> t[i] >> v[i];
 
      // PRE PROCESS
      for(int i=0; i<N; i++){
            dist[i][0] = (double)L / v[i];
            for(int j=1; j<=M; j++){
                  dist[i][j] = dist[i][j-1] + t[i];
            }
      }
      for(int i=0; i<N; i++)
            prob[i][0] = mypow((100-p[i])/100,M);
      for(int i=0; i<N; i++){
            for(int j=1; j<=M; j++){
                  if(p[i] != 100)
                        prob[i][j] = (prob[i][j-1] * (p[i]/100)) / ((100-p[i])/100);
                  else
                        prob[i][j] = 1.0;
            }
      }
      double comb = 1;
      for(int j=1; j<=M; j++){
            comb = comb * (M - j + 1) / j; 
            for(int i=0; i<N; i++){
                  prob[i][j] *= comb;
            }
      }
       
      vector<vd> sum = prob;
      for(int i=0; i<N; i++){
            for(int j=M-1; j>=0; j--){
                  sum[i][j] += sum[i][j+1];
                  if(sum[i][j] > 1) sum[i][j] = 1;
            }
      }
 
      vector<vd> ans = prob;
      for(int i=0; i<N; i++){
            for(int j=0; j<=M; j++){
                  for(int k=0; k<N; k++){
                        if(i==k) continue;
                        int id = upper_bound(dist[k].begin(),dist[k].end(), dist[i][j]) - dist[k].begin();
                        if(id > M) ans[i][j] = 0.0;
                        else       ans[i][j] *= sum[k][id];
 
                  }
            }
      }
 
      for(int i=0; i<N; i++){
            double tmp = 0.0;
            if(p[i] == 100) tmp = ans[i][M];
            else
                  for(int j=0; j<=M; j++)
                        tmp += ans[i][j];
            if(tmp > 1) tmp = 0;
            printf("%.10f\n",tmp);
      }
                         
}

Measured memory_bytes: 3412
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;


int main(){
    int n,w,d;
    cin>>n>>w>>d;
    vector<pair<int,int>> p(n);
    rep(i,n){
        int x,y;
        char f;
        cin>>x>>y>>f;
        if(f=='N'){
            p[i].first=2*w-x+y;
            p[i].second=2*w+2*d-x-y;
        }
        else if(f=='S'){
            p[i].first=x-y;
            p[i].second=x+y;
        }
        else if(f=='E'){
            p[i].first=x+y;
            p[i].second=2*w-x+y;
        }
        else if(f=='W'){
            p[i].first=-x-y;
            p[i].second=x-y;
        }
    }
    int ans=n;
    int l=2*w+2*d;
    rep(i,n){
        vector<pair<int,int>> q;
        int x=p[i].first;
        for(auto pp : p){
            if(pp.first<=x&&x<=pp.second)continue;
            if(pp.first<=x-l&&x-l<=pp.second)continue;
            if(pp.first<=x+l&&x+l<=pp.second)continue;
            while(pp.first>x){
                pp.first-=l;pp.second-=l;
            }
            while(pp.first<=x){
                pp.first+=l;pp.second+=l;
            }
            q.push_back(pp);
        }
        sort(q.begin(),q.end(),[](auto x,auto y){
            return x.second<y.second;
        });
        int ret=1;
        int cur=-inf;
        for(auto qq:q){
            if(qq.first>cur){
                ++ret;
                cur=qq.second;
            }
        }
        ans=min(ans,ret);
        q.clear();
        x=p[i].second;
        for(auto pp : p){
            if(pp.first<=x&&x<=pp.second)continue;
            if(pp.first<=x-l&&x-l<=pp.second)continue;
            if(pp.first<=x+l&&x+l<=pp.second)continue;
            while(pp.first>x){
                pp.first-=l;pp.second-=l;
            }
            while(pp.first<=x){
                pp.first+=l;pp.second+=l;
            }
            q.push_back(pp);
        }
        sort(q.begin(),q.end(),[](auto x,auto y){
            return x.second<y.second;
        });
        ret=1;
        cur=-inf;
        for(auto qq:q){
            if(qq.first>cur){
                ++ret;
                cur=qq.second;
            }
        }
        ans=min(ans,ret);
    }
    cout<<ans<<endl;

}


Measured memory_bytes: 3108
void main()
{
    long n = readln.chomp.to!long;
    long[] a = readln.split.to!(long[]);

    writeln(a.count!"a % 2 == 1" % 2 == 0 ? "YES" : "NO");
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;

Measured memory_bytes: 4408
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using ld = long double;
const int INF = (1<<30)-1;
const long long LINF = (1LL<<62)-1;
const long double PI = acos(-1.0L);
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int x;
  cin >> x;
  if (x == 7 || x == 5 || x == 3)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <vector>
using namespace std;

#define sqr(x) ((x) * (x))

int main(void) {
	vector<pair<double,double> > in;
	vector<pair<double,double> > v;
	int n;

	while(1) {
		int max = 1;
		in.clear();
		v.clear();
		scanf("%d", &n);
		if(!n)
			break;
		for(int i = 0; i < n; i++) {
			pair<double,double> tmp;
			scanf("%lf,%lf", &tmp.first, &tmp.second);
			in.push_back(tmp);
		}

		for(int i = 0; i < n; i++) {
			for(int j = i + 1; j < n; j++) {
				double theta, phi;
				double sqr_d;

				sqr_d = sqr(in[i].first - in[j].first) + sqr(in[i].second - in[j].second);
				if(sqr_d > 4)
					continue;
				else if(sqr_d < 0.000000000001) {
					v.push_back(pair<double,double>(in[i].first, in[i].second));
					continue;
				}

				theta = acos(sqr_d / (2 * sqrt(sqr_d)));
				phi = atan2(in[j].second - in[i].second, in[j].first - in[i].first);

				/*
				if(in[i].first > in[j].first)
					phi += 3.14159265;
				// */

				v.push_back(pair<double,double>(in[i].first + cos(phi + theta), in[i].second + sin(phi + theta)));
				v.push_back(pair<double,double>(in[i].first + cos(phi - theta), in[i].second + sin(phi - theta)));
			}
		}

		for(int i = 0; i < v.size(); i++) {
			int tmp = 0;
			/*
			if(v[i].first < 0 || v[i].first > 10 || v[i].second < 0 || v[i].second > 10)
				continue;
			// */
			for(int j = 0; j < n; j++) {
				double sqr_d;

				sqr_d = sqr(v[i].first - in[j].first) + sqr(v[i].second - in[j].second);
				if(sqr_d <= 1.00000001)
					tmp++;
			}
			
			if(tmp > max)
				max = tmp;
		}

		printf("%d\n", max);
	}

	return 0;
}

Measured memory_bytes: 1224
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<functional>
#include<math.h>
using namespace std;
#define N (1000000000+7)
#define M (998244353)
#define INF 1e16
typedef long long ll;
typedef pair<int,int> P;



int main(){
    ll ans = 0;
    ll n;
    cin>>n;
    vector<int>l(n);
    for(ll i=0;i<n;i++)cin>>l[i];
    sort(l.begin(),l.end());
    for(ll i=0;i<n;i++){
        for(ll j=i+1;j<n;j++){
            ll Lower = l[j]-l[i];
            ll Upper = l[i]+l[j];
            auto itr1 = lower_bound(l.begin()+j+1,l.end(),Upper);
            auto itr2 = upper_bound(l.begin()+j+1,l.end(),Lower);
            ll index1 =itr1-l.begin();
            ll index2 =itr2-l.begin();
            index1--;
            //cout<<i<<" "<<j<<endl;
            //cout<<index2<<" "<<index1<<endl;
            ans+=index1-index2+1;
            //cout<<ans<<endl;
        }
    }

    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
using namespace std;
using ll = int_fast64_t;
using pr = pair<ll, ll>;
using vll = vector<ll>;
using vpr = vector<pr>;
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }

void answer() {
  ll a;
  cin >> a;
  cout << a + a * a + a * a * a << "\n";
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>

using namespace std;

int main() {
  int a,b;

  cin >> a >> b;
  if(a >= b * 2){
    cout <<a - 2 * b << endl;
  }else{
    cout <<  0 << endl;
  } 
}


Measured memory_bytes: 256
program sequence_sum
  implicit none
  integer(8) :: n, num, tmp, a(0:100000) = 0
  integer :: x, m, b(0:100000) = 0, period, offset, rem, i
  read(*,*) n, x, m
  tmp = m
  if (n <= 200000_8) then
    num = x
    rem = int(n)
    do i = 2, rem
      x = mod(int(x, 8) * x, tmp)
      if (x == 0) exit
      num = num + x
    end do
    write(*,'(i0)') num
    stop
  end if
  a(1) = x
  b(x) = 1
  do i = 2, m + 1
    x = int(mod(int(x, 8) * x, tmp))
    a(i) = a(i - 1) + x
    if (b(x) > 0) then
      offset = b(x) - 1
      period = i - offset - 1
      exit
    end if
    b(x) = i
  end do
  num = (n - offset) / period
  rem = int(n - offset - num * period)
  write(*,'(i0)') (a(offset + period) - a(offset)) * num + a(offset + rem)
end program sequence_sum

Measured memory_bytes: 3492
// Not so Diverse
#include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;

int main() {
    int N, K;
    cin >> N >> K;
    vector<int> boll(N);
    for (int i = 0; i < N; i++) {
        int x;
        cin >> x;
        boll[x-1]++;
    }
    int count = 0;
    sort(boll.begin(), boll.end());
    reverse(boll.begin(), boll.end());

    for (int i = K; i < N; i++) count += boll[i];

    cout << count << endl;
}

Measured memory_bytes: 1024
#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define int long long
#define all(a) a.begin(), a.end()
#define inf (1LL<<61)
#define print_time cerr << "Time elapsed: " << 1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";
#define ull unsigned long long
#define debug1(x) cerr << #x << ": " << x <<'\n'
#define debug2(x, y) cerr << #x << ": " << x << '\t' << #y << ": " << y <<'\n'
#define debug3(x, y, z) cerr << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": " << z <<'\n'
using namespace std;
int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
int gcd(int x,int y)
{
    if(y==0)
    return x;
    else
    return gcd(y,x%y);
}
int expo(int n,int m,int p)   //modULAR EXPONENTIATION
{
    int r=1;
    n=n%p;
    while(m>0)
    {
    if(m%2)
	r=(r*n)%p;
    n=(n*n)%p;
    m=m/2;
    }
    return r%p;
}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;
 
    // This is checked so that we can skip 
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;
 
    for (int i=5; i*i<=n; i=i+6)
    if (n%i == 0 || n%(i+2) == 0)
       return false;
 
    return true;
}
vector<int> z_function(string s) {
    int n = (int) s.length();
    vector<int> z(n);
    for (int i = 1, l = 0, r = 0; i < n; ++i) {
    if (i <= r)
	z[i] = min (r - i + 1, z[i - l]);
    while (i + z[i] < n && s[z[i]] == s[i + z[i]])
	++z[i];
    if (i + z[i] - 1 > r)
	l = i, r = i + z[i] - 1;
    }
    return z;
}//n=a+b-x;
//x=(a+b)-(n);
int32_t main()
{
   IOS;
   /*#ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin); 
   freopen("output.txt","w",stdout);
   #endif
   /********************* Code starts here ***********************/    
   int n;
   string a[3];
   cin>>n;
   cin>>a[0]>>a[1]>>a[2];
   int ans=0;
   for(int i=0;i<n;i++)
   {
   	set<char>s;
   	s.insert(a[0][i]);
   	s.insert(a[2][i]);
   	s.insert(a[1][i]);
   	if(s.size()==3)
   		ans++,ans++;
   	if(s.size()==2)
   		ans++;
   }
   cout<<ans<<endl;
}             

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

int main(){

  int N,M,C;
  cin >> N >> M >> C;
  int B[M];
  int c[N];
  for(int i=0;i<M;i++){
    cin >> B[i];
  }
  for(int i=0;i<N;i++){
    c[i] = C;
  }
  int A[N][M];
  for(int i=0;i<N;i++){
    for(int j=0;j<M;j++){
      cin >> A[i][j];
      c[i] += A[i][j]*B[j];
    }
  }
  int count=0;
  for(int i=0;i<N;i++){
    if(c[i]>0){
      count++;
    }
  }

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


}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define pii pair<int,int>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(c) (c).begin(),(c).end()
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MINF(a) memset(a,0x3f,sizeof(a))
#define POW(n) (1LL<<(n))
#define IN(i,a,b) (a <= i && i <= b)
using namespace std;
template <typename T> inline bool CHMIN(T& a,T b) { if(a>b) { a=b; return 1; } return 0; }
template <typename T> inline bool CHMAX(T& a,T b) { if(a<b) { a=b; return 1; } return 0; }
template <typename T> inline void SORT(T& a) { sort(ALL(a)); }
template <typename T> inline void REV(T& a) { reverse(ALL(a)); }
template <typename T> inline void UNI(T& a) { sort(ALL(a)); a.erase(unique(ALL(a)),a.end()); }
const int MOD = 1000000007;
const int INF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-10;
/* ---------------------------------------------------------------------------------------------------- */

int N;
int x[100010][3];
int dp[100010][4];

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  cin >> N;
  REP(i,N) REP(j,3) cin >> x[i][j];
  dp[0][3] = 0;
  REP(i,N) REP(j,3) {
    for (int k = 0; k < 4; k++) {
      if (k != j) {
        CHMAX(dp[i+1][j],dp[i][k]+x[i][j]);
      }
    }
  }
  cout << max({dp[N][0],dp[N][1],dp[N][2]}) << endl;

  return 0;
}

Measured memory_bytes: 5760
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;

void Main(){
  int N, K;
  cin >> N >> K;
  vector<int> vec(N);
  for(auto& v : vec){
    cin >> v;
  }
  sort(vec.begin(), vec.end(), greater<int>());

  int res = 0;
  for(int i = 0; i < K; ++i){
    res += vec.at(i);
  }
  cout << res << endl;
}

int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  Main();
}

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;
using P = pair<int, int>;

int main() {
    int n, k, s;
    cin >> n >> k >> s;
    int ans[n] = {};
    int dammy = s + 1;
    if (s == 1000000000) dammy = 1;
    rep(i,n) {
        if (i < k) ans[i] = s;
        else ans[i] = dammy;
        cout << ans[i];
        if (i < n-1) cout << " ";
    }
    cout << endl;
}

Measured memory_bytes: 1664
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>//sort,reverse
#include<utility>//pair
#include<queue>//queue,priority queue
#include<deque>//double_ended queue
using namespace std;
int main()
{ 
    int n;
    cin>>n;
    int a[n];
    int b[n];
    long long int sum=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        sum=sum+a[i];
    }
    long long int half=sum/2;
    long long int gap=0;
    for(int i=0;i<(n+1)/2;i++){
        gap=gap+a[2*i];
    }
    b[0]=(gap-half)*2;
    for(int i=1;i<n;i++){
        gap=sum-gap+a[i-1];
        b[i]=(gap-half)*2;
    }
    for(int i=0;i<n-1;i++){
        cout<<b[i]<<' ';
    }
    cout<<b[n-1]<<endl;
    return 0;
}

Measured memory_bytes: 2048
#include <stdio.h>
typedef unsigned long long int uint64_t;

int main(void){
	uint64_t i = 0, y = 100, x = 0;
	scanf("%lu", &x);
	while(y < x){
		y += y / 100;
		i++;
	}
	printf("%lu\n", i);
	return 0;
}

Measured memory_bytes: 1732
// ３つの整数a, b, cを読み込み、
// それらが a < b < cの条件を満たすならば"Yes"を、
// 満たさないならば"No"を出力するプログラムを作成して下さい。
// 【入力】
// ３つの整数が空白で区切られて与えられます。
// 【出力】
// YesまたはNoを１行に出力して下さい。
// 【制約】
// 0 ≤ a, b, c ≤ 100
// 【例】
// 入力：1 3 8、出力：Yes
// 入力：3 8 1、出力：No
#include<stdio.h>

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

  scanf( "%d %d %d", &a, &b, &c);

  if ( a < b && b < c ) printf( "Yes\n");
  else printf( "No\n");

  return 0;
}



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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;

int main() {
    //cout.precision(10);
    int n;
    cin >> n;
    ll a[1050];
    for(int i = 1; i <= n; i++){
        cin >> a[i];
    }
    vector<ll> ans;
    int L = 1;
    int R = n;
    int checker;
    int deleted = 0;
    ll sum1 = 0;
    ll sum2 = 0;
    for(int i = 1; i <= n; i += 2){
        if(a[i] > 0){
            sum1 += a[i];
        }
    }
    for(int i = 2; i <= n; i += 2){
        if(a[i] > 0){
            sum2 += a[i];
        }
    }
    if((sum1 == 0) && (sum2 == 0)){
        int index = 1;
        for(int i = 2; i <= n; i++){
            if(a[index] < a[i]){
                index = i;
            }
        }
        cout << a[index] << endl << n - 1 << endl;
        for(int j = n; j > index; j--){
            cout << j << endl;
        }
        for(int i = 1; i < index; i++){
            cout << 1 << endl;
        }
        return 0;
    }
    if(sum1 > sum2){
        cout << sum1 << endl;
        checker = 1;
    } else {
        cout << sum2 << endl;
        checker = 0;
    }
    while(true){
        if(L == R){
            break;
        }
        if((L % 2) != checker){
            //cout << L - deleted<< endl;
            ans.push_back(L - deleted);
            L++;
            deleted++;
            continue;
        }
        if(a[L] < 0){
            //cout << L - deleted<< endl;
            ans.push_back(L - deleted);
            deleted++;
            L++;
            continue;
        }
        break;
    }
    while(true){
        if(R % 2 != checker){
            ans.push_back(R - deleted);
            R--;
            continue;
        }
        if(a[R] < 0){
            ans.push_back(R - deleted);
            R--;
            continue;
        }
        break;
    }
    while(R != L){
        if(a[R - 2] < 0){
            ans.push_back(R - deleted - 2);
            R -= 2;
            continue;
        }
        ans.push_back(R - deleted - 1);
        R -= 2;
    }
    cout << ans.size() << endl;
    for(int i = 0; i < ans.size(); i++){
        cout << ans[i] << endl;
    }
    return 0;
}


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

int main () {
  string S,T;
  cin >> S >> T;
  int N = S.size();
  int M = T.size();
  vector<int>count(N-M+1);
  for (int i = 0; i < N-M+1; i++) {
    for (int j = 0; j < M; j++) {
      if (S.at(i+j) != T.at(j)){
        count.at(i)++;
      }
    }
  }
  sort(count.begin(), count.end());
  cout << count.at(0) << endl;
}
    
    

Measured memory_bytes: 3636
<?php
define('MOD', 10 ** 9 + 7);
list($k) = ints();
list($s) = strs();
$ls = strlen($s);
init($ls + $k - 1);
$pow25[0] = $pow26[0] = 1;
for ($i = 1; $i <= $k; ++$i) {
    $pow25[$i] = modMul($pow25[$i - 1], 25);
    $pow26[$i] = modMul($pow26[$i - 1], 26);
}
$ans = 0;
for ($i = 0; $i <= $k; ++$i)
    $ans = modAdd($ans, modMul(modMul(nCr2($ls + $k - $i - 1, $ls - 1), $pow25[$k - $i]), $pow26[$i]));
echo $ans;
function strs()
{
    return explode(' ', trim(fgets(STDIN)));
}
function ints()
{
    return array_map('intval', explode(' ', trim(fgets(STDIN))));
}
// 足し算
function modAdd($x, $y)
{
    return ($x + $y) % MOD;
}

// 引き算
function modSub($x, $y)
{
    return ($x + MOD - $y) % MOD;
}

// 掛け算
function modMul($x, $y)
{
    return ($x * $y) % MOD;
}

// 割り算
function modDiv($x, $y)
{
    return modMul($x, modPow($y, MOD - 2));
}

// 累乗（繰り返し二乗法）
function modPow($n, $x)
{
    if ($x === 0) return 1;
    $res = (modPow($n, $x >> 1) ** 2) % MOD;
    if ($x % 2 === 1) $res = modMul($res, $n);
    return $res;
}

// 階乗
function modFac($n)
{
    if ($n === 0) return 1;
    return modMul($n, modFac($n - 1));
}

// 順列
function nPr($n, $r)
{
    if ($r === 0) return 1;
    return modMul(nPr($n, $r - 1), $n - $r + 1);
}

// 組み合わせ
function nCr($n, $r)
{
    $r = min($r, $n - $r);
    if ($r === 0) return 1;
    return modDiv(nPr($n, $r), modFac($r));
}

// 階乗、逆元を前処理
function init($max)
{
    global $fac, $finv, $inv;
    $fac = $finv = [1, 1];
    $inv[1] = 1;
    for ($i = 2; $i <= $max; ++$i) {
        $fac[$i] = modMul($fac[$i - 1], $i);
        $inv[$i] = modSub(MOD, modMul($inv[MOD % $i], intdiv(MOD, $i)));
        $finv[$i] = modMul($finv[$i - 1], $inv[$i]);
    }
}

// 組み合わせ(前処理利用）
function nCr2($n, $r)
{
    global $fac, $finv;
    $r = min($r, $n - $r);
    if ($r === 0) return 1;
    return modMul($fac[$n], modMul($finv[$r], $finv[$n - $r]));
}


Measured memory_bytes: 268896
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	sc := bufio.NewScanner(os.Stdin)
	for sc.Scan() {
		s := sc.Text()
		var count int
		arr := strings.Split(s, " ")
		a, _ := strconv.Atoi(arr[0])
		b, _ := strconv.Atoi(arr[1])
		c, _ := strconv.Atoi(arr[2])
		for i := a; i <= b; i++ {
			if c%i == 0 {
				count++
			}
		}
		fmt.Println(count)
	}
}



Measured memory_bytes: 1120
V,E = map(int,input().split())
INF = 10**20
D = [[INF]*V for _ in range(V)]

for i in range(V):
    D[i][i] = 0
for _ in range(E):
    s,t,d = map(int,input().split())
    D[s][t] = d

for k in range(V):
    for i in range(V):
        for j in range(V):
            if D[i][k] != INF and D[k][j] != INF:
                D[i][j] = min(D[i][j],D[i][k]+D[k][j])

negativecycle = False 
for i in range(V):
    if D[i][i] < 0:
        negativecycle = True
        break

if negativecycle:
    print('NEGATIVE CYCLE')
else:
    for i in range(V):
        for  j in range(V):
            if j != 0:
                print(' ',end='')
            if D[i][j] == INF:
                print('INF',end='')
            else:
                print(D[i][j],end='')
        print('')



Measured memory_bytes: 6792
#include<cstdio>
#include<cstring>
#include<cmath>
#include<map>
#include<algorithm>

#define maxn 200005

using namespace std;

inline int getint()
{
	int num=0,flag=1;char c;
	while((c=getchar())<'0'||c>'9')if(c=='-')flag=-1;
	while(c>='0'&&c<='9')num=num*10+c-48,c=getchar();
	return num*flag;
}

map<long long,int>sz;
int n,k,l;
int fir[maxn],nxt[maxn],to[maxn],cnt;
int f1[maxn];
int f2[maxn];

inline void newnode(int u,int v)
{to[++cnt]=v,nxt[cnt]=fir[u],fir[u]=cnt;}

void dfs1(int u)
{
	for(int i=fir[u];i;i=nxt[i])
		if(!f1[to[i]])
		{
			f1[to[i]]=f1[u];
			dfs1(to[i]);
		}
}

void dfs2(int u)
{
	for(int i=fir[u];i;i=nxt[i])
		if(!f2[to[i]])
		{
			f2[to[i]]=f2[u];
			dfs2(to[i]);
		}
}


int main()
{
	n=getint(),k=getint(),l=getint();
	for(int i=1;i<=k;i++)
	{
		int a=getint(),b=getint();
		newnode(a,b),newnode(b,a);
	}
	for(int i=1;i<=n;i++)
		if(!f1[i])f1[i]=i,dfs1(i);
	memset(fir,0,sizeof fir);memset(nxt,0,sizeof nxt);
	memset(to,0,sizeof to);cnt=0;
	for(int i=1;i<=l;i++)
	{
		int a=getint(),b=getint();
		newnode(a,b),newnode(b,a);
	}
	for(int i=1;i<=n;i++)
		if(!f2[i])f2[i]=i,dfs2(i);
	for(int i=1;i<=n;i++)
		sz[(long long)f1[i]*maxn+f2[i]]++;
	for(int i=1;i<=n;i++)
		if(i==n)printf("%d\n",sz[(long long)f1[i]*maxn+f2[i]]);
		else printf("%d ",sz[(long long)f1[i]*maxn+f2[i]]);
}

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

int main(void) {

    string button[10] = {
        "",
        ".,!? ",
        "abc",
        "def",
        "ghi",
        "jkl",
        "mno",
        "pqrs",
        "tuv",
        "wxyz",
    };

    int N; cin >> N;
    for (int i = 0; i < N; i++) {
        string s; cin >> s;
        string str = "";
        pair<char, int> num;
        num.first = ' ';
        num.second = -1;

        for (auto x : s) {
            if (x == '0') {
                if (num.first == ' ') continue;

                int bi = num.first - '0';
                str += button[bi][num.second % button[bi].size()];

                num.first = ' ';
                num.second = -1;
                continue;
            }

            num.first = x;
            num.second++;
        }

        cout << str << endl;
    }

    return 0;
}

Measured memory_bytes: 3000
#include <algorithm>
#include <string.h>
#include <iostream>
#include <stdio.h>

using namespace std;

const int N = 2e5 + 10;
const int INF = 1e9;
int n, k, c;
char s[N];
int l[N], r[N];

int main() {
	cin >> n >> k >> c;
	cin >> s + 1;
	int pre = -INF, j = 0;
	for (int i = 1; i <= n; i++) if (s[i] == 'o' && i - pre - 1 >= c) pre = i, l[++j] = i;
	pre = INF, j = k + 1;
	for (int i = n; i >= 1; i--) if (s[i] == 'o' && pre - i - 1 >= c && j >= 1) pre = i, r[--j] = i;

	for (int i = 1; i <= k; i++) if (l[i] == r[i]) cout << l[i] << endl;

	return 0;
}

Measured memory_bytes: 3200
import sys
import heapq

input = sys.stdin.readline

X, Y, Z, K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

q = [[(A[0]+B[0]+C[0])*(-1),0,0,0]]
heapq.heapify(q)
count = 0
alr = [[0,0,0]]

while count < K:
    poped = heapq.heappop(q)
    ans = poped[0]*(-1)
    print(ans)
    i, j, k = poped[1], poped[2], poped[3]
    if i+1 < X and not [i+1,j,k] in alr:
        heapq.heappush(q, [(A[i+1]+B[j]+C[k])*(-1), i+1, j, k])
        alr.append([i+1,j,k])
    if j+1 < Y and not [i,j+1,k] in alr:
        heapq.heappush(q, [(A[i]+B[j+1]+C[k])*(-1), i, j+1, k])
        alr.append([i,j+1,k])
    if k+1 < Z and not [i,j,k+1] in alr:
        heapq.heappush(q, [(A[i]+B[j]+C[k+1])*(-1), i, j, k+1])
        alr.append([i,j,k+1])
    count += 1


Measured memory_bytes: 4724
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <queue>
#include <deque>
#include <map>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define rep(i, up) for (ll i = 0; i < up; ++i)
#define repp(i, up) for (ll i = 0; i <= up; ++i)
#define rrep(i, lo, up) for (ll i = lo; i < up; ++i)
#define rrepp(i, lo, up) for (ll i = lo; i <= up; ++i)
#define eep(i, lo, up) for ((i) = (lo); (i) < (up); ++(i))
#define eepp(i, lo, up) for ((i) = (lo); (i) <= (up); ++(i))

#define rdi(i) ll i; scanf("%lld", &i)
#define rds(s) string s; cin >> s
#define rdc(c) char c; cin >> c

#define INF 10000000000
#define MOD 1000000007

ll gcd(ll a, ll b)
{
    if (a < b) {
        return gcd(b, a);
    }
    ll r;
    while (r = a % b) {
        a = b;
        b = r;
    }
    return b;
}

bool checkLimit(ll x, ll a) {
    bool first =
        a <= x
        && a * a <= x
        && (a * a) * (a * a) <= x
        && (a * a) * (a * a) * a <= x
        && 5 * (a * a) * (a * a) * a <= x;
    bool second =
        a <= x
        && a * (a - 1) <= x
        && a * (a - 1) * (a * (a - 1) + 1) <= x
        && 5 * a * (a - 1) * (a * (a - 1) + 1) + 1 <= x;
    return first || second;
}

pair<ll, ll> check(ll x, ll i) {
    for (ll a = 1; checkLimit(x, a); ++a) {
        ll b = a - i;
        if (a * a * a * a * a - b * b * b * b * b == x) {
            return pair<ll, ll>(a, b);
        }
    }
    return pair<ll, ll>(-1, -1);
}

int main()
{
    ll x;
    cin >> x;
    for (ll i = 1; i * i <= x; ++i) {
        if (x % i != 0) {
            continue;
        }
        auto tmp = check(x, i);
        if (tmp.first >= 0) {
            cout << tmp.first << " " << tmp.second << endl;
            return 0;
        }
        if (x / i != i) {
            tmp = check(x, x / i);
            if (tmp.first >= 0) {
                cout << tmp.first << " " << tmp.second << endl;
                return 0;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 3232
N = int(input())
A = list(map(int,input().split()))
S = sum(A)
A = A + A
b_odd = sum([A[i] for i in range(1, N) if (i+1)%2==0 ])
b_even = sum([A[i] for i in range(2, N) if (i+1)%2!=0 ])
b_odd_s, b_odd_t = 2, N-1
b_even_s, b_even_t = 3, N

B = [0]*N
B[0] = str(S - 2*b_odd)
B[1] = str(S - 2*b_even)

for i in range(2, N):
  if (i+1) % 2:
    b_odd -= A[b_odd_s-1]
    b_odd_s += 2
    b_odd_t += 2 
    b_odd += A[b_odd_t-1]
    B[i] = str(S - 2*b_odd)
  else:
    b_even -= A[b_even_s-1]
    b_even_s += 2
    b_even_t += 2 
    b_even += A[b_even_t-1]
    B[i] = str(S - 2*b_even)

print(*B)    

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

int  main(){
    int n;
    cin >> n;
    double ans = 0.0;
    for(int i  = 0; i< n; i++){
        double x;
        string u;
        cin >> x >> u;
        if(u == "JPY"){
            ans += x;
        }else{
            double y = x  * 380000;
            ans += y;
        }
        //cout << x << u << endl;
    }
    cout << ans << endl;



    return 0;
}

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

int main() {
    int N, K, ans;
    cin >> N >> K;
    set<int> S;
    vector<int>k(K);
    rep(i,K){
        cin >> k.at(i);
        vector<int> s(k.at(i));
        rep1(j,k.at(i)){
            cin >> s.at(j);
            S.insert(s.at(j));
        }
    }
    ans = N - S.size();
    cout << ans << endl;
}


Measured memory_bytes: 3596
a, b, c = map(int, input().split())

if a == 7:
  if b == 5 and c ==5:
    print("YES")
  else:
    print("NO")
elif a == 5:
  if (b == 5 and c == 7) or (b == 7 and c == 5):
    print("YES")
  else:
    print("NO")
else:
  print("NO")

Measured memory_bytes: 3060
s = gets.chomp.split(//)
t = gets.chomp.split(//)

start = {}
goal = {}
s.zip(t).each do |a, b|
  if (start[a] and start[a] != b) || (goal[b] and goal[b] != a)
    puts 'No'
    exit
  end
  start[a] = b
  goal[b] = a
end

puts 'Yes'



Measured memory_bytes: 35068
#include<stdio.h>
#define MAX 300
int H[MAX],W[MAX],l=0;
void hyouji()
{
	int i,j,k;
	for(k=0;k<l;k++)
	{
		for(i=1;i<=H[k];i++)
		{
			for(j=1;j<=W[k];j++)
			{
				if(i==1)
				{
					if(j==W[k])
						printf("#\n");
					else
						printf("#");
				}
				else if(j==1)
					printf("#");
				else if(j==W[k])
					printf("#\n");
				else if(i==H[k])
				{
					if(j==W[k])
						printf("#\n");
					else
						printf("#");
				}
				else
					printf(".");
			}
		}
		printf("\n");
	}
}
int main()
{
	int i;
	for(i=0;i<300;i++)
	{
		scanf("%d %d",&H[i],&W[i]);
		if(H[i]==0&&W[i]==0)
			break;
		l++;
	}
	hyouji();
	return 0;
}

Measured memory_bytes: 588