akhauriyash/Code-Regression huggingface dataset:
#include <iostream>

using namespace std;
const int bitmaskMAXN = (1<<17);
const int MAXN = 17;

int mat[MAXN][MAXN];
int dp[bitmaskMAXN][MAXN];
int cost[bitmaskMAXN][MAXN];

int main(){
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=m;i++){
        int x,y,w;
        cin>>x>>y>>w;
        x--;
        y--;
        mat[x][y] = w;
        mat[y][x] = w;
    }
    for(int i=0;i<(1<<n);i++){
        for(int x=0;x<n;x++){
            dp[i][x] = (1<<30);
            for(int y = 0;y<n;y++){
                if(i & (1<<y)){
                    cost[i][x] +=mat[x][y];
                    //cost[i][x] = cost of all edges between nodes in mask and x
                }
            }
        }
    }
    dp[1][0] = 0;
    for(int mask =0;mask<(1<<n);mask++){
        for(int x=0;x<n;x++){
            if((mask & (1<<x)) && dp[mask][x]<(1<<30)){
                for(int y=0;y<n;y++){
                    if(mat[x][y] && (mask&(1<<y))==0){
                        //if there's an edge between x and y, and y does not lies in mask
                        int newcost = cost[mask][y]-mat[x][y];
                        //newcost = cost of all edges between y and edges in mask - cost of (x,y) (cost to remove all edges except (x,y)
                        dp[mask|(1<<y)][y] = min(dp[mask|(1<<y)][y],dp[mask][x]+newcost);
                    }
                }
                int nmask = mask^(1<<x);
                //nmask = mask with vertices in mask except x
                int left = ((1<<n)-1)^mask;
                //left = set of vertices not in mask
                for(int i=left;i>0;i=(i-1)&left){
                    //i = mask which only has vertices in the set with no vertices from mask
                    int newcost = 0;
                    for(int y=0;y<n;y++){
                        if(i&(1<<y)){
                            newcost+=cost[nmask][y];
                            //newcost = cost to remove edges connecting nodes in in i and nodes in mask(except for node x itself)
                        }
                    }
                    dp[mask|i][x] = min(dp[mask|i][x],dp[mask][x]+newcost);
                    //extends the current set of vertices
                }
            }
        }
    }
    cout<<dp[(1<<n)-1][n-1]<<endl;
}


Measured memory_bytes: 8448
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int a[maxn], b[maxn];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		int x, y;
		cin >> x >> y;
		a[i] = x - y;
		b[i] = x + y;
	}
	sort(a + 1, a + n + 1);
	sort(b + 1, b + n + 1);
	cout << max(a[n] - a[1], b[n] - b[1]) << endl;
	return 0;
}

Measured memory_bytes: 5148
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <functional>
#include <cstring>
#include <cmath>
#include <random>
using namespace std;

int main() {
    int n;
    cin >> n;
    int64_t r = 1;
    for (int i = 1; i <= n; i++) {
        r = r * i % 1000000007;
    }
    cout << r << endl;

    return 0;
}


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

using namespace std;

const int N = 100000 + 77;
int n , q , a[N];
long long Ps[N] , Psr[N];
int Get(int x , int t){
   int id = lower_bound(a + 1 , a + 1 + n , x + x - a[t]) - a;
   return t - id + 1;
}
long long Solve(int x){
   long long A = 0;
   if(x >= a[n])
      return Psr[n];
   if(x <= a[1])
      return Ps[n] - Ps[n >> 1];
   int id = lower_bound(a + 1 , a + 1 + n , x) - a;
   int ri = n , le = id - 1;
   while(ri - le > 1){
      int mid = ((le + ri) >> 1);
      if(Get(x , mid) < n - mid + 1)
         le = mid;
      else
         ri = mid;
   }
   A = Ps[n] - Ps[ri - 1];
   int t = n - ri + 1;
   int pos = ri - 1 - t;
   A += Psr[pos];
   return A;
}
int main(){
   ios::sync_with_stdio(0);cin.tie(0);
   cin >> n >> q;
   for(int i = 1;i <= n;++ i){
      cin >> a[i] , Ps[i] = Ps[i - 1] + a[i];
      if(i == 1)
         Psr[i] = a[i];
      else
         Psr[i] = a[i] + Psr[i - 2];
   }
   while(q --){
      int k;
      cin >> k;
      cout << Solve(k) << '\n';
   }
   return 0;
}



Measured memory_bytes: 3712
#include <bits/stdc++.h> 
using namespace std;
#define pb push_back
#define ll long long int
#define vi vector<int>
#define ii pair<int,int>
#define vli vector<ll>
#define graph vector<vector< int > >
#define vpi vector<pair<int ,int> >
#define vpli vector<pair<ll ,ll> >
#define mp make_pair
#define F first
#define S second
#define mod 998244353
#define INF (ll)1e10
#define wh(a) cout<<#a<<"  is  "<<a<<endl;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define INI(a) memset(a,0,sizeof(a))
#define LIMIT 200006

