akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/range/adaptor/reversed.hpp>

using namespace std;
typedef long long int ll;

#define PI (acos(-1))
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define dumparr(x) cerr << #x ; for(auto elem: x){cerr << " " << elem;} cerr << endl;
#define dumppairs(x) cerr << #x ; for(auto elem: x){cerr << "(" << elem.first << " " << elem.second << ") ";} cerr << endl;
#define dumpline cerr << "**********************" << endl;
#define dumpwline(x) cerr << "******** " << #x << "=" << (x) << " ********" << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

vector <int> min_cost(4097, 1e9+1);
vector<pair <int, int>> keys;

int get_min_cost(int val){
    if (min_cost[val] < 1e9+1){
        return min_cost[val];
    }
    if (val == 0){
        min_cost[val] = 0;
        return 0;
    }
    int mcost = 1e9;
    for (auto k: keys){
        int c = val & (~k.second);
        if (c >= val){
            continue;
        }
        int cand = k.first + get_min_cost(c);
        mcost = min(mcost, cand);
    }
    min_cost[val] = mcost;
    return mcost;
}



int main(void){
    int n; cin >> n;
    int m; cin >> m;
    REP(i, m){
        int a; cin >> a;
        int b; cin >> b;
        int val = 0;
        REP(j, b){
            int c; cin >> c;
            val += int(pow(2, c-1));
        }
        keys.push_back({a, val});
    }
    int ret = get_min_cost(pow(2, int(n)) - 1);
    if (ret == 1e9){
        cout << -1 << endl;
    } else {
        cout << ret << endl;
    }
    return 0;
}

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

int main(){
  int a,b;
  cin >> a >> b;
  if(a==1&&b==2){
    cout << 3 << endl;
  }else if(a==1&&b==3){
    cout << 2 << endl;
  }else if(a==2&&b==1){
    cout << 3 << endl;
  }else if(a==2&&b==3){
    cout << 1 << endl;
  }else if(a==3&&b==1){
    cout << 2 << endl;
  }else{
    cout << 1 << endl;
  }
}

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

int main()
{
    int n, k;
    cin >> n >> k;
    int r, s, p;
    cin >> r >> s >> p;
    string t;
    cin >> t;
    vector<bool> prev(n, true);
    repl(i, k, n) {
        if(t[i - k] == t[i] && prev[i - k]) prev[i] = false;
    }
    int ans = 0;
    rep(i, n) {
        if(t[i] == 'r' && prev[i]) ans += p;
        if(t[i] == 's' && prev[i]) ans += r;
        if(t[i] == 'p' && prev[i]) ans += s;
    }
    cout << ans << endl;
    return 0;
}


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

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

  bool state = true;
  for (int i = 0; i < S.size() - 1; i++) {
    if (S[i] == S[i + 1]) {
      state = false;
      break;
    }
  }
  if (state) printf("Good");
  else printf("Bad");
  
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <stack>
#include <complex>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
#include <cfloat>
#include <math.h>
#include <numeric>
#include <string.h>
#include <sys/time.h>
#include <random>


#define fs first
#define sc second

using namespace std;

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



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

    bool oneExist = false;
    for(int i = 0; i < n; i++){
        char c; cin >> c;
        a[i] = c - '1';
        if(a[i] == 1){
            oneExist = true;
        }
    }

    for(int i = 0; i < n; i++){
        if(oneExist){
            if(a[i] == 2)   a[i] = 0;
        }
        else{
            if(a[i] == 2)   a[i] = 1;
        }
    }

    int res = 0;
    for(int i = 0; i < n; i++){
        if(a[i] == 1){
            int x = n-1, y=i;
            int z = x ^ y ^ (x-y);
            int count1 = 0;
            for(int j = 0; j < 31; j++){
                if((z >> j) % 2 == 1){
                    count1++;
                }
            }

            int x2 = i;
            int count2 = 1;

            if(count1 == 0 && count2 == 0){   // 両方奇数
                res+=2;
            }
            else if(count1 > 0 && count2 > 0){   // 両方偶数
                res+=2;
            }
            else{
                res++;
            }
        }
    }

    int ans;
    if(oneExist){
        ans = 1;
    }
    else{
        ans = 2;
    }

    if(res % 2 == 1){
        cout << ans << endl;
    }
    else{
        cout << 0 << endl;
    }


    return 0;
}


Measured memory_bytes: 4096
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		Set<String> set = new HashSet<>();
		int n = scan.nextInt();
		for (int i = 0; i < n; i++) {
			set.add(scan.next());
		}
		System.out.println(set.size());
	}

}


Measured memory_bytes: 76952
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001001001001
#define mod 1000000007
#define mod2 998244353
#define pi acos(-1)
#define all(v) v.begin(),v.end()
int main(){
    ll N,a,b;cin>>N>>a>>b;
    ll l=a+b;
    ll tmp=0;
    ll ans=0;
    ans+=a*(N/l);
    tmp=N%l;
    if(tmp>=a){
        ans+=a;
    }else{
        ans+=tmp;
    }
    cout<<ans<<endl;
}

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

int main() {
    int i, N;

    cin >> N;
  if (N % 10 == 0 || N % 10 == 1 || N % 10 == 6 || N % 10 == 8)
    cout << "pon";
  else if (N % 10 == 3)
    cout << "bon";
  else
    cout << "hon";
  
    
    

}

Measured memory_bytes: 3588
//master
import java.io.*;
import java.util.*;
public class Main {
    static int[][] memo;
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        double a = sc.nextDouble();
        double b = sc.nextDouble();
        double c = sc.nextDouble();
        double d = sc.nextDouble();
        double t = a;
        double o = c;
        double f = 0;
        while(t > 0 && o>0) {
            if(f%2==0) o -= b;
            else t -= d;
            f++;
        }
        if(o<=0) p("Yes");
        else p("No");
    }

    public static <T> void p(T message) {
        System.out.println(message);
    }

    public static <T> void pe(T message) {
        System.err.println(message);
    }

    public static <T> void pp(T message) {
        System.out.print(message);
    }
    
}
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
 
    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }
 
    private boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }
 
    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }
 
    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
 
    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
 
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }
 
    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


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

using namespace std;

map <int,int> m;
map <int,int>::iterator it;
int N,X;

inline int abs(int x, int y) {
    if(x - y >= 0)
        return x - y;
    return -1 * (x - y);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> N;
    for(int i = 1; i <= N; ++i) {
        cin >> X;
        m[X]++;
    }
    int S = N;
    for(it = m.begin(); it != m.end(); ++it) {
        S -= it -> second;
        if(S == N / 2) {
            cout << abs(it -> first - (++it) -> first);
            return 0;
        } else if(S < N / 2)
            break;
    }
    cout << 0;
    return 0;
}


Measured memory_bytes: 3200
#include<bits/stdc++.h>
using namespace std;
int a[200000],b[200000];
int main()
{
	long long n;
	cin>>n;
	int maxl=0;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		b[i]=a[i];
		maxl=max(maxl,a[i]);
	}
	int sum=0;
	for(int i=0;i<n;i++)
	{
		if(a[i]==maxl)
		{
			sum++;
		}
		if(sum==2)
		{
			for(int i=0;i<n;i++)
			{
				cout<<maxl<<endl;
			}
			return 0;
		}
	}	
	
	sort(b,b+n);
	for(int i=0;i<n;i++)
	{
		if(a[i]!=maxl)
		{
			cout<<maxl<<endl;
	 	}
		else
		{
			cout<<b[n-2]<<endl;
		}
	}
}

Measured memory_bytes: 3200
#include <math.h>

#include <algorithm>
#include <array>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <queue>
#include <sstream>
#include <vector>

using namespace std;
using Graph = vector<vector<int>>;

typedef pair<int, int> P;
using ll = long long;
const int INF = 1e8;

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

  Graph G(N + 1);
  for (int i = 0; i < M; ++i) {
    int a, b;
    cin >> a >> b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  vector<int> ans(N + 1, -1);
  vector<int> dist(N + 1, -1);
  queue<int> que;
  int s = 1;
  ans[s] = 0;
  que.push(s);

  while (!que.empty()) {
    int v = que.front();
    que.pop();
    for (auto nv : G[v]) {
      if (dist[nv] == -1) {
        dist[nv] = dist[v] + 1;
        ans[nv] = v;
        que.push(nv);
      }
    }
  }
  cout << "Yes" << endl;
  for (int i = 2; i < N + 1; i++) {
    cout << ans[i] << endl;
  }

  return 0;
}


Measured memory_bytes: 10652
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0; i < (n); ++i)
#define repA(i, a, n) for(ll i = a; i < (n); ++i)
#define repD(i, a, n) for(ll i = a; i > (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (long long) (x).size()
#define fill(a) memset(a, 0, sizeof(a))
#define fst first
#define snd second
// #define mp make_pair
#define pb push_back
// #define endl "\n"
#define MAXN 5000000
const long double PI = 3.141592653589793238462643383;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long int> vll;
typedef vector<double> vd;
typedef vector<pii> vii;
int Ceil(int a, int b){
    if(a%b==0) return a/b;
    else return (a/b)+1;
}
ll p=1000000007;
float E = 0.00000000000001;
ll power(ll x, ll y){
    if(y==0){
        return 1;
    }
    if(y%2==0){
        ll q=power(x,y/2);
        q=q%p;
        return (q*q)%p;
    }
    ll q=power(x,y/2);
    q=q%p;
    return ((x%p)*((q*q)%p))%p; 
}
bool sortbysec(const pair<int,int> &a, 
              const pair<int,int> &b) 
{ 
    return (a.second < b.second); 
}

bool isPowerOfTwo (int x)  
{  
    /* First x in the below expression is for the case when x is 0 */
    return x && (!(x&(x-1)));  
}  

long long int gcd(long long int a, long long int b){ 
    if (a == 0) 
        return b;  
    return gcd(b % a, a); 
}
long long int mod(long long int a, long long int b) {
    long long int ret = a%b; return ret>=0? ret: ret+b; 
}


long long int rec(long long int num, vector <long long int> &dp){
        if(num == 1)
            return 0;
        if(dp[num] != -1)
            return dp[num];
        else if(num%2)
            dp[num] = 1 + rec(3*num + 1, dp);
        else
            dp[num] = 1 + rec(num/2, dp);
        return dp[num];
    }
int getKth(int lo, int hi, int k) {
        vector <long long int> dp(10000, -1);
        vector < pair<long long int, long long int> > vec(hi - lo + 1);
        dp[0] = 0;
        dp[1] = 0;
        for(int i = lo ; i <= hi ; i++){
            vec[i - lo].first = rec(i, dp);
            vec[i - lo].second = i;
        }
        sort(vec.begin(), vec.end());
            // for(auto x:vec)
            //     cout<<x.second<<" ";
        return vec[k-1].second;
    }