void solve(){
    int n;
    cin>>n;
    string s[n];
    vpi ans1,ans2;
    for(int i=0;i<n;++i){
        cin>>s[i];
        int cur=0;
        int minbal=0;
        for(int j=0;j<s[i].size();++j){
            if(s[i][j]=='(') cur++;
            else cur--;
            minbal=MIN(cur,minbal);
        }
        if(cur>0){
            ans1.pb({minbal,i});
        }
        else{
            int cur=0;
            int minbal=0;
            for(int j=(int)s[i].size()-1;j>=0;--j){
                if(s[i][j]=='(') cur++;
                else cur--;
                minbal=MAX(cur,minbal);
            }   
            ans2.pb({minbal,i});
        }
    }
    sort(ans1.begin(),ans1.end());
    sort(ans2.begin(),ans2.end());
    string fin="";
    for(int i=(int)ans1.size()-1;i>=0;--i){
        fin+=s[ans1[i].S];
    }
    for(int i=(int)ans2.size()-1;i>=0;--i){
        fin+=s[ans2[i].S];
    }
    int cur=0;
    for(int i=0;i<fin.size();++i){
        if(fin[i]=='(') cur++;
        else cur--;
        if(cur<0){
            cout<<"No"<<endl;
            return;
        }
    }
    if(cur==0){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
}

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // #endif
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 45160
def get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end
def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する
  return bool ? y : n 
end
def array(size,n=1,init=nil) #nに配列の次元数、sizeに配列の大きさ、initに初期値を投げることでその配列を返す
  if n==1
    return Array.new(size){init}
  else
    return Array.new(n).map{Array.new(size){init}}
  end
end

loop do
  word,type=get
  w_=word.split("_")
  new_word=[]
  if w_.size==1
    w_Nsp=word.split("")
    temp=""
    w_Nsp.each_with_index do|c,i|
      if i.nonzero? and c==c.upcase
        new_word.push(temp)
        temp=""
        temp+=c.downcase
      else
        temp+=c.downcase
      end 
    end
    new_word.push(temp)
    word=new_word
  else
    word=w_
  end
  case type
  when "X" then
    break
  when "L" then
    ans=word[0]
    word.shift
    word.each do|str|
      str_spl=str.split("")
      i=0
      str_spl.each do|c|
        if i.zero?
          ans+=c.upcase
          i+=1
        else
          ans+=c
        end
      end
    end
    puts ans
  when "U" then
    ans=""
    word.each do|str|
      str_spl=str.split("")
      i=0
      str_spl.each do|c|
        if i.zero?
          ans+=c.upcase
          i+=1
        else
          ans+=c
        end 
      end
    end
    puts ans
  when "D" then
    puts word.join("_")
  end
end


Measured memory_bytes: 7012
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
int main(){
	string str;
	cin >> str;
	int n = str.size();
	int ans = n;
	int S = 0;
	for (int i = 0; i < n; ++i)
	{
		if(str[i]=='S') S++;
		else if(S>0){
			ans-=2;
			S--;
		}
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
 
   string s;
   cin>>s;
   if(s[2]==s[3]&&s[4]==s[5]){
       cout <<"Yes"<<endl;
   }
   else{
       cout <<"No"<<endl;
   }
}

Measured memory_bytes: 256
import math
while True:
    n=int(input())
    if n==0:
        break
    s=list(map(int,input().split()))
    m=sum(s)/n
    S=0
    for i in range(n):
        S+=(s[i]-m)**2
    a2=math.sqrt(S/n)
    
    print('{:.8f}'.format(a2))


Measured memory_bytes: 5704
package main

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

var stdin = bufio.NewScanner(os.Stdin)

func main() {
	var is_div = false
	var c int
	_, a := func() int { stdin.Scan(); i, _ := strconv.Atoi(stdin.Text()); return i }(), scanArrayInt()
	for {
		for i, v := range a {
			a[i] = v / 2
			if v%2 != 0 {
				is_div = true
				break
			}
		}
		if is_div {
			fmt.Println(c)
			break
		}
		c++
	}
}

func scanArrayInt() []int {
	var ret = []int{}
	stdin.Scan()
	for _, s := range strings.Split(stdin.Text(), " ") {
		i, _ := strconv.Atoi(s)
		ret = append(ret, i)
	}
	return ret
}

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

cnt = 0
for i in A:
    if i < 0: cnt += 1

A_abs = list(map(abs, A))
minmum = min(A_abs)

if cnt % 2 == 0:
    ans = sum(A_abs)
else:
    ans = sum(A_abs) - 2*minmum

print(ans)

Measured memory_bytes: 14412
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a); i > (b); i--)
#define ALL(a) (a).begin(), (a).end()