int main(){

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);   
    freopen("output.txt", "w", stdout);
    #endif

    int t;
    // cin>>t;
    t = 1;
    while(t--){
            string s,t;
            cin>>s>>t;
            int s1 = s.size(), s2 = t.size();
            if(s1 != s2-1){
                cout<<"No";
                return 0;
            }
            int flag = 0;
            for(int i = 0 ; i < s1 ; i++)
                if(s[i] != t[i])
                    flag = 1;
            if(flag)
                cout<<"No";
            else
                cout<<"Yes";
        }   
        return 0;
    }

Measured memory_bytes: 3600
#include<iostream>
using namespace std;
int main(){
  int H,W;
  while(cin >> H>> W,H+W!=0){
    for(int i=0;i<H;i++){
      for(int j=0;j<W;j++){
	if(i==0 || i==H-1 || j==0 || j==W-1)
	  cout<<'#';
	else
	  cout<<'.';
      }
    cout<<endl;
    }
    cout<<endl;
  }
  return 0;
}

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

int main() {
	int n;
	cin >> n;
	int w[111], s = 0;
	for (int i = 0; i < n; i++)
		cin >> w[i], s += w[i];
	int t = 0, m = s;
	for (int i = 0; i < n; i++)
		t += w[i], m = min(m, abs(s - t - t));
	cout << m << endl;
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL<<60;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rep(i,N) for(ll i = 0; i < (ll)N; i++)
#define repi(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////

ll n,t;
PLL ct;
Vi a;

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    std::cout<<std::fixed<<std::setprecision(30);
    cin>>n>>t;
    a.resize(n);
    rep(i,n){
        cin>>a[i];
    }
    ll tp = INF;
    ct.first=0;
    ct.second=0;
    rep(i,n){
        chmin(tp,a[i]);
        if(ct.first == a[i]-tp){
            ct.second++;
        }else if(ct.first < a[i]-tp){
            ct.first = a[i]-tp;
            ct.second = 1;
        }
    }
    print(ct.second);
    return 0;
}

Measured memory_bytes: 1024
/////////////////////////////////////////////////////////
//
//  c/temp.cpp file
//  Last Updated: 2018-10-23 ...Maybe
//
//    I hope you adding this code to the setting file
//    alias g++='g++ -std=c++1y -DDEBUG_LOCAL'
//
/////////////////////////////////////////////////////////

#include <bits/stdc++.h>

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back

//#define int long long

#define _overload3(_1,_2,_3,name,...) name
#define _REP(i,n) REAP(i,0,n)
#define REAP(i,a,b) for(int i=int(a);i<int(b);++i)
#define REP(...) _overload3(__VA_ARGS__,REAP,_REP,)(__VA_ARGS__)

#define _REPR(i,n) REAPR(i,n,0)
#define REAPR(i,a,b) for(int i=int(a-1);i>=int(b);--i)
#define REPR(...) _overload3(__VA_ARGS__,REAPR,_REPR,)(__VA_ARGS__)

#define ALL(a) a.begin(),a.end()
#define rALL(a) a.rbegin(),a.rend()

#define coutALL(a) {int loop_coutALL=0;for(auto e:a) cout<<(loop_coutALL++?" ":"")<<e; cout<<endl;}

#define coutYN(a) cout<<((a)?"YES":"NO")<<endl;
#define coutYn(a) cout<<((a)?"Yes":"No")<<endl;
#define coutyn(a) cout<<((a)?"yes":"no")<<endl;

#define pcnt __builtin_popcount
#define buli(x) __builtin_popcountll(x)

const int INF=1145141919;
//const long long INF=114514191911451419;
const int MOD=(int)1e9+7;
const double EPS=1e-12;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};
//const int dx[]={-1,-1,-1,0,1,1,1,0},dy[]={-1,0,1,1,1,0,-1,-1};

using vi=vector<int>;
using vvi=vector<vi>;
using vs=vector<string>;

typedef pair<int,int> pii;
typedef pair<int,string> pis;
typedef pair<string,int> psi;
typedef pair<string,string> pss;

typedef long long ll;

template<typename T> istream &operator >> (istream &is, vector<T> &v){for(T &x:v) is>>x;return is;}
template<typename T> ostream &operator << (ostream &os, vector<T> &v){int i=0;for(T &x:v) os<<(i++?" ":"")<<x;return os;}

ll rev(ll n){ll x=0;for(;n>0;){x=x*10+n%10;n/=10;}return x;}

ll upper(ll n,ll m){return (n+m-1)/m;};
ll rounding(ll n){return (long double)n+0.5;};

bool inG(ll x,ll n){return 0<=x && 0<n;}
bool outG(ll x,ll n){return x<0 || n<=x;}

inline int qp(int a,ll b){if(!b)return 1;int ans=1;do{if(b&1)ans=1ll*ans*a;a=1ll*a*a;}while(b>>=1);return ans;}
inline int qp(int a,ll b,int mo){if(!b)return 1;int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}

inline ll fac(ll k,ll n){ll a=1;for(int i=0;i<n;i++)a*=k--;return a;}
inline ll fac(ll k,ll n,int mo){ll a=1;for(int i=0;i<n;i++)a*=k--,a%=mo;return a;}

inline int dsum(ll n){int a=0;for(;n;n/=10)a+=n%10;return a;}

struct Arithmetic{Arithmetic(){cin.tie(0);ios::sync_with_stdio(0);cout<<fixed<<setprecision(20);}};

//#define DEBUG_LOCAL

#ifdef DEBUG_LOCAL
template<typename T> void deb(T a){cerr<<"deb: "<<a<<"です"<<endl;}
#define debl {cerr<<"debug: "<<__LINE__<<"行目だ"<<endl;}
void what_cr(){cout<<__GCC_ATOMIC_CHAR16_T_LOCK_FREE<<" ←？"<<endl;}
//ori_func S

//ori_func E
#else
template<typename T>void deb(T a){}
#define debl
void what_cr(){}void t_t(){}
#endif

signed main(){

  Arithmetic Exception;

  int x,y;
  cin>>x>>y;

  cout<<__gcd(x,y)<<endl;

  return 0;

}



Measured memory_bytes: 3144
#include <iostream>
#include <vector>
#include <map>
using namespace std;

typedef long long ll;
const ll mod = 1e9 + 7;
typedef pair<ll,ll> P;

map<ll,ll> s;
ll dp[105][100000];
int main() {
  ll n,k;
  cin >> n >> k;


  for(ll i = 1; (i - 1) * (i - 1) <= n; i++) {
    ll t = n / i;
    s[i] = t;
    s[t+1] = i - 1;
  }


  auto itr2 = s.begin();
  auto itr = s.begin();
  ++itr2;
  int K = 0;
  vector<ll> c;
  while(itr2 != s.end()) {
    dp[0][K] = (itr2->first - itr->first) * itr->second % mod;
    c.push_back(itr2->first - itr->first);
    ++itr2;
    ++itr;
    K++;
  
  }


  //int x;
  for(int i = 0; i < k; i++) {
    ll s[K] = {};
    s[0] = dp[i][0];
    for(int j = 1; j < K; j++) {
      s[j] = (s[j-1] + dp[i][j]);
    }
    for(int j = 0; j < K; j++) {
      dp[i+1][j] = s[K - (j + 1)] * c[j] % mod;
      //     cout <<"dp["<<i+1<<"]["<<j<<"] = "<<dp[i+1][j] << endl;
      // cin >> x;
    }
  }
 
  cout << dp[k-1][0] % mod << endl;
    
}
  
  
  


Measured memory_bytes: 84596
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <math.h>
#include <utility>
#include <tuple>
#include <map>
#include <ctype.h>
#include <set>
using namespace std;
using ll = long long;
int main() {
    string S; cin >> S;
    bool flag_s=false;
    for (int i=0;i<3;i++){
        if (S[i]==S[i+1]) flag_s = true;
    }
    if (flag_s) cout << "Bad" << endl;
    else cout << "Good" << endl;
    return 0;
}

Measured memory_bytes: 256
import * as fs from 'fs'

const input = fs.readFileSync('/dev/stdin', 'utf8').trim()

const output = (x: string | number | boolean): void => console.log(x)
const splitLine = (string: string): string[] => string.split('\n')
const splitBlank = (string: string): string[] => string.split(' ')
const toNumbers = (array: string[]): number[] => array.map(v => Number(v))
const range = (end: number, start: number = 0): number[] =>
	[...Array(end - start)].map((v, i) => i + start)

// debug(input)

/* ここから */
let K = +input
let ans = ''
while (K--) {
	ans += 'ACL'
}
output(ans)


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

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

Measured memory_bytes: 256
import java.util.*;

public class Main {
	
	static Scanner sc = new Scanner(System.in);
	
	public static void main(String[] args) {
		int n = sc.nextInt();
		int k = sc.nextInt();
		String s = sc.next();
		char[] ss = s.toCharArray();
		boolean[] a = new boolean[n];
		
		for (int i = 0; i < n; i++) {
			if(ss[i] == 'A') {
				a[i] = true;
			}
		}
		
		boolean flip = false;
		int index = 0;
		for (int i = 0; i < Math.min(k,  2 * n + k % 2); i++) {
			if(a[index] ^ flip) {
				a[index] = !a[index];
			} else {
				flip = !flip;
				index = (index + 1) % n;
			}
		}
		for (int i = 0; i < n ; i++) {
			if(a[(index+i) % n] ^ flip) {
				System.out.print('A');
			} else {
				System.out.print('B');
			}
		}

	}
}

Measured memory_bytes: 52720
N=int(input())
a=list(map(int, input().split()))
ans=0
for i in range(N):
    if a[i]%2==0:
        if a[i]%3!=0:
            if a[i]%5!=0:
                ans=1
if ans==0:
    print('APPROVED')
else:
    print('DENIED')
    
    

Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
#define     ll              long long
#define     MAX             100000
#define     FI              freopen("input.txt","r",stdin)
#define     FO              freopen("output.txt","w",stdout)
#define     fast            ios_base::sync_with_stdio(false);cin.tie();cout.tie();
#define     sc(a)           scanf("%d",&a)
#define     sc2(a,b)        scanf("%d %d",&a,&b)


int main()
{
    long double r;
    cin>>r;
    cout<<setprecision(5)<<fixed<<2*acos(-1.0)*r<<"\n";
    return 0;
}



Measured memory_bytes: 3804
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC137A
{
	class Program
	{
		static void Main(string[] args)
		{
			int A, B,n;
			var word = Console.ReadLine().Split(' ');
			A = int.Parse(word[0]);
			B = int.Parse(word[1]);
			if (A + B <= A * B && A - B <= A * B)
			{
				n = A * B;
				Console.WriteLine(n);
			}
			else if (A + B <= A - B && A * B <= A - B)
			{
				n = A - B;
				Console.WriteLine(n);
			}
			else if (A * B <= A + B && A - B <= A + B)
			{
				n = A + B;
				Console.WriteLine(n);
			}
			Console.ReadKey();
		}
	}
}


Measured memory_bytes: 11092
use std::io::*;
use std::str::*;
use std::f64::consts::*;
use std::f64;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        n: i32,
        m: i32,
        c: i32,
        a: [i32; m],
        b: [[i32; m]; n],
    }
    let mut cnt = 0;
    for i in 0..n {
        let sum: i32 = b[i as usize].iter().enumerate().map(|(i, val)| {
            val * a[i]
        }).collect::<Vec<i32>>().iter().sum();
        if sum + c > 0 {
            cnt += 1;
        }
    }
    println!("{}", cnt);
}