int main() {
    int M;
    ll D = 0, S = 0;
    cin >> M;
    REP(i, M) {
        ll d, c;
        cin >> d >> c;
        D += c;
        S += d * c;
    }
    cout << D - 1 + (S - 1) / 9 << endl;
    return 0;
}

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

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  int ans=1, prev=a[0];
  for(int i=1;i<n;i++){
    if (prev < a[i]){
      ans++;
    }
    prev=a[i];
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main( ){
  for(int kai=0;kai<200;kai++){
    int a,b,c,d=0;
    
    if( scanf("%d %d",&a,&b) != 2){
      break;
    }
    
    c=a+b;
    while(1){
      if(c==0)break;
      c/=10;
      d++;
    }
    printf("%d\n",d);
  }
  return 0;
}

Measured memory_bytes: 2596
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include <iostream>
#include <string>
using namespace std;

class ARegistration {
public:
	void solve(std::istream& in, std::ostream& out) {
	    string a, b;
	    in >> a >> b;
        b.pop_back();
        if (a == b) {
            out << "Yes" << endl;
        } else {
            out << "No" << endl;
        }
	}
};


int main() {
	ARegistration solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 3632
S = input()
T = input()

def jud_capt(S, T):
    j = 0
    a = list('abcdefghijklmnopqrstuvwxyz')
    for i in S:
        if not i in a:
            j += 1
    if not T[-1] in a:
        j += 1
    return j

def jud_let(S):
    j = 0 if len(S) >= 1 and len(S) <= 10 else 1
    return j

def jud_len(S, T):
    j = 0 if len(T) == len(S)+1 and S == T[:-1] else 1
    return j

def main(S, T):
    j = jud_capt(S, T)
    k = jud_let(S)
    l = jud_len(S, T)
    o ='Yes' if j == k == l == 0 else 'No'
    print(o)

if __name__ == '__main__':
    main(S, T)
        

Measured memory_bytes: 9036
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PLL = pair<ll, ll>;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repn(i,n) for(int i = 0; i <= (int)(n); i++)
#define srep(i,l,n) for(int i = l; i < (int)(n); i++)
#define srepn(i,l,n) for(int i = l; i <= (int)(n); i++)
#define drep(i,n) for(int i = (int)(n-1); i >= 0; i--)
#define drepn(i,n) for(int i = (int)(n); i >= 0; i--)
#define size(s) (int)s.size()
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T = int> using V = vector<T>;
template<class T = int> using VV = vector<V<T>>;
bool isIn(int i, int j, int h, int w) {return i >= 0 && i < h && j >= 0 && j < w;}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void err() {cout << -1 << endl;}
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
#define ep emplace_back

const int MOD = 1000000007;
const int INF = 1e9;

#define PI acos(-1);
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, k;
    cin >> n >> k;
    V<ll> a(n);
    rep(i, n) cin >> a[i];
    V<ll> sum(n+1, 0);
    rep(i, n) sum[i+1] = sum[i] + a[i];
    ll ans = 0;
    V<ll> b;
    rep(i, n) srepn(j, i+1, n) {
        b.push_back(sum[j] - sum[i]);
    }
    drepn(i, 50) {
        V<ll> can;
        rep(j, size(b)) {
            if(1 & b[j] >> i) can.push_back(b[j]);
        }
        if(size(can) < k) continue;
        b = can;
    }
    ans = b[0];
    rep(i, k-1) {
        ans = ans & b[i+1];
    }
    cout << ans << endl;
}

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


void solve(std::string S, std::string T){
    int cnt = 0;
    for (int i = 0; i < S.size(); i++)
    {
        if (S[i] != T[i])
            cnt++;
    }
    cout << cnt << endl;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    std::string S;
    std::cin >> S;
    std::string T;
    std::cin >> T;
    solve(S, T);
    return 0;
}


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

int main ()
{
	int n;
	cin >> n;
	vector<int> a(n);

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

	sort(a.begin(), a.end(), [](int a, int b){ return a > b; });

	int alice = 0, bob = 0;
	for (int i=0; i<n; ++i)
	{
		(i & 1 ? bob : alice) += a[i];
	}

	cout << alice - bob << endl;
	return 0;
}

Measured memory_bytes: 256
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;
typedef long long ll;
typedef pair<int, int> Pint;
typedef pair<ll, ll> Pll;
#define rep(begin, i, end) for (ll i = begin; i < (ll)(end); i++)
#define all(v) v.begin(), v.end()
const int MOD = 1000000007;

ll gcd(ll a, ll b)
{
    if (a % b == 0)
    {
        return b;
    }
    return gcd(b, a % b);
}

// エラトステネスの篩による素数列挙
const int N = 1000000;
void eratosthenes(vector<int> &prime)
{
    rep(0, i, N) prime.at(i) = 1;
    prime.at(0) = prime.at(1) = 0;
    rep(0, i, N)
    {
        if (prime.at(i))
        {
            for (int j = i + i; j < N; j += i)
            {
                prime.at(j) = 0;
            }
        }
    }
}

// 素数判定
bool IsPrime(ll num)
{
    if (num < 2)
        return false;
    else if (num == 2)
        return true;
    else if (num % 2 == 0)
        return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (ll i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}

int main()
{
    ll A, B;
    cin >> A >> B;
    ll g = gcd(A, B);
    vector<int> prime(1000000);
    eratosthenes(prime);
    vector<ll> value;

    // 1000000までの素数の配列を生成
    rep(0, i, 1000000)
    {
        if (prime.at(i))
        {
            value.push_back(i);
        }
    }

    ll ans = 1;

    for (auto v : value)
    {
        if (g % v == 0)
        {
            ans++;
        }
    }

    // 10^6より大きい素因数が隠れていないかをあぶり出す
    for (auto v : value)
    {
        if (g % v == 0)
        {
            ll c = v;
            while (g % c == 0)
            {
                g /= c;
            }
        }
    }

    if (IsPrime(g) && (g > 1000000))
    {
        ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 5368
n =gets.to_i
arr = gets.chomp.split(' ').map(&:to_i)

result = 0
bool = true
while bool do
  arr.map! do |a|
    if a % 2 == 0
      a = a / 2
    else
      bool = false
    end
  end

  result += 1 if bool
end

puts result

Measured memory_bytes: 1788
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Jenish
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        APassword solver = new APassword();
        solver.solve(1, in, out);
        out.close();
    }

    static class APassword {
        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            int n = in.scanInt();
            out.println(n * n * n);
        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int INDEX;
        private BufferedInputStream in;
        private int TOTAL;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (INDEX >= TOTAL) {
                INDEX = 0;
                try {
                    TOTAL = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (TOTAL <= 0) return -1;
            }
            return buf[INDEX++];
        }

        public int scanInt() {
            int I = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    I *= 10;
                    I += n - '0';
                    n = scan();
                }
            }
            return neg * I;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }
}



Measured memory_bytes: 22868
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a) for(int i=0;i<(a);i++)
const ll MOD=1000000007;

ll dp[111][101010],V[101010];
int W[101010];

int main(){
  int N,WW; cin>>N>>WW;
  rep(i,N) cin>>W[i]>>V[i];
  ll ans=0;
  rep(i,N) rep(j,WW+1){
    dp[i+1][j]=max(dp[i+1][j],dp[i][j]);
    if(W[i]+j<=WW){
      dp[i+1][W[i]+j]=max(dp[i+1][W[i]+j],dp[i][j]+V[i]);
      ans=max(ans,dp[i+1][W[i]+j]);
    }
  }
  cout<<ans<<endl;
  return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define REP(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define FORR(i, a, b) for(int i=(b)-1; i>=(a); --i)

#define DEBUG(x) cout<<#x<<": "<<(x)<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '<<v[i];cout<<'\n'
#define ALL(a) (a).begin(), (a).end()

template<typename T> inline void CHMAX(T& a, const T b) {if(a<b) a=b;}
template<typename T> inline void CHMIN(T& a, const T b) {if(a>b) a=b;}

constexpr ll MOD=1000000007ll;
// constexpr ll MOD=998244353ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

const double EPS=1e-9;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)

int ans[4];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  // cout<<setprecision(10)<<fixed;
  int n;
  string s;
  cin>>n;
  REP(i, n){
    cin>>s;
    if(s=="AC"){
      ++ans[0];
    }
    else if(s=="WA"){
      ++ans[1];
    }
    else if(s=="TLE"){
      ++ans[2];
    }
    else{
      ++ans[3];
    }
  }
  cout<<"AC x "<<ans[0]<<'\n';
  cout<<"WA x "<<ans[1]<<'\n';
  cout<<"TLE x "<<ans[2]<<'\n';
  cout<<"RE x "<<ans[3]<<'\n';
  return 0;
}


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