Measured memory_bytes: 4352
def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print(yes) if b else print(no)
# from collections import Counter,deque,defaultdict
# import itertools
# import math
# import networkx
# from bisect import bisect_left,bisect_right
n=n0()
b=n1()

a=[b[0],b[-1]]
for i in range(1,n-1):
    a.append(min(b[i-1],b[i]))

print(sum(a))

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

int main(){
    int h,w;
    while ((bool) true){
        cin >> h >> w;
        if (h == 0){
            break;
        };
        for (int i = 0; i < h; i++){
            for (int j = 0; j < w; j++){
            cout << "#";
            };
            cout << "" << endl;
        };
        cout << "" << endl;
    }  
    return 0;
}


Measured memory_bytes: 3092
a = gets.to_i
array = gets.chomp.split(" ").map(&:to_i)

sum_alice = 0
sum_bob = 0
number = 0
max = 0

while true
  max = array.max
  array.each_index do |idx|
    if array[idx] == max
      number % 2 == 0 ? sum_alice += max : sum_bob += max
      array[idx] = nil
      break
    end
  end
  array.compact!
  break if array.empty?
  number += 1
end

puts sum_alice - sum_bob

Measured memory_bytes: 1788
/*
Mangal bhavan amangal haari
Drabahu su Dasharath achar Bihari
Raam Siya Raam Siya Raam jai jai Raam
Raam Siya Raam Siya Raam jai jai Raam
Ho hoi hai wohi jo Raam rachi raakha
Ko kari tarak badhave saakha
Raam Siya Raam Siya Raam jai jai Raam
Ho dheeraj dharam mitra aru naari
Aapad kaal parakhiye chaari
Ho jehike jehi par satya sanehu
So tehi milay na kachhu sandehu
Ho jaaki rahi bhawana jaisi
Prabhu murati dekhi tin taisi
Ho Raghukul reet sada chali aayi
Praan jaaye par vachan na jaayi
Raam Siya Raam Siya Raam jai jai Raam, Raam
Raam Siya Raam Siya Raam jai jai Raam
Ho hari anant hari katha ananta
Kahahi sunahi bahuvidhi sab santa
Raam Siya Raam Siya Raam jai jai Raam, Raam
Raam Siya Raam Siya Raam jai jai Raam
Raam Siya Raam Siya Raam jai jai Raam
*/


#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
//auto->.
//map<int,int>::iterator i
vector<int> sieve(int n) 
{ 

    vector<bool> prime(n+1,true); 
       
    prime[0] = false; 
    prime[1] = false; 
    int m = sqrt(n); 
   vector<int> ans;

    for (int p=2; p<=m; p++) 
    { 
    
        if (prime[p]) 
        { 
         
            for (int i=p*2; i<=n; i += p) 
            prime[i] = false; 
        } 
    }  
    //vector<int> ans; 
    for (int i=0;i<n;i++) 
        if (prime[i]) 
            ans.push_back(i); 
    return ans; 
}

int gcd(int a,int b)
{
	if(b==0) return a;
	return gcd(b,a%b);
}
int mod = 1e9 + 7;
int power(int a , ll b)
{
	int res = 1;
	while(b)
	{
		if(b & 1)
			res = 1LL * res * a ;//% mod;
		a = 1LL * a * a ;//% mod;
		b >>= 1;
	}
	return res;
}
bool sortbysec(const pair<int,int> &a, 
              const pair<int,int> &b) 
{ 
    return (a.second < b.second); 
}
ll min(int a,ll b)
{
	if(a>b)
	return b;
	return a;
}
ll max(int a,ll b)
{
	if(a>b)
	return a;
	return b;
}
ll myXOR(ll x, ll y) 
{ 
   return (x | y) & (~x | ~y); 
}
int conti(int x)
{
	if(x<1)
	return 0;
	if(x%4==0)
	return x;
	if(x%4==1)
	return 1;
	if(x%4==2)
	return x+1;
	if(x%4==3)
	return 0;
}
 
bool ispfsq(long double x) 
{   
  // Find floating point value of  
  // square root of x. 
  long double sr = sqrt(x); 
  
  // If square root is        an integer 
  return ((sr - floor(sr)) == 0); 
}
#define PI 3.141592653589793


vector<int > adj[200005],col[2];
bool visited[200005];
int  a[200005];
ll s[200005], ans;
map<ll, int> lst;
void solve()
{
ll l,r,d;
cin>>l>>r>>d;
ll ans=0;
for(int i=l;i<=r;i++)
{
	if(i%d==0)
	{
		ans++;
	}
}
cout<<ans;
}


int main()
{
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
int mul=0;
if(mul==1)
{
 int t;
    cin>>t;
   while(t--)
    {
		solve();
	cout<<"\n";
    }
  
}
else
{
	solve();
}
}

Measured memory_bytes: 8276
let () = Scanf.scanf "%2d%2d" @@ fun left right ->
  let yymm = 1 <= right && right <= 12 in
  let mmyy = 1 <= left && left <= 12 in
  print_endline @@
  match (yymm, mmyy) with
  | (true, true) -> "AMBIGUOUS"
  | (true, false) -> "YYMM"
  | (false, true) -> "MMYY"
  | (false, false) -> "NA"

Measured memory_bytes: 3740
n, m, q = map(int, input().split())
ans = [[0] * (n+2) for _ in range(n+2)]
for _ in range(m):
    l, r = map(int, input().split())
    ans[0][r] += 1
    ans[0][-1] -= 1
    ans[l+1][-1] -= 1
    ans[l+1][r] -= 1

for i in range(n+2):
    for j in range(n+1):
        ans[i][j+1] += ans[i][j]

for i in range(n+1):
    for j in range(n+2):
        ans[i+1][j] += ans[i][j]

for _ in range(q):
    p, q = map(int, input().split())
    print(ans[p][q])

Measured memory_bytes: 9716
package main

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

func newScanner() *bufio.Scanner {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	// buf := make([]byte, 10000)
	// scanner.Buffer(buf, 1000000)
	return scanner
}

func scanInt(s *bufio.Scanner) int {
	if s.Scan() {
		t := s.Text()
		v, err := strconv.Atoi(t)
		if err == nil {
			return v
		}
		panic(err)
	} else {
		panic(s.Err())
	}
}

func main() {
	sc := newScanner()
	n := scanInt(sc)
	p := make([]int, n)

	for i := 0; i < n; i++ {
		p[i] = scanInt(sc)
	}

	res := 0
	i := 0
	for j := 0; j < n; j++ {
		if p[i] >= p[j] {
			res++
			i = j
		}
	}

	fmt.Println(res)
}


Measured memory_bytes: 3584
#include <stdio.h>

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

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

    if ((1 <= a && a <= 9)  && (1 <= b && b <= 9)) {
        printf("%d", a * b);
    } else {
        printf("%d", -1);
    }

    return 0;
}

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

#define si(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define sd(a) scanf("%lf",&a)
#define sc(a) scahf("%c",&a);
#define ss(a) scanf("%s",a)
#define pi(a) printf("%d\n",a)
#define pl(a) printf("%lld\n",a)
#define pc(a) putchar(a)
#define ms(a) memset(a,0,sizeof(a))
#define repi(i, a, b) for(register int i=a;i<=b;++i)
#define repd(i, a, b) for(register int i=a;i>=b;--i)
#define reps(s) for(register int i=head[s];i;i=Next[i])
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define pii pair<int,int>
#define mii unordered_map<int,int>
#define msi unordered_map<string,int>
#define lowbit(x) ((x)&(-(x)))
#define ce(i, r) i==r?'\n':' '
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define INF 0x3f3f3f3f
#define pr(x) cout<<#x<<": "<<x<<endl
using namespace std;

inline int qr() {
    int f = 0, fu = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-')fu = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        f = (f << 3) + (f << 1) + c - 48;
        c = getchar();
    }
    return f * fu;
}

const int N = 3e5 + 10;

struct Seg_Tree {
    struct {
        int l, r;
        int dat;
    } t[N * 4];

    void build(int p, int l, int r) {
        t[p].l = l, t[p].r = r;
        if (l == r)return;
        int mid = (l + r) >> 1;
        build(p << 1, l, mid);
        build(p << 1 | 1, mid + 1, r);
    }

    void change(int p, int x, int v) {
        if (t[p].l == t[p].r) {
            t[p].dat += v;
            return;
        }
        int mid = (t[p].l + t[p].r) >> 1;
        if (x <= mid)change(p << 1, x, v);
        else change(p << 1 | 1, x, v);
        t[p].dat = max(t[p << 1].dat, t[p << 1 | 1].dat);
    }

    int ask(int p, int l, int r) {
        if (l <= t[p].l && r >= t[p].r)return t[p].dat;
        int mid = (t[p].l + t[p].r) >> 1;
        int val = 0;
        if (l <= mid)val = ask(p << 1, l, r);
        if (r > mid)val = max(val, ask(p << 1 | 1, l, r));
        return val;
    }
} tr;

vi r[N];
int n, m, k;

int main() {
    n = qr(), m = qr(), k = qr();
    tr.build(1, 1, m);
    repi(i, 1, k) {
        int x = qr(), y = qr();
        tr.change(1, y, 1), r[x].pb(y);
    }
    int ans = 0;
    repi(i, 1, n) {
        for (auto it:r[i]) {
            tr.change(1, it, -1);
        }
        ans=max(ans,(int)r[i].size()+tr.t[1].dat);
        for (auto it:r[i]) {
            tr.change(1, it, 1);
        }
    }
    pi(ans);
    return 0;
}

Measured memory_bytes: 32428
#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 int long long int
#define pb push_back
#define mp make_pair
#define loop(i,x,n) for(int i=x;i<=n;i++)
#define rloop(i,x,n) for(int i=x;i>=n;i--)
#define ff first
#define ss second
#define N4RUTO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
 
typedef tree<int, null_type, less<int>, rb_tree_tag,  
// typedef tree<int, null_type, less_equal<int>, rb_tree_tag,  
tree_order_statistics_node_update>
ordered_set;
 
int32_t main(){
    N4RUTO;
    int t;
    t=1;
    // cin>>t;
    while(t--){
        int n,m;
        cin>>n>>m;
        int a[n+1];
        loop(i,1,n) cin>>a[i];
        vector<bool> b(n+1,true);
        while(m--){
            int x,y;
            cin>>x>>y;
            if(a[x]<a[y]) b[x] = false;
            else if(a[x]==a[y]) b[x]=false, b[y]=false;
            else b[y]=false;
        }
        int ans= 0;
        loop(i,1,n){
            if(b[i]) ans++;
        }
        cout<<ans;
    }
    return 0;
}

Measured memory_bytes: 4440
S = input()
N = len(S)
count_f1 = 0
count_f0 = 0
#101010
for i in range(N):
    if i % 2 == 0 and S[i] != "1":
        count_f1 += 1
    elif i % 2 == 1 and S[i] != "0":
        count_f1 += 1