///assic value of ('0'-'9') is(48 - 57) and (a-z) is (97-122) and (A-Z) is(65-90) and 32 for space
typedef long long int ll;
typedef pair<ll, ll> pii;
typedef vector<pii> vii;
#define  pb push_back
// #define f(i,a,b) for(ll i=a;i<b;i++)
#define f(i,a,b,c) for(ll i=a;i<b;i+=c)
#define fo(i,a,b) for(ll i = a; i<=b;i++)
#define rf(i,a,b)  for(ll i=a;i>=b;i--)
#define vll vector<ll>
#define tests() int test_cases ; cin >> test_cases ; while(test_cases--)
#define ub upper_bound
#define lb lower_bound
#define all(v) v.begin(),v.end()
#define MAXN 100010
#define MOD 1000000007
#define deb(x) cout << '>' << #x << ':' << x << endl;
#define sp " "
#define MS(x,y) memset(x,y,sizeof(x))
#define INF 1000000000000000000

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

    //tests(){}
    //v/ll fis;
    //cout<<fis.size();
    ll n;
    cin>>n;
    bool ans = true;
    vll a(n);
    for (int i = 0; i < n; ++i)
    {
    	cin>>a[i];
    	if (a[i]%2 == 0	)
    	{
    		if (a[i]%3 !=0 && a[i]%5!=0)
    		{
    			ans = false;
    		}
    	}
    }

  	if (ans)
  	{
  		cout<<"APPROVED"<<endl;
  	}
  	else cout<<"DENIED"<<endl;
    return 0;
}




Measured memory_bytes: 256
using System;
using System.Linq;

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {

            var s = DateTime.Parse(Console.ReadLine());
            
            if(s <= DateTime.Parse("2019/04/30"))
            {
                Console.WriteLine("Heisei");
            }
            else
            {
                Console.WriteLine("TBD");
            }
        }
    }
}


Measured memory_bytes: 13792
#include <iomanip>
#include <utility>
#include <algorithm>
#include <type_traits>
#include <set>
#include <string>
#include <iostream>
#include <fstream>
#include <cassert>
#include <memory>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <queue>
#include <vector>
#include <array>
#include <chrono>
#include <random>
#include <forward_list>
#include <iomanip>
#include <functional>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <sstream>
#include <numeric>

using namespace std;
#define MFOR(i,end) for(size_t i = 0, end_##i = (end); i < end_##i; ++i)

size_t M, N;
char S[2500];
char T[2500];
enum class Mode_T : int8_t {
	none = 0, I, O
};
int dp[2010][2010][3];
int func(int spos, int tpos, Mode_T last)
{
	if (S[spos] == '\0' && T[tpos] == '\0') { return -2010 * 2010 * 3; }
	if (dp[spos][tpos][(int8_t)last] != -1) {
		return dp[spos][tpos][(int8_t)last];
	}
	int max = -2010* 2010*3;
	if (last == Mode_T::none) {
		if (S[spos] == 'I') {
			max = std::max(max, 1 + std::max(0, func(spos + 1, tpos, Mode_T::I)));
		}
		if (S[spos] != '\0')max = std::max(max, 0 + func(spos + 1, tpos, Mode_T::none));
		if (T[tpos] == 'I') {
			max = std::max(max, 1 + std::max(0, func(spos, tpos + 1, Mode_T::I)));
		}
		if (T[tpos] != '\0')max = std::max(max, 0 + func(spos, tpos + 1, Mode_T::none));
	}
	else if (last == Mode_T::I)
	{
		if (S[spos] == 'O') {
			auto snpos = spos + 1;
			if (S[snpos] == 'I') {
				max = std::max(max, 2 + std::max(0, func(snpos + 1, tpos, Mode_T::I)));
			}
			if (T[tpos] == 'I') {
				max = std::max(max, 2 + std::max(0, func(snpos, tpos + 1, Mode_T::I)));
			}
		}
		if (T[tpos] == 'O') {
			auto tnpos = tpos + 1;
			if (S[spos] == 'I') {
				max = std::max(max, 2 + std::max(0, func(spos + 1, tnpos, Mode_T::I)));
			}
			if (T[tnpos] == 'I') {
				max = std::max(max, 2 + std::max(0, func(spos, tnpos + 1, Mode_T::I)));
			}
		}
	}
	else if (last == Mode_T::O)
	{
		assert(false);
		if (S[spos] == 'I') {
			max = std::max(max, 1 + std::max(0, func(spos + 1, tpos, Mode_T::I)));
		}
		if (T[tpos] == 'I') {
			max = std::max(max, 1 + std::max(0, func(spos, tpos + 1, Mode_T::I)));
		}
	}
	return dp[spos][tpos][(int8_t)last] = max;
}

int main()
{
	for (auto& arr2 : dp)for (auto& arr1 : arr2)for (auto& i : arr1) {
		i = -1;
	}
	std::cin >> M >> N;
	std::cin >> S >> T;
	std::cout << std::max(0, func(0, 0, Mode_T::none)) << std::endl;
}

Measured memory_bytes: 50744
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=(ll)1e9+7;
const ll INF=(ll)1e18+10;

int main() {
    int N,M; cin>>N>>M;

    queue<int> A[310];
    int a;
    for (int i = 0; i < N; ++i) {
        for (int j = 0; j < M; ++j) {
            cin>>a; --a;
            A[i].push(a);
        }
    }

    vector<bool> del(M,false);

    int ans=N;

    for (int i = 0; i < M-1; ++i) {
        int cnt[310]={0};
        for (int j = 0; j < N; ++j) {
            cnt[A[j].front()]++;
        }
        int maxi=-1,maxino=-1;
        for (int j = 0; j < M; ++j) {
            if(cnt[j]>maxi){
                maxi=cnt[j];
                maxino=j;
            }
        }
        ans=min(ans,maxi);
        del[maxino]=true;
        for (int j = 0; j < N; ++j) {
            while(del[A[j].front()]) A[j].pop();
        }
    }

    cout<<ans<<endl;

    return 0;
}


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

// 小数点以下桁数
// fixed << setprecision(i)

int64_t gcd(int64_t a,int64_t b){return (a%b==0?b:gcd(b, a%b));}
int64_t lcm(int a,int b){return (int64_t)a*b/gcd(a, b);}
int factorial(int a){int b=1;while(a){b*=a--;}return b;} //13以下対応
bool is_prime(int a){if(a<=1)return false;for(int i=2;(int64_t)i*i<=a;i++){if(a%i==0)return false;}return true;}
int get_adp(double x, int n){return (int)round((x-(int)x)*pow(10,n))%10;} // 小数点以下の指定桁の値を取得
int64_t sigma(int64_t s, int64_t n){return n*(2*s+n-1)/2;}

//順列の全列挙
// vector<int> v(N);
// iota(v.begin(), v.end(), 1);       // v に 1, 2, ... N を設定
// do {
//	for(auto x : v) cout << x << " "; cout << "\n";     // v の要素を表示
// } while( next_permutation(v.begin(), v.end()) ); 

//bit全探索
// for (int tmp = 0; tmp < (1 << ビット数); tmp++) {
//	bitset<ビット数> s(tmp);
//	// (ビット列sに対する処理)
// }

int main()
{
	int n, ans = 0, h_min, left;
	pair<int, int> temp_pair;

	cin >> n;
	vector<int> h(n);
	queue<pair<int, int>> q;

	for (int i = 0; i < n; i++)
		cin >> h[i];
	q.push(make_pair(0, n - 1));
	while (!q.empty())
	{
		temp_pair = q.front();
		q.pop();
		if (temp_pair.first == temp_pair.second)
		{
			ans += h[temp_pair.first];
			// cout << h[temp_pair.first] << endl;
			continue;
		}
		left = temp_pair.first;
		h_min = h[left];
		for (int i = left + 1; i <= temp_pair.second; i++)
			h_min = min(h_min, h[i]);
		ans += h_min;
		for (int i = left; i <= temp_pair.second; i++)
		{
			if (h[i] == h_min)
			{
				if (i != left)
					q.push(make_pair(left, i - 1));
				left = i + 1;
			}
			else if (i == temp_pair.second)
				q.push(make_pair(left, i));
			h[i] -= h_min;
		}
		// for (int i = temp_pair.first; i <= temp_pair.second; i++)
		// 	cout << h[i] << " ";
		// cout << endl;
	}
	cout << ans << endl;
}


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