for i in range(N):
    if i % 2 == 0 and S[i] != "0":
        count_f0 += 1
    elif i % 2 == 1 and S[i] != "1":
        count_f0 += 1

print(min(count_f1,count_f0))




Measured memory_bytes: 3188
function Main(input){
  let data = input.split('\n');
  let n = data[0];
  let arr = data[1].split(' ').map(Number);
  let changedArr = arr.sort((a,b) =>{
    return a - b;
  });

  let sum = 0;
  changedArr.forEach(a => {
    sum += a;
  });
  
  console.log(changedArr[0], changedArr[n - 1], sum);
  }
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 18868
S=str(input())
indC=S.find("C")
Flag=0

for i in range(0,len(S)):
    if i!=indC and i!=0:
        SSS=S[i]+""
        if SSS.isupper():
            Flag=1   

if S[0]=="A" and S.count("C",2,len(S)-1)==1 and Flag==0:
       print("AC")
else:
    print("WA")


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

int main(){
	int n;
	cin >> n;
	int h[n];
	for(int i = 0; i < n;i++){
		cin >> h[i];
	}
	int max = 0;
	int count = 0;
	for(int i = 1; i < n; i++){
		if(h[i - 1] >= h[i]){
			count++;
		}else{
			if(max < count){
				max = count;
			}
			count = 0;
		}
	}
  	if(max < count){
		max = count;
	}
	cout << max << endl;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef pair<int, int>  pii;
typedef pair<ll, ll>  pl;
typedef vector<int>   vi;
typedef vector<ll>    vl;
typedef vector<pii>   vpii;
typedef vector<pl>    vpl;
typedef vector<vi>    vvi;
typedef vector<vl>    vvl;
void myInit();
int mpow(int base, int exp);
void ipgraph(int m);
void dfs(int u, int par);
const int MOD = 1000000007;
const int N = 3e5, M = N;
//=========TQR==============
vi g[N];
int a[N];

int main() {
	myInit();
	FIO;

	ll A, B;
	cin >> A >> B;		//integer part
	char C; cin >> C;			//decimal
	int D; cin >> D;			//fractional part

	B *= 100;
	B += D;
	ll X = A * B;
	X /= 100;
	cout << X << endl;

	return 0;
}

void myInit() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int mpow(int base, int exp) {
	base %= MOD;
	int result = 1;
	while (exp > 0) {
		if (exp & 1) result = ((ll)result * base) % MOD;
		base = ((ll)base * base) % MOD;
		exp >>= 1;
	}
	return result;
}

void ipgraph(int n, int m) {
	int i, u, v;
	while (m--) {
		cin >> u >> v;
		g[u - 1].pb(v - 1);
		g[v - 1].pb(u - 1);
	}
}

void dfs(int u, int par) {
	for (int v : g[u]) {
		if (v == par) continue;
		dfs(v, u);
	}
}

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

#define int long long
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rep1(i,n) for(int i=1;i<=(int)(n);++i)
#define rep11(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define repm(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1000000007
#define INF LONG_LONG_MAX

int n,m,a,ok,ng=200001,ans,hoge;
vector<int> v;

signed main() {
    cin >> n >> m;
    rep(i,n) cin >> a, v.pb(a);
    sort(rall(v));
    while(abs(ok-ng) > 1) {
        int mid = (ok+ng)/2,tmp=0;
        stack<int> s;
        rep(i,n) {
            while(s.size() && s.top()+v[i] < mid) s.pop();
            tmp += s.size()*2;
            if (v[i]*2 >= mid) tmp++;
            s.push(v[i]);
        }
        if (tmp >= m) ok = mid, hoge = tmp-m;
        else ng = mid;
    }
    int sum = 0,l=INF;
    stack<int> s;
    rep(i,n) {
        while(s.size() && s.top()+v[i] < ok) sum -= s.top(),s.pop();
        ans += sum*2 + v[i]*(s.size()*2);
        if (s.size()) l = min(l,s.top()+v[i]);
        if (v[i]*2 >= ok) ans += v[i]*2, l = min(l, v[i]*2);
        s.push(v[i]);
        sum += v[i];
    }
    cout << ans-hoge*l << endl;
}


Measured memory_bytes: 1908
fun main() {
    val (x, y) = readLine()!!.split(" ").map{ it.toInt() }
    val ans = if((0..x).any { tsuru ->
        val kame = x - tsuru
        kame * 4 + tsuru * 2 == y
    }) {
        "Yes"
    } else {
        "No"
    }
    println(ans)
}

Measured memory_bytes: 36404
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,n) for(int i=(a); i<(n); i++)
#define all(v) v.begin(), v.end()
#define fi first
#define se second
#define sz(x) int(x.size())
using namespace std;
using ll = long long;
using P = pair<int ,int>;
const int INF = 1001001001;
const int MOD = 1000000007;
template<class T> inline bool chmax(T &a, T b) { if (a<b) {a=b; return 1;} return 0;}
template<class T> inline bool chmin(T &a, T b) { if (b<a) {a=b; return 1;} return 0;}

#ifdef _DEBUG
#include "debug.h"
#else
#define debug(...)
#define print(...)
#endif