namespace {
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define len(x) (int)((x).size())
#define X first
#define Y second

#define FOR(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
  
typedef long long int ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
template<typename T> using minpq = priority_queue<T, vector<T>, greater<T>>;

ll expmod(ll a,ll b,ll mod) {ll res=1;a%=mod;for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
template<typename T> T sqr(const T& x) { return x*x; }
ll flog(const ll x) { return 63 - __builtin_clzll(x); }
template<typename T> void sort(T& t) { sort(all(t)); }
template<typename T> void undupe(vector<T>& v) { sort(v); v.erase(unique(all(v)), v.end()); }

struct _IOS { _IOS() { ios::sync_with_stdio(0); cin.tie(0); } } _IOS;
}

const ll MOD = 1e9 + 9;
const ll INF = 1e15;
const double EPS = 1e-8;

int main() {
	ll N, C, K; cin >> N >> C >> K;
	vector<ll> T(N);
  for (auto& x : T) cin >> x;
  sort(T);
  
  int ans = 0;
  FOR(i,0,N) {
    ans++;
    ll start = T[i], onboard = 1;
    while (i < N-1 && T[i+1] <= start+K && onboard < C) i++, onboard++;
  }
	
  cout << ans << "\n";
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
using namespace std;

int main() {
  int n,nt=0,nx=0,ny=0;
  cin >> n;
  rep(i,n){
    int t,x,y;
    cin >> t >> x >> y;
    int restTime = t-nt-abs(nx-x)-abs(ny-y);
    if(restTime<0||restTime%2==1){
      cout << "No" << endl;
      return 0;
    }else{
      nt = t;nx = x;ny = y;
    }
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 384
package main

import (
	"fmt"
)

func main() {
	var n, x, t int

	fmt.Scanf("%d %d %d", &n, &x, &t)
	num := n / x

	m := n % x
	if m > 0 {
		num++
	}
	fmt.Println(num * t)
}


Measured memory_bytes: 1832
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2005;
const int INF = 0x3f3f3f3f;
int A[MAXN];
int B[MAXN]; int cnt = 0;
int ans;
int N, K, Q;


void solve(int x) {
	vector<int> tmp, all;
	for(int i = 1; i <= N; ++i) {
		if(A[i] >= x) tmp.push_back(A[i]);
		else if((int)tmp.size() >= K){
			sort(tmp.begin(), tmp.end());
			for(int j = 0; j < (int)tmp.size() - K + 1; ++j) 
				all.push_back(tmp[j]);
			tmp.clear();
		} else tmp.clear();
	}
	if((int)tmp.size() >= K){
		sort(tmp.begin(), tmp.end());
		for(int j = 0; j < (int)tmp.size() - K + 1; ++j) 
			all.push_back(tmp[j]);
		tmp.clear();
	}
//	printf("%d\n", (int)all.size());
	
	if((int)all.size() < Q) return;

	sort(all.begin(), all.end());
//	printf("%d\n", all[0]);
	ans = min(ans, all[Q - 1] - all[0]);
}
int main() {
//	freopen("in.txt", "r", stdin);
	while(~scanf("%d %d %d", &N, &K, &Q)) {
		cnt = 0;
		for(int i = 1; i <= N; ++i) {
			scanf("%d", &A[i]);
			B[cnt ++] = A[i];
		}
		sort(B,B + cnt);
		cnt = unique(B, B+cnt) - B;
		
		ans = INF;
		for(int i = 0; i < cnt; ++i) {
			solve(B[i]);
		}
		printf("%d\n", ans);
	}
	return 0;
}


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

#ifdef ONLINE_JUDGE
#define lld I64
#endif

#define endl '\n'
#define ii pair<int,int>
#define ll long long
#define vi vector<int>
#define vii vector<ii>
#define vvi vector<vi>
#define add push_back

ll sum(ll n){
    return (n*(n+1))/2;
}

int bb(int n){
    int lo=1, hi=n, mid;
    while(lo<hi){
        mid = (lo+hi)/2;
        if(sum(mid)>=n) hi=mid;
        else lo=mid+1;
    }

    return lo-(sum(lo)>n);
}

int main(){ios_base::sync_with_stdio(false);

    ll n;
    cin >> n;
    
    int ans=0;
    for(ll i=2; i*i<=n; ++i){
        int cnt=0;
        while(n%i==0){
            n/=i;
            ++cnt;
        }
        ans += bb(cnt);
    }
    ans += (n>1);
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3636
n = int(input())
S=[0]*n
for i in range(n):
  S[i]=input()

ac =0
wa =0
tle =0
re =0


for i in range(n):
  if S[i]=='AC':
    ac +=1
  elif S[i]=='WA':
    wa +=1
  elif S[i]=='TLE':
    tle +=1
  elif S[i]=='RE':
    re +=1

print('AC x ',ac)
print('WA x ',wa)
print('TLE x ',tle)
print('RE x ',re)


Measured memory_bytes: 15996
n,a,b = map(int, input().split())

if n == 1 and a == b:
  print(1)
elif n == 1:
  print(0)
elif a > b:
  print(0)
elif n == 2:
  print(1)	
elif n > 2:
  print( b * (n-2) - a * (n-2) + 1) 
else:
  print(0)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define inf 1e9
#define cmax(a,b) a=max(a,b)
#define cmin(a,b) a=min(a,b)
typedef pair<int,int> mypair;
int main(){
	while(1){
	int n;
	cin>>n;
	if(n==0)break;
	vector<vector<int> > g(11,vector<int> (11,inf) );
	for(int i=0;i<11;i++)g[i][i] = 0;
	int v=0;
	for(int i=0;i<n;i++){
	int a,b,c;
	cin>>a>>b>>c;
	cmax(v,a);
	cmax(v,b);
	g[a][b] =g[b][a]=c;
	}
	for(int k=0;k<=v;k++)
		for(int i=0;i<=v;i++)
			for(int j=0;j<=v;j++)cmin(g[i][j] ,g[i][k]+g[k][j]);
	vector<int> used(v+1,0);
	for(int i=0;i<=v;i++)for(int j=0;j<=v;j++)used[i]+=g[i][j];

	
	mypair ans = mypair(used[0],0);
	for(int i=1;i<=v;i++)cmin(ans,mypair(used[i],i));
	cout<<ans.second<<' '<<ans.first<<endl;
	}
	return 0;
}



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

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

ll calcNumOfCombination(ll n, ll r) {
    ll num = 1;
    for (ll i = 1; i <= r; i++) {
        num = num * (n - i + 1) / i;
    }
    return num;
}

int gcd(int x, int y) { return (x % y) ? gcd(y, x % y) : y; }

int findSumDigits(int s) {
    int num = 0;
    int temp = 0;
    while (s) {
        temp = s % 10;
        num += temp;
        s = s / 10;
    }
    return num;
}

int main() {
    int n;
    cin >> n;
    int a[n - 1];
    rep(i, n - 1, 0) cin >> a[i];

    int ans[n];
    rep(l, n, 0) ans[l] = 0;
    int digit=0;
    for (int j = 0; j < n - 1; j++) {
        digit=a[j];
        ans[digit-1]++;
    }

    int temp = 0;
    for (int k = 0; k < n; k++) {
        temp = ans[k];
        cout << temp << endl;
    }

    return 0;
}

Measured memory_bytes: 5156
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
#define int long long int
#define ld long double
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define removeDuplicates(a) a.resize(unique(all(a))-a.begin())
#define endl '\n'	
#define setbits(x) (__builtin_popcount(x))
int mod=1000000007;
int INF64=mod*mod+1;

vector<int> a;
// vector<int> sz;

int root(int i){
	while(i!=a[i]){
		a[i]=a[a[i]];
		i=a[i];
	}
	return i;
}

void join(int i, int j){
	int r1=root(i),r2=root(j);
	// if(r1==r2)	return;
	// if(sz[r2]>sz[r1])
	// 	swap(r1,r2);
	// sz[r1]+=sz[r2];
	a[r2]=r1;
}

void solve(){
	int n,m;
	cin>>n>>m;
	a.assign(n+1,1);
	// sz.assign(n+1,1);

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

	while(m--){
		int u,v;
		cin>>u>>v;
		join(u,v);
	}

	set<int> s;
	for(int i=1;i<=n;i++)
		s.insert(root(a[i]));

	cout<<(int)s.size()-1;
}

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

	int T;
	// cin>>T;
	T=1;
	for(int i=1;i<=T;i++){
		// cout<<"Case #"<<i<<": ";
		solve();
	}
	cerr<<"Time : "<<1000*((double)clock())/(double)CLOCKS_PER_SEC<<"ms\n";
}

Measured memory_bytes: 7828
#include <algorithm>
#include <boost/optional.hpp>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define REP(i, n) for(int i = 0, i##_MACRO = (n); i < i##_MACRO; i++)
#define RANGE(i, a, b) for(int i = (a), i##_MACRO = (b); i < i##_MACRO; i++)
#define EACH(e, a) for(auto&& e : a)
#define ALL(a) std::begin(a), std::end(a)
#define RALL(a) std::rbegin(a), std::rend(a)
#define FILL(a, n) memset((a), n, sizeof(a))
#define FILLZ(a) FILL(a, 0)
#define INT(x) (static_cast<int>(x))
#define PRECISION(x) std::fixed << std::setprecision(x)

using namespace std;

using ll = long long;
using VI = vector<int>;
using VI2D = vector<vector<int>>;
using VLL = vector<long long>;
using VLL2D = vector<vector<long long>>;

constexpr int INF = 2e9;
constexpr double EPS = 1e-10;
constexpr double PI = acos(-1.0);

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

template <typename T>
constexpr int sign(T x) {
	return x < 0 ? -1 : x > 0 ? 1 : 0;
}

template <>
constexpr int sign(double x) {
	return x < -EPS ? -1 : x > EPS ? 1 : 0;
}

template <typename T, typename U>
constexpr void chmax(T& m, U x) {
	m = max(m, x);
}

template <typename T, typename U>
constexpr void chmin(T& m, U x) {
	m = min(m, x);
}

template <typename T>
constexpr T square(T x) {
	return x * x;
}

template <typename T>
std::unordered_map<T, size_t> group_count(std::vector<T>& v) {
	std::unordered_map<T, size_t> c;
	for(T& e : v) {
		c[e]++;
	}
	return c;
}

int main() {
	int n;
	cin >> n;
	VLL a(n);
	REP(i, n) { cin >> a[i]; }

	VLL s(n);
	REP(i, n) { s[i] = (i == 0 ? 0 : s[i - 1]) + a[i]; }
	std::unordered_map<ll, size_t> group = group_count(s);
	ll result = 0;
	EACH(e, group) {
		if(e.first == 0) {
			result += e.second * (e.second - 1) / 2 + e.second;
		} else {
			result += e.second * (e.second - 1) / 2;
		}
	}

	cout << result << endl;
	return 0;
}


Measured memory_bytes: 14536
#include <stdio.h>

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

using ll = long long;
using ld = long double;

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

  int n;
  cin >> n;
  ll ans = 0;
  for (int i = 1; i <= n; ++i) {
    if (i % 3 && i % 5) {
      ans += i;
    }
  }
  cout << ans;
}


Measured memory_bytes: 3188
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define M 10000
#define E 500000
  
typedef struct edge {
    int from, to, cost;
} Ed;
Ed e[E];
int d[M];
  
void sp(int,int);
 
int main(int argc,char* argv[])
{
    int vn, en, an;
    int i, j, vi;
    scanf("%d", &vn);
  
    en=0;
    for(i=0; i<vn; i++) {
        scanf("%d", &vi);
        scanf("%d", &an);
        for(j=1; j<=an; j++) {
            e[en].from=vi;
            scanf("%d %d", &e[en].to, &e[en].cost);
            en++;
        }
    }
      
    sp(vn, en);
    for(i=0; i<vn; i++) {
        printf("%d %d\n", i, d[i]);
    }
    return 0;
}
void sp(int vn, int en)
{
    int i, new=1;
    for(i=1; i<vn; i++) d[i]=INT_MAX;
      
    while(new) {
        new=0;
        for(i=0; i<en; i++) {
            if(d[e[i].from] !=INT_MAX && d[e[i].from]+e[i].cost < d[e[i].to]) {
                d[e[i].to] = d[e[i].from]+e[i].cost;
                new++;
            }
        }
    }
}

Measured memory_bytes: 6456
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int SC = 0, FC = 0;

		for(int i = 0; i < 3; i++) {
			int tmp = sc.nextInt();

			if(tmp == 5)
				FC++;
			else if(tmp == 7)
				SC++;

		}

		String ans = "NO";
		if(FC == 2 && SC == 1)
			ans = "YES";

		System.out.println(ans);
		return;

	}

}



Measured memory_bytes: 20820
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#include <random>
#include <unordered_map>
#include <unordered_set>
#define all(a) a.begin(),a.end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define pb push_back
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
typedef complex<ld> com;
constexpr int inf = 1000000010;
constexpr ll INF = 1000000000000000010;
constexpr ld eps = 1e-12;
constexpr ld pi = 3.141592653589793238;
template<class T, class U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if (a > b) { a = b; return true; } return false; }


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

	int n, m;
	cin >> n >> m;
	ll k;
	cin >> k;
	vector<ll> a(n), b(m);
	rep(i, n) cin >> a[i]; rep(i, m) cin >> b[i];
	vector<ll> x(n + 1), y(m + 1);
	rep(i, n) x[i + 1] = x[i] + a[i];
	rep(i, m) y[i + 1] = y[i] + b[i];
	y.pb(INF);
	int ans = 0;
	rep(i, n + 1) {
		if (x[i] > k) continue;
		int t = upper_bound(all(y), k - x[i]) - y.begin();
		chmax(ans, i + t - 1);
	}
	cout << ans << '\n';
}


Measured memory_bytes: 11088
import sys
input = sys.stdin.readline
n,m=map(int,input().split())
edge = [[] for i in range(m)]
for i in range(m):
  a,b,c=map(int,input().split())
  edge[i]=[a-1,b-1,-c]
d=[float("inf")]*n
d[0]=0

for _ in range(n):
  for i in range(m):
    e0,e1,e2=edge[i]
    d[e1]=min(d[e1],d[e0]+e2)
ans1=d[-1]
for _ in range(n):
  for i in range(m):
    e0,e1,e2=edge[i]
    if d[e1]>d[e0]+e2:
      d[e1]=-float("inf")
ans2=d[-1]
print("inf" if ans1!=ans2 else -ans1)


Measured memory_bytes: 43868
#include<iostream>
using namespace std;
int main(){
    int A[100][100],B[100],C[100],n,m;
    cin>>n>>m;
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            cin>>A[i][j];
        }
    }
    for(int i=0;i<m;i++){
        cin>>B[i];
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            C[i]+=A[i][j]*B[j];
        }
    }
    for(int i=0;i<n;i++){
        cout<<C[i]<<endl;
    }
    return 0;
}


Measured memory_bytes: 3132
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
using namespace std;

int main(){
    int a,b,c;
    int n[3];
    cin >> a >> b >> c;
    n[0]=a;
    n[1]=b;
    n[2]=c;
    sort(n,n+3);
    cout << n[0] << " " << n[1] << " " << n[2] << endl;
    return 0;
}