int main() {
    int n, m, r; cin >> n >> m >> r;
    vector<int> a(r);
    rep(i, r) {cin >> a[i]; a[i]--;}
    vector<vector<int>> vec(n, vector<int>(n, INF));
    rep(i, n) vec[i][i] = 0;
    rep(i, m) {
        int u, v, c; cin >> u >> v >> c;
        --u; --v;
        vec[u][v] = vec[v][u] = c;
    }
    print(vec);
    sort(all(a));
    rep(k, n) rep(i, n) rep(j, n) {
        chmin(vec[i][j], vec[i][k]+vec[k][j]);
    }
    ll ans = LLONG_MAX;
    print(vec);
    do {
        debug(a);
        ll tot = 0;
        bool ok = true;
        rep(i, r-1) {
            if (vec[a[i]][a[i+1]]<INF) tot += vec[a[i]][a[i+1]];
            else ok = false;
        }
        if (ok) chmin(ans, tot);
    } while (next_permutation(all(a)));

    cout << ans << endl;
}

Measured memory_bytes: 384
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                int[] intInputScore = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

                if (intInputScore[0] == -1 && intInputScore[1] == -1 && intInputScore[2] == -1)
                {
                    break;
                }

                else if (intInputScore[0] == -1 || intInputScore[1] == -1)
                {
                    Console.WriteLine("F");
                }

                else if (intInputScore[0] + intInputScore[1] < 30)
                {
                    Console.WriteLine("F");
                }

                else if (intInputScore[0] + intInputScore[1] < 50)
                {
                    if (intInputScore[2] >= 50)
                    {
                        Console.WriteLine("C");
                    }
                    else
                    {
                        Console.WriteLine("D");
                    }
                }

                else if (intInputScore[0] + intInputScore[1] < 65)
                {
                    Console.WriteLine("C");
                }

                else if (intInputScore[0] + intInputScore[1] < 80)
                {
                    Console.WriteLine("B");
                }

                else
                {
                    Console.WriteLine("A");
                }

            }
        }
    }
}



Measured memory_bytes: 16316
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll, ll> P;
using VP = vector<P>;
using VVP = vector<VP>;
using VI = vector<ll>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
const int inf = 1e9 + 7;
const ll INF = 1LL << 61;
const ll mod = 1e9 + 7;

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;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll i, j;
    ll n;
    cin >> n;
    ll ans = 0;
    for (i = 2; i * i <= n; i++) {
        ll cnt = 0;
        ll z = 1;
        while (n % i == 0) {
            n = n / i;
            cnt++;
            if (cnt >= z) {
                cnt = 0;
                z++;
                ans++;
            }
        }
    }
    if (n != 1) ans++;
    cout << ans << endl;
}

Measured memory_bytes: 3652
n = int(input())
p = list(map(int, input().split()))
count = 0
for i in range(1, n-1):
  if (p[i-1] > p[i] and p[i+1] < p[i]) or (p[i-1] < p[i] and p[i+1] > p[i]):
    count += 1
print(count)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define per1(i,n) for(int i=n;i>0;i--)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int d,s,t;
    cin>>d>>t>>s;
    if(d<=s*t) cout<<"Yes";
    else  cout<<"No";
}

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

int main() {
  int a,b;
  cin>>a>>b;
  vector<int> vec(a);
  for(int i=0;i<a;i++){
    cin>>vec.at(i);
  }
  sort(vec.begin(),vec.end());
  reverse(vec.begin(),vec.end());
  int count=0;
  for(int i=0;i<b;i++){
    count+=vec.at(i);
  }
  cout<<count<<endl;
}

Measured memory_bytes: 256
import math
inf=float('inf')
s = input()
s=s[:-1]

if (len(s)%2==1):
    s=s[:-1]

N=len(s)

for i in range(N):
    h=int(len(s)/2)
    if (s[0:h-1]==s[h:-1]):

        print(len(s))
        quit()
    s=s[:-2]


quit()

Measured memory_bytes: 3060
def p_d():
    N, K = map(int, input().split())
    inf = 10 ** 18
    sushi = [[-inf] for _ in range(N)]
    max_kind = -1
    for _ in range(N):
        t, d = map(int, input().split())
        sushi[t - 1].append(d)
        if max_kind < t:
            max_kind = t
    for i in range(max_kind):
        sushi[i].sort(reverse=True)
    sushi.sort(key=lambda x: x[0], reverse=True)

    que = []
    res = 0
    for i in range(K):
        res += sushi[i][0]
        for j in sushi[i][1:]:
            que.append(j)
    que.sort()
    cur = res
    res += K ** 2
    for var in range(1, K)[::-1]:
        a = que.pop()
        b = sushi[var][0]
        cur += a - b
        res = max(res, cur + var ** 2)
    print(res)


if __name__ == '__main__':
    p_d()


Measured memory_bytes: 68640
#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  string T;
  cin>>S>>T;
  int N=S.size();
  bool flag=false;
  for(int i=0;i<N;i++){
    bool flag2=true;
    for(int j=0;j<N;j++){
      if(T.at(j)==S.at((j+i)%(N))){
      }
      else{
        flag2=false;
      }
    }
    if(flag2==true){
      flag=true;
      break;
    }
  }
  if(flag==true){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <numeric>

using ll = long long;

using namespace std;

int main() {
    ll k;
    cin >> k;
    ll sum = 0;
    for (ll i=1; i<=k; i++) {
        for (ll j=1; j<=k; j++) {
            for (ll l=1; l<=k; l++) {
                sum += gcd(i, gcd(j, l));
            }
        }
    }
    cout << sum << '\n';
    return 0;
}

Measured memory_bytes: 3564
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> P;
typedef vector<P> vpl;
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int mod = 1e9 + 7;
const int MAX = 510000;

int main() {
    ll n; cin >> n;
    ll a = 0;
    while(n>=(1<<a)){
        a++;
    }
    cout << (1<<(a-1)) << endl;
}

Measured memory_bytes: 256