Measured memory_bytes: 3152
import numpy as np
H,W=map(int,input().split(' '))
S = (np.array([list(input()) for i in range(H)])=='#')*1
flg=[[float("inf")]*W for i in range(H)]
flg[0][0]=S[0][0]

for i in range(H):
    for j in range(W):
        if i<H-1:
            if S[i][j]==0 and S[i+1][j]==1:
                flg[i+1][j] = min(flg[i][j]+1,flg[i+1][j])
            else:
                flg[i+1][j] = min(flg[i][j],flg[i+1][j])
        if j<W-1:
            if S[i][j]==0 and S[i][j+1]==1:
                flg[i][j+1] = min(flg[i][j]+1,flg[i][j+1])
            else:
                flg[i][j+1] = min(flg[i][j],flg[i][j+1])
print(flg[-1][-1])

Measured memory_bytes: 16636
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
	int count = 0;
	string a;
	cin >> a;
	for (int i = 0; i < 6; i++) {
		if (a[i] == '1')count++;
	}
	cout << count << endl;
	int x;
	cin >> x;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream> //入出力
#include <stdio.h>
#include <map>
#include <set>
#include <string>
#include <math.h> //算術演算子
#include <vector>
#include <cstdlib>
#include <queue>
#include <stack>
#include <list>
#include <iomanip> //小数点以下を表示させる(setprecision())
//#include <bits/stdc++.h>
using namespace std;
typedef long long ll; //64bit型

#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cerr << x << " " \
                      << "(L:" << __LINE__ << ")" << '\n'
#define PRINT(V)                                   \
        {                                          \
                for (int i = 0; i < V.size(); i++) \
                {                                  \
                        cout << V[i] << " ";       \
                }                                  \
                cout << endl;                      \
        }

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

int main()
{
        //input->compute->output//

        int N;
        cin >> N;

        for (int i = 1; i < (int)1e5; i++)
        {
                if (i * i > N)
                {
                        cout << (i - 1) * (i - 1) << endl;
                        return 0;
                }
        }

        return 0;
}


Measured memory_bytes: 256
#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>
#include<stdio.h>
#include <cstdint>
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;


string s;
int n[100002], tmp1, tmp2, tmp3, tmp4, tmp5;

int main() {

	cin >> s;
	rep(i, s.size()) {
		if (s[i] == 'R') {
			if (tmp2 != 0) {
				tmp3 = tmp2 / 2;
				tmp4 = tmp2 / 2;
				if (tmp2 % 2 == 1) {
					tmp3++;
				}
				n[tmp5] += tmp3;
				n[tmp5 - 1] += tmp4;
				tmp2 = 0;
			}
			tmp1++;
		}
		else {
			if (tmp1 != 0) {
				tmp3 = tmp1 / 2;
				tmp4 = tmp1 / 2;
				if (tmp1 % 2 == 1) {
					tmp3++;
				}
				n[i - 1] += tmp3;
				n[i] += tmp4;
				tmp1 = 0;
				tmp5 = i;
			}
			tmp2++;
		}
	}
	tmp3 = tmp2 / 2;
	tmp4 = tmp2 / 2;
	if (tmp2 % 2 == 1) {
		tmp3++;
	}
	n[tmp5] += tmp3;
	n[tmp5 - 1] += tmp4;


	rep(i, s.size())cout << n[i] << " ";
	cout << endl;

	return 0;
}


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

int main(){
  int N, AliceScore=0, BobScore=0;
  int a[100];
  cin >> N;
  for(int i=0; i<N; ++i) cin >> a[i];
  
  sort(a, a+N, greater<int>());
  for(int i=0; i<N-1; i += 2) {
    AliceScore += a[i];
    BobScore += a[i+1];
  }
  if(N%2 == 1) AliceScore += a[N-1];
  cout << AliceScore-BobScore << endl;
  return 0;
  
}

Measured memory_bytes: 256
#ifdef LOCAL
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstring>
#else
#include <bits/stdc++.h>
#endif
using namespace std ;

typedef long long ll ;
#define rep(i , n ) for ( int i =0; i < n ; i++)
#define _sort(arg) sort(begin(arg), end(arg))
#define MOD 1000000007
#define pb push_back
#define DEBUG(x) cout << #x << ": " << x << endl;

/*
__attribute__((constructor))
void initial()
{
	cin.tie(NULL);
	ios::sync_with_stdio(false);
}
*/

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

	int K, X;
	
	cin >> K >> X;

	int start = X - K +  1;
	int end = X + K - 1;

	rep(i, 2 * K - 1)
	{
		cout << start + i << " "; 
	}

	cout << endl;

	
	return 0;
}


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

a_sort = sorted(a)[::-1]
Alice = 0
Bob = 0
for i in range(0,N):
	if i%2 == 0:
		Alice += a_sort[i]
	if i%2 == 1:
		Bob += a_sort[i]

print(Alice-Bob)


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

int main() {
  ll n;cin>>n;
  string s;
  while(n){
    n--;
    s+=(char)('a'+n%26);
    n/=26;
  }
  reverse(all(s));
  cout<<s<<endl;
}

Measured memory_bytes: 3596