akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int Q,H,S,D,N;

signed main(){
    cin>>Q>>H>>S>>D>>N;

    int ei=min({Q*4,H*2,S});

    int ans=0;
    if(N&1){
        ans+=ei;
        N--;
    }
    N/=2;
    ei=min(ei*2,D);
    ans+=N*ei;
    cout<<ans<<endl;
    return 0;
}


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

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

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

using namespace std;

typedef pair<int,int> pii;

int main(){

  string s;
  int k;
  cin >> s >> k;

  vector<string> v;
  REP(i,k){
    string t;
    cin >> t;
    v.pb(t);
  }

  llong base = atoll(s.c_str());
  for(int i = 1;;i++){
    bool make = true;
    REPI(itr,v){
      if((int)s.find(*itr) != -1){
        make = false;
        break;
      }
    }
    if(make == true){
      break;
    }else{
      llong tmp = base + i;
      s = to_string(tmp);
    }
  }

  cout << s << endl;

  return 0;
}



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


int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    int maxx=0,cnt;
    int vis[1005]={0};
    int f=0;
    for(int i=0;i<n;i++){
        cnt=0;
        vis[1005]={0};
        for(int j=0;j<=i;j++){
            vis[s[j]-'a']++;
            f=1;
        }
        if(f){
        for(int k=i+1;k<n;k++){
            if(vis[s[k]-'a']>0){
                cnt++;
                vis[s[k]-'a']=0;
            }
        }
        f=0;
        }
        maxx=max(maxx,cnt);
    }
    cout<<maxx;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std; 
int main(){
  int N,M,S,A=0;
  cin>>N;
  vector<string>s(N);
  for(int i=0;i<N;i++)cin>>s.at(i);
  cin>>M;
  vector<string>t(M);
  for(int i=0;i<M;i++)cin>>t.at(i);
  for(int i=0;i<N;i++){
    S=0;
    for(int j=0;j<N;j++)if(s.at(i)==s.at(j))S++;
    for(int j=0;j<M;j++)if(s.at(i)==t.at(j))S--;
    if(S>A)A=S;
  }
  cout<<A<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
int main(){
int a,b,q,i;
char str[1001],o[10],p[1001],v[2];
scanf("%s %d",str,&q);
while(q--){
scanf("%s %d %d",o,&a,&b);
if(strcmp(o,"replace")==0){
scanf("%s",p);
for(i=0;i<b-a+1;i++){
str[a+i]=p[i];
}
}
if(strcmp(o,"reverse")==0){
for(i=0;i<(b-a+1)/2;i++){
v[0]=str[a+i];
str[a+i]=str[b-i];
str[b-i]=v[0];
}
}
if(strcmp(o,"print")==0){
for(i=a;i<=b;i++){
printf("%c",str[i]);
}
putchar('\n');
}
}
return 0;
}


Measured memory_bytes: 2064
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
#define ALL(v) v.begin(),v.end()
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; }
#define DEBUG_VLL(vec) REP(sz, vec.size()) std::cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, k; cin >> n >> k;
    V<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    V<bool> dp(k + 1, false);
    for (int i = 0; i <= k; i++) {
        for (int j = 0; j < n; j++) {
            if (i + a[j] > k) continue;
            if (!dp[i]) dp[i + a[j]] = true;
        }
    }
    if (dp[k]) cout << "First\n";
    else cout << "Second\n";
    return 0;
}


Measured memory_bytes: 3684
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

In = int(input())
count = 0
for i in range(1,In+1,2):
    if len(make_divisors(i))==8:
        count+=1

print(count)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using ll = long long;
using pii = pair<int, int>;

//const ll INF = 1e18L + 5;
//const int INF = 1e9 + 5;
//const double pi = 3.14159265358979323846;

void	solve()
{
	int n, l;
	cin >> n >> l;
	vector<string> v(n);
	rep(i, n) cin >> v[i];
	sort(all(v));
	rep(i, n) {
		cout << v[i];
	}
	cout << endl;
}

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

	solve();
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<cstdio>
#include<cstdlib>
using namespace std;
int main(){
	int w,deg;
	double x=0,y=0,pre=M_PI/2;
	string buf;
	while(cin>>buf){
		/* atoi */
		int ptr=0;
		string tmp1,tmp2;
		while(buf[ptr]!=',') tmp1+=buf[ptr++];
		w = atoi(tmp1.c_str());
		++ptr;
		while(buf[ptr]) tmp2+=buf[ptr++];
		deg = atoi(tmp2.c_str());
		/* read end */
		if(w==0&&deg==0) break;
		x+=(double)w*cos(pre);
		y+=(double)w*sin(pre);
		pre-=(double)deg*M_PI/180;
	}
	cout << (int) x << endl;
	cout << (int) y << endl;
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
int main() {
  int x;
  int y;
 cin >> x >>y;
  if(x==y) {
cout <<"Yes" << endl;
  }
else {
cout << "No" << endl;
}
}

Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var n, k, x, ans int
	fmt.Scan(&n, &k)
	for i := 0; i < n; i++ {
		fmt.Scan(&x)
		if x < k-x {
			ans += 2 * x
			continue
		}
		ans += 2 * (k - x)
	}
	fmt.Println(ans)
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define l long
#define pb push_back
#define mp make_pair
#define mt make_tuple
int main() {
	// your code goes here
	//ifstream cin("input.txt");
	//ofstream cout("output.txt");
	ios_base::sync_with_stdio(false); 
    cin.tie(NULL); 
	
	int a[3];
	cin>>a[0]>>a[1]>>a[2];
	sort(a,a+3);
	if(a[0]==5 && a[1]==5 && a[2]==7) cout<<"YES";
	else cout<<"NO";
	
	
	
	return 0;
}


Measured memory_bytes: 256
import scala.io.StdIn.{readLine,readInt}

object Main extends App {
  val seq1 = for(i<-1 to 9) yield List(i,i,i)
  val seq2 = for(i<-1 to 7) yield List(i,i+1,i+2)

  def check(m:List[Int], count:Int,u:Int,v:Int):Boolean =
    if(m.length != count) false
    else if(count==2) { if(m.head==m.last) true else false }
    else
      (u to 8).exists(i=> check(m diff seq1(i),count-3,i+1,v)) || (0 to 6).exists(i=> check(m diff seq2(i),count-3,u,i))

  Iterator.continually(readLine).takeWhile ( _!=null ).foreach { line =>
    val l = line.map(_.asDigit).toList
    val m = (1 to 9).filter { i => l.count( _==i ) < 4 && check(i::l,14,0,0) }
    if(m.length>0) println(m.mkString(" ")) else println(0)
  }
}

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

#ifdef _DEBUG
#define debug(x) cout<<#x<<": "<<x<<endl
#else
#define debug(x)
#endif

using namespace std;

constexpr int MAX_N = 5000000;

int bit[26][MAX_N + 1], n;

int sum(char c, int i) {
    // cout << "sum(" << c - 'a' << ", " << i << ") = ";
    int s = 0;
    while (i > 0) {
        s += bit[c - 'a'][i];
        i -= i & -i;
    }
    // cout << s << endl;
    return s;
}

void add(char c, int i, int x) {
    // cout << "add(" << c - 'a' << ", " << i << ", " << x << ")" << endl;
    while (i <= n) {
        bit[c - 'a'][i] += x;
        i += i & -i;
    }
}

int main() {
    int N, Q;
    string S;
    cin >> N;
    cin >> S;
    cin >> Q;
    n = N + 1;
    for (int i = 0; i < N; ++i) {
        add(S[i], i + 1, 1);
    }
    for (int i = 0; i < Q; ++i) {
        int type;
        cin >> type;
        if (type == 1) {
            int x;
            char c;
            cin >> x >> c;
            if (S[x - 1] != c) {
                add(c, x, 1);
                add(S[x - 1], x, -1);
                S[x - 1] = c;
            }
        } else if (type == 2) {
            int x, y;
            cin >> x >> y;
            int cnt = 0;
            for (char c = 'a'; c <= 'z'; c++) {
                if (sum(c, y) - sum(c, x - 1) >= 1) {
                    cnt++;
                }
            }
            cout << cnt << endl;
        }
    }
}

Measured memory_bytes: 105220
#include <bits/stdc++.h>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)




using namespace std;
using ll = long long;
using P = pair<int,int>;
using ull= unsigned long long;
const ll K_MAX=1e5+5;
const ll Lmax=ll(1e18);
const ll Nmax=1e9;
const ll INF=1e9;

// B貪欲法で決定する．
int main(){
  clock_t start = clock();
  int d;
  cin>>d;
  vector<int> c(26);
  vector<vector<int>> s(d,vector<int>(26));
  vector<int> last(26),last0(26);
  vector<int>c_inv(26); // iを選んだ際の1日での下がり幅
  

  ll c_tot=0;
  rep(i,26){
    cin>> c[i];
    c_tot+=c[i];
    last[i]=-1;
    last0[i]=-1;
  }
  rep(i,26){
    c_inv[i]=c_tot-c[i];
  }

  rep(i,d){//i日目
    rep(j,26){
      cin>>s[i][j];
    }
  }
  // ここまで入力．

  //貪欲法により，初期値t[i]を決める．
  vector<int> t(d);
  int maxloss, iml; // maxlossとその日付
  random_device rnd;
  maxloss=INF;
  rep(i,d){//i日目
   int maxs=-INF;
   int jm=0;

   rep(j,26){
     cin>>s[i][j];
     ll casej=s[i][j];
     rep(k,26){
       if(j!=k){
         casej-=c[k]*(i-last[k]);
       }
     }

     if(casej>maxs){
       maxs=casej;
       jm=j;
     }
   }

   if(maxs<maxloss){
     maxloss=maxs;
     iml=i;
   }
   
   last[jm]=i;
   t[i]=jm;
  }

//ここまでおんなじ

  ll sum;
  bool judge=true;
  double time;
  int ti;
  ll casei;
  ll loss;
 while(judge){
   t[iml]=rnd()%26;
   
   maxloss=INF;
   sum=0;
   loss=0;
   last=last0;
   
   
   rep(i,d){//i日目
     ti=t[i];
     
     loss+=c_tot-c[ti]*(i-last[ti]);
     last[ti]=i;
     casei= s[i][ti]-loss;
     
     sum+= casei;
     
     if(casei<maxloss){//最も増加の小さい日を決定．
       maxloss=casei;
       iml=i;
     }
  }  
   clock_t end = clock();
   time = static_cast<double>(end - start) / CLOCKS_PER_SEC * 1000.0;

   if(time>1950){
       judge=false;
   }

 }//while
  
  
  rep(i,d){
    cout<<t[i]+1<<endl;
   }
 // cout<<sum; //消すこと









}


Measured memory_bytes: 3656
#include <cstdio>
const int maxn=20005;
int n;
int p[maxn];
int t[maxn],a[maxn],b[maxn];
int main()
{
  scanf("%d",&n);
  for(int i=1;i<=n;i++){
    scanf("%d",&p[i]);
	t[p[i]]=i;
  }
  for(int i=1;i<=n;i++){
    a[i]=50000*i;
	b[i]=50000*(n-i)+t[i];
  }
  for(int i=1;i<=n;i++)
    printf("%d ",a[i]);
  printf("\n");
  for(int i=1;i<=n;i++)
    printf("%d ",b[i]);
  return 0;
}


Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
int cnt1[100003],cnt2[100003],n,x,mx1=0,mx2=0,mx3=0,mx4=0,x1,x2;
int main(){
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>x;
		if(i%2==0)
		{
			cnt1[x]++;
			if(mx1<cnt1[x]){
				mx1=cnt1[x];
				x1=x;
			}else if(mx3<cnt1[x]){
				mx3=cnt1[x];
			}
		}
		else
		{
			cnt2[x]++;
			if(mx2<cnt2[x]){
				mx2=cnt2[x];
				x2=x;
			}else if(mx4<cnt2[x]){
				mx4=cnt2[x];
			}
		}
	}
	if(x1!=x2)
		cout<<n-mx1-mx2;
	else
		cout<<n-max(mx1+mx4,mx2+mx3);
}


Measured memory_bytes: 1024
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {($($a:expr),*) => {println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);}}
#[allow(unused_macros)]
macro_rules! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);
impl<T: PartialEq> Eq for Total<T> {}
impl<T: PartialOrd> Ord for Total<T> { fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering { self.0.partial_cmp(&other.0).unwrap() }}

#[allow(dead_code)]
const MAX:usize = 100006;
#[allow(dead_code)]
const INF_U32:u32 = 1 << 31;
#[allow(dead_code)]
const INF_I32:i32 = 1 << 30;
#[allow(dead_code)]
const INF_U64:u64 = 1 << 63;
#[allow(dead_code)]
const INF_I64:i64 = 1 << 62;


fn main() {
    input!{n:i64};
    println!("{}", 800*n-(n/15)*200);
}


Measured memory_bytes: 4352
la1=list(map(int,input().split()))
la2=list(map(int,input().split()))
la3=list(map(int,input().split()))
n=int(input())
ln=[int(input()) for i in range(n)]
la=[la1,la2,la3]
ls=[[0,0,0],[0,0,0],[0,0,0]]
for i in range(3):
  for j in range(3):
    if la[i][j] in ln:
      ls[i][j]=1
if ls[0]==[1,1,1] or ls[1]==[1,1,1] or ls[2]==[1,1,1]:
  print("Yes")
elif ls[0][0]==ls[1][0]==ls[2][0]==1 or ls[0][1]==ls[1][1]==ls[2][1]==1 or ls[0][2]==ls[1][2]==ls[2][2]==1:
  print("Yes")
elif ls[0][0]==ls[1][1]==ls[2][2]==1 or ls[0][2]==ls[1][1]==ls[2][0]==1:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 9288
// Problem : B - Judge Status Summary
// Contest : AtCoder - AtCoder Beginner Contest 173
// URL : https://atcoder.jp/contests/abc173/tasks/abc173_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define all(x) begin(x),end(x)

int mod = 1e9+7;
int inf = 4e18;
const int N = 5e5+5;
		
signed main()
{
    io
    int tt = 1;
    //cin>>tt;
    while(tt--)
    {
		int n;
		cin>>n;
		map<string,int> mp;
		while(n--)
		{
			string s;
			cin>>s;
			mp[s]++;
		}
		cout<<"AC x "<<mp["AC"]<<"\n";
		cout<<"WA x "<<mp["WA"]<<"\n";
		cout<<"TLE x "<<mp["TLE"]<<"\n";
		cout<<"RE x "<<mp["RE"]<<"\n";	
    }
    return 0;
}


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

int main() {
    string s;
    cin >> s;
    int count = 0;
    int max = 0;
    for(int i = 0; i < s.size(); i++){
        if(s.at(i) == 'A' || s.at(i) == 'T' || s.at(i) == 'C' || s.at(i) == 'G' ){
            count += 1;
            if(max < count){
                max = count;
            }
        }else{
            count = 0;
        }
    }
    cout << max << endl;
    return 0;
}



Measured memory_bytes: 256
//----------BHAVIK DIWANI(PICT_COMP)---------------
#include<bits/stdc++.h>
#include<stdlib.h>
#include<stdio.h>
#define mod 1000000007
#define ll long long
#define int long long
#define ull unsigned long long
#define test ll t; cin>>t; while(t--)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define FOR(p,n) for(ll i=p;i<(ll)n;i++)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
ll gcd(ll a,ll b){ if(b==0) return a;    return gcd(b,a%b);}
ll lcm(ll a,ll b) { return (a/gcd(a,b)*b);}
ull power(ull a, ull b) {a %= mod;  ull res = 1;  while (b > 0) { if (b & 1) res = res * a % mod;  a = a * a % mod;  b >>= 1; }  return res%mod; }
ll modmul(ll x, ll y){return (x*y)%mod;}
ll modadd(ll x, ll y){return (x+y)%mod;}
ll modsub(ll x, ll y){return (x-y+mod)%mod;}
ll fact[1000007]={0};
void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<100007;i++)fact[i]=(fact[i-1]*i)%mod;}
ll ncr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[r],mod-2)))%mod; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
ll npr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
#define max 1000005
bool prime[max];
/*ull sieve()
{
	memset(prime,true,sizeof(prime));
	for(ull p=2;p*p<max;p++)
	{
		if(prime[p]==true){
			for(ull i=2*p;i<max;i+=p)
			{
				prime[i]=false;
			}
		}
	}
	prime[0]=0;
	prime[1]=0;
}*/
using namespace std;
signed main()
{
	string s;
	cin>>s;
	for(int i=0;i<s.length();i++)
	{
		if(s[i]=='7')
		{
			cout<<"Yes"<<endl;
			return 0;
		}
	}
	cout<<"No"<<endl;
}













Measured memory_bytes: 3632
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	private Scanner in = new Scanner(System.in);
	
	private Main() {
		int n = in.nextInt();
		int numOfBall = 10;
		
		for(int i=0;i<n;i++) {
			ArrayList<Integer> dataset = new ArrayList<Integer>();	
			for(int j=0;j<numOfBall;j++) {
				 dataset.add(in.nextInt());
			}
			int[] cylinders = new int[2]; //筒(の最後の要素)
			System.out.println(solve(dataset, cylinders));
		}
		
	}
	
	private String solve(ArrayList<Integer> dataset,int[] cylinders) {
		if(dataset.isEmpty())
			return "YES";
		
		int head = dataset.remove(0);
		if(head > cylinders[0]) {
			cylinders[0] = head;
		} else if(head > cylinders[1]) {
			cylinders[1] = head;
		} else {
			return "NO";
		}
		return solve(dataset, cylinders);
	}

	public static void main(String[] args) {
		new Main();
	}

}

Measured memory_bytes: 11000
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+10;
typedef long long LL;
int n,X,Y;
vector<int> G[N],v;
bool vis[N];

void dfs(int x,int dep) {
	if (dep%2) X++; else Y++;
	v.push_back(x);
	vis[x]=1;
	for (int i=0;i<G[x].size();i++) {
		int t=G[x][i];
		if (vis[t]) continue;
		dfs(t,dep+1);
	}
}

int main()
{
	cin>>n;
	for (int i=1;i<=n;i++) {
		int x,y; scanf("%d%d",&x,&y);
		G[x].push_back(y+100000);
		G[y+100000].push_back(x);
	}
	
	memset(vis,0,sizeof(vis));
	LL ans=0;
	for (int i=1;i<=200000;i++) 
		if (G[i].size() && !vis[i]) {
			X=0; Y=0; v.clear();
			dfs(i,1);
			LL num=0;
			for (int j=0;j<v.size();j++) num+=G[v[j]].size();
			ans+=(LL)X*Y-num/2;
		}
	cout<<ans<<endl;	
	return 0;
}

Measured memory_bytes: 11772
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> using vt = vector<T>;
template<class T> using vvt = vector<vt<T>>;
template<class T> using ttt = tuple<T,T>;
using tii = tuple<int,int>;
using vi = vector<int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define mt make_tuple
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
#define DIV int(1e9+7)
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-8;
//const double PI = M_PI;  
inline ll pow(ll x,ll n,ll m){ll r=1;while(n>0){if((n&1)==1)r=r*x%m;x=x*x%m;n>>=1;}return r%m;}
inline ll lcm(ll d1, ll d2){return d1 / __gcd(d1, d2) * d2;}
/* Coding space */
template<class T>
struct BIT{
    vector<T> d;
    BIT(size_t n):d(n+1){}
    T sum(size_t i){T s{};for(++i;i>0;i-=i&-i)s+=d[i];return s;}
    T sum(size_t i,size_t j){return i?sum(j)-sum(i-1):sum(j);}
    void add(size_t i,T x){for(++i;i<d.size();i+=i&-i)d[i]+=x;}
};
int main(){
  string s,t; cin >> s >> t;
  BIT<int> ssum(s.size()+1),tsum(t.size()+1);
  rep(i,s.size()) if(s[i] == 'A') ssum.add(i+1,1);
  rep(i,t.size()) if(t[i] == 'A') tsum.add(i+1,1);
  int q; cin >> q;
  rep(i,q){
    int a,b,c,d; cin >> a >> b >> c >> d;
    int s_a_num = ssum.sum(a,b) + (b-a+1-ssum.sum(a,b))*2;
    int t_a_num = tsum.sum(c,d) + (d-c+1-tsum.sum(c,d))*2;
    SHOW(s_a_num,t_a_num);
    SHOW(ssum.sum(a,b),tsum.sum(c,d));
    cerr <<(s_a_num - t_a_num)%3 << endl;
    if((s_a_num - t_a_num)%3 == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}

Measured memory_bytes: 1664
#include<iostream>
#include<cmath>
#include<algorithm>
#include <iomanip> 
#include<vector>
#define fo(i,n) for(ll i=0;i<n;i++)
#define f(i,n) for(ll i=1;i<n;i++)
#define ff(i,k,n) for(ll i=k,i<n;i++)
#define ll long long
/*Elegizip, elegizip otken sol bir shaktar-ai
 Elendeter zamanymnyn otip bara zhatkanny-ai
Umytylmas-Umytylmas Kairan esil shaktar-ai
Zamanymnyn kolyn bulgap otip bara jatkany-ai
 kairan esil , kairan esil shaktar-ai
kolyn bulgap zamanymnyn otip bara jatkany-ai;*/
using namespace std;

int main()
{ios::sync_with_stdio(0);
double n;
cin>>n;
cout<<2*3.14*n;

}





Measured memory_bytes: 3792
#include <bits/stdc++.h>
typedef long long ll;
#define pb push_back

using namespace std;


ll T;
ll A, B , C , D;
int main()
{
        ios_base::sync_with_stdio(false);
        cin.tie(NULL); cout.tie(NULL);
        cin >> T;
        while(T--) {

                cin >> A >> B >> C >> D;
                if(A < B) {
                        cout << "No\n"; continue;
                }else if(D < B) {
                        cout << "No\n"; continue;
                }
                if(C >= B-1){
                        cout << "Yes\n"; continue;
                }

                ll g = __gcd(B,D);
                A = A%B;
                ll yo = (B - A + g - 1) / g;
                yo--;
                if((A + yo*g)%B > C){
                        cout << "No\n";
                }else cout << "Yes\n";
        }
        return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include<time.h>
using namespace std;
typedef long long int llint;
typedef pair<int, int> pint;
typedef pair < llint, llint> pllint;
typedef vector<int> vint;
typedef vector<llint> vllint;
typedef vector<pint> vpint;
typedef vector<pair<llint, llint>> vpllint;
typedef vector<vector<int>> vvint;
typedef vector<vector<llint>> vvllint;
typedef vector<vector<pint>> vvpint;
typedef vector<bool> vbool;
#define rep(i,n) for(int i=0;i<n;i++)
#define drep(i,n) for(int i=n-1;0<=i;i--)
#define yes(ans) if(ans)cout<<"yes"<<endl;else cout<<"no"<<endl;
#define Yes(ans) if(ans)cout<<"Yes"<<endl;else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl;else cout<<"NO"<<endl;
#define POSSIBLE(ans) if(ans)cout<<"POSSIBLE"<<endl;else cout<<"IMPOSSIBLE"<<endl;
#define Pi 3.1415926535897932384626

class UnionFind {
public:
	//親の番号を格納する。親だった場合は-(その集合のサイズ)
	vector<int> Parent;

	//作るときはParentの値を全て-1にする
	//こうすると全てバラバラになる
	UnionFind(int N) {
		Parent = vector<int>(N, -1);
	}

	//Aがどのグループに属しているか調べる
	int root(int A) {
		if (Parent[A] < 0) return A;
		return Parent[A] = root(Parent[A]);
	}

	//自分のいるグループの頂点数を調べる
	int size(int A) {
		return -Parent[root(A)];//親をとってきたい
	}

	//AとBをくっ付ける
	bool connect(int A, int B) {
		//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
		A = root(A);
		B = root(B);
		if (A == B) {
			//すでにくっついてるからくっ付けない
			return false;
		}

		//大きい方(A)に小さいほう(B)をくっ付けたい
		//大小が逆だったらひっくり返しちゃう。
		if (size(A) < size(B)) swap(A, B);

		//Aのサイズを更新する
		Parent[A] += Parent[B];
		//Bの親をAに変更する
		Parent[B] = A;

		return true;
	}
};

//aとbの最大公約数を求めるよ
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

// 返り値: a と b の最大公約数
// ax + by = gcd(a, b) を満たす (x, y) が格納される
long long extGCD(long long a, long long b, long long& x, long long& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}

bool check(pint a, pint b) {
	if (a.second == b.second) {
		return a.first > b.first;
	}
	return a.second > b.second;
}

// mod. m での a の逆元 a^{-1} を計算する
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

//aCbを1000000007で割った余りを求める
llint convination(llint a, llint b) {
	llint ans = 1;
	for (llint i = 0; i < b; i++) {
		ans *= a - i;
		ans %= 1000000007;
	}
	for (llint i = 1; i <= b; i++) {
		ans *= modinv(i, 1000000007);
		ans %= 1000000007;
	}
	return ans;
}

//aのb乗を1000000007で割った余りを求める
llint power(llint a, llint b) {
	if (b == 1)return a;
	if (b == 0)return 1;
	llint tmp = power(a, b / 2);
	tmp *= tmp;
	tmp %= 1000000007;
	if (b % 2 == 1) {
		tmp *= a;
		tmp %= 1000000007;
	}
	return tmp;
}

int main() {
	int n;
	double ans = 0;
	cin >> n;
	rep(i, n) {
		double x;
		cin >> x;
		ans += 1 / x;
	}
	printf("%.15f\n", 1 / ans);
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
	int x, w, i, j, total = 0, score = 0, num;
	while (1){
		scanf("%d", &num);
		if (num == 0) break;
		for (i = 0; i < num; i++){
			for (j = 0; j < 3; j++){
				scanf("%d", &x);
				if (x == 0) break;
				total += x;
			}
			scanf("%d", &w);
			if (total <= 60 && w <= 2){
				score += 600;
			}else if (total <= 80 && w <= 5){
				score += 800;
			}else if (total <= 100 && w <= 10){
				score += 1000;
			}else if (total <= 120 && w <= 15){
				score += 1200;
			}else if (total <= 140 && w <= 20){
				score += 1400;
			}else if (total <= 160 && w <= 25){
				score += 1600;
			}
			total = 0;
		}
		printf("%d\n", score);
		score = 0;
	}
	return 0;
}

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

int f(int n){
  int ans = 0;
  while(n > 0){
    ans += n % 10;
    n /= 10;
  }
  return ans;
}

int main(void){
  int n, a, b, temp;
  cin >> n >> a >> b;
  int sum = 0;
  for(int i = 0; i <= n; i++){
    temp = f(i);
    if(a <= temp && temp <= b) sum += i;
  }
  cout << sum << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
using namespace std;
typedef pair<int, int> pii;
#define MAX 99999999
typedef struct{
    int time;
    int num;
    int qst;
    int judge;
}data;
typedef  pair<int, pair<int, int>>pi; //  seikai time number
int main(){
    int m,t,p,r;
    while(cin>>m>>t>>p>>r,m+t+r+p){
    vector<data>v;
    vvi team(60,vi(60,0));
    vvi lost(1000,vi(100,0));
    rep(i,r){
        data temp;
        cin>>temp.time>>temp.num>>temp.qst>>temp.judge; v.push_back(temp);
        if(!(v[i].judge)){
            team[v[i].num][v[i].qst]=1;
            lost[v[i].num][v[i].qst]+=v[i].time;
        }else{
            lost[v[i].num][v[i].qst]+=20;
        }
    }
    vector<pi>ans(100,pi(0,pii(-INF,0)));

    for(int i=1; i<=t;i++){
        ans[i].second.second=i;
        for(int j=1; j<=p;j++)
            if(team[i][j]){
                ans[i].first++; ans[i].second.first-=lost[i][j]; ans[i].second.second=i;
        }
    }
    sort(ans.begin()+1,ans.begin()+t+1,greater<pi>());
        rep(i,t){
            if(i){
                if(ans[i].first==ans[i+1].first&&ans[i].second.first==ans[i+1].second.first)
                    cout<<"=";
                else
                    cout<<",";
            }
            cout<<ans[i+1].second.second;
        }
        cout<<endl;
    }
}

Measured memory_bytes: 3232
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws IOException {
        Scanner s = new Scanner(System.in);
        int a = s.nextInt(),b=s.nextInt(),c=s.nextInt();
        if((a==5&&b==5&&c==7)||(a==5&&b==7&&c==5)||(a==7&&b==5&&c==5)) System.out.println("YES");
        else System.out.println("NO");


    }
}




class Scanner
{
    StringTokenizer st;
    BufferedReader br;

    public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

    public String next() throws IOException
    {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    public int nextInt() throws IOException {return Integer.parseInt(next());}

    public long nextLong() throws IOException {return Long.parseLong(next());}

    public String nextLine() throws IOException {return br.readLine();}

    public double nextDouble() throws IOException
    {
        String x = next();
        StringBuilder sb = new StringBuilder("0");
        double res = 0, f = 1;
        boolean dec = false, neg = false;
        int start = 0;
        if(x.charAt(0) == '-')
        {
            neg = true;
            start++;
        }
        for(int i = start; i < x.length(); i++)
            if(x.charAt(i) == '.')
            {
                res = Long.parseLong(sb.toString());
                sb = new StringBuilder("0");
                dec = true;
            }
            else
            {
                sb.append(x.charAt(i));
                if(dec)
                    f *= 10;
            }
        res += Long.parseLong(sb.toString()) / f;
        return res * (neg?-1:1);
    }

    public boolean ready() throws IOException {return br.ready();}


}

Measured memory_bytes: 25380
n = int(input())
As = list(map(int, input().split()))
As.sort(reverse=True)
if (len(As) % 2 == 0):
  ans = sum(As[:len(As) // 2] * 2) - As[0]
else:
  ans = sum(As[:(len(As) + 1) // 2]) * 2 - As[len(As) // 2] - As[0]
print(ans)

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

const ll MOD = 1e9 + 7;
ll dp[1 << 21];

int main() {
    int n;
    cin >> n;
    vector<vector<int>> v(n, vector<int>(n));
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < n; j++)
            cin >> v[i][j];
    }
    dp[0] = 1;
    for(int msk = 1; msk < (1 << n); msk++) {
        int r = __builtin_popcount(msk) - 1;
        for(int i = 0; i < n; i++) {
            if((msk & (1 << i)) && v[r][i])
                dp[msk] = (dp[msk] + dp[msk ^ (1 << i)]) % MOD;
        }
    }
    cout << dp[(1 << n) - 1] << endl;
}

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

int main() {

    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;

    int dx = x2 - x1;
    int dy = y2 - y1;

    cout << x2 - dy << " " << y2 + dx << " " << x1 - dy << " " << y1 + dx << endl;

    return 0;
}


Measured memory_bytes: 3628
n = int(input())
a_list = sorted([int(x) for x in input().split()], reverse=True)
m = n
if m % 2 == 1:
    a_list.append(0)
    m += 1
for i in range(0, m, 2):
    if not (a_list[i] == a_list[i + 1] == n - (i + 1)):
        print(0)
        exit()
print(2 ** (n // 2) % (10 ** 9 + 7))

Measured memory_bytes: 19932
#define _USE_MATH_DEFINES
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <numeric>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
#include <cassert>
#include <random>
#include <time.h>
#include <unordered_set>

using namespace std;
using Int = long long;

constexpr double EPS = 1e-10;
constexpr long long MOD = 1000000007;

long long mod_pow(long long x, long long n) {
    long long res = 1;
    for (int i = 0;i < 60; i++) {
        if (n >> i & 1) res = res * x % MOD;
        x = x * x % MOD;
    }
    return res;
}

long long my_mod_pow(long long x, long long n) {
	long long ret = 1;
	for (; n > 0; n >>= 1, x = x * x % MOD) {
		if (n & 1) {
			ret = ret * x % MOD;
		}
	}
	return ret;
}

template<typename T>
T gcd(T a, T b) {
    return b != 0 ? gcd(b, a % b) : a;
}

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

void fastInput() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}

int main(void) {
    int A, B, C; cin >> A >> B >> C;
    swap(A, B);
    swap(A, C);
    cout << A << " "<< B << " " <<  C << endl;

}


Measured memory_bytes: 888
import java.util.Scanner;

/**
 * input１行目に各面の整数が、図に示すラベルの順番に空白区切りで与えられます。 
 * ２行目に命令を表す１つの文字列が与えられます。命令はそれぞれ図に示す４方向を表す文字 E、N、S、W を含む文字列です。 
 * output
 * すべての命令を実行した後のサイコロの上面の数を１行に出力してください。 
 * @author U633758
 *
 */

public class Main {
	static Scanner scan = new Scanner(System.in);
	
	public static int T=0,S=0,E=0,W=0,N=0,U=0;
	public static void main(String[] args){

		
		Dice_Input();

		Dice_Move(scan.next());
		System.out.println(T);		//上面を出力
	}

	/**
	 * 現在のダイスの状態をInput
	 * @param args
	 */
	public static void Dice_Input(){
		int[] Dice_num = new int[6];

		for(int i = 0;i < 6; i++){
			Dice_num[i] = scan.nextInt();;
		}

		T = Dice_num[0];		//Top
		S = Dice_num[1];
		E = Dice_num[2];
		W = Dice_num[3];
		N = Dice_num[4];
		U = Dice_num[5];		//Under

		//return Dice_num;



	}

	/**
	 * 入力されたコマンド(S,E,N,W)に応じてダイスを動かす
	 * @param command
	 */
	public  static void Dice_Move(String command){
		//command:NSWE
		char[] command_c = command.toCharArray();
		for(int i = 0;i < command_c.length; i++){
			switch(command_c[i]){
			case 'S':
				MoveSouth();
				break;
			case 'E':
				MoveEast();
				break;
			case 'N':
				MoveNorth();
				break;
			case 'W':
				MoveWest();
				break;
			default:
				break;
			}
		}
	}


	public static void MoveSouth(){
		int a = T;
		T = N;
		N = U;
		U = S;
		S = a;
	}
	public static void MoveEast(){
		int a = T;
		T = W;
		W = U;
		U = E;
		E = a;
	}
	public static void MoveNorth(){
		int a = T;
		T = S;
		S = U;
		U = N;
		N = a;
	}
	public  static void MoveWest(){
		int a = T;
		T = E;
		E = U;
		U = W;
		W = a;
	}

}


Measured memory_bytes: 26348
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <cassert>
#include <memory>
#include <stack>
#include <set>
#include <map>
#include <cctype>

#define MAX_SIZE 100000000
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

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

  int H,W; cin>>H>>W;
  vector<string> S(H);
  for(auto& s : S) {
    cin >> s;
  }

  vector<int> dx = {-1, 0, 1, -1, 1, -1, 0, 1};
  vector<int> dy = {-1, -1, -1, 0, 0, 1, 1, 1};

  for(int i = 0; i < H; i++) {
    for(int j = 0; j < W; j++) {
      auto c = S[i][j];
      if(c == '.') {
        int bomb = 0;
        for(int n = 0; n < 8; n++) {
          int nx = j + dx[n], ny = i + dy[n];
          if(!(nx >= 0 && nx < W) || !(ny >= 0 && ny < H)) {
            continue;
          }
          if(S[ny][nx] == '#') {
            bomb++;
          }
        }
        cout << bomb;
      } else if(c == '#') {
        cout << c;
      }
    }
    cout << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iomanip>
#include <math.h>
//#include <unistd.h>
//#include <stdio.h>
#define rep(i,x) for(ll i = 0;i<x;i++)
#define all(a) (a).begin(),(a).end()
using ll = long long;
using ld = long double;
using namespace std;
using dou = double;
const ll inf = 2147483647;
const ll INF = 1LL << 60;
const ll mod = 1000000007;
const ld pi = 3.14159265358;
typedef pair<ll,ll> P;
using graph = vector<vector<ll>>;
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;}
ll gcd(ll a,ll b){
    if(a < b)swap(a,b);
    if(a % b == 0)return b;
    else return gcd(b,a%b);
}
//素数判定O(sqrt(N))
bool isp(ll n){
    bool res = true;
    if(n == 1)return false;
    else{
        for(ll i = 2;i * i <= n;i++){
            if(n % i == 0){
                res = false;
                break;
            }
        }
        return res;
    }
}

ll fac[510000], finv[510000], inv[510000];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < 510000; i++){
        fac[i] = fac[i - 1] * i % mod;
        inv[i] = mod - inv[mod%i] * (mod / i) % mod;
        finv[i] = finv[i - 1] * inv[i] % mod;
    }
}

// 二項係数計算
ll COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}
//nのm乗をMODで割ったあまりO(logN)
ll modpow(ll n,ll m,ll MOD){
    ll res = 1;
    while(m){
        if(m & 1)res = (res * n) % MOD;
        m >>= 1;
        n *= n;
        n %= MOD;
    }
    return res;
}

//printf("%.10f\n", N);
/*  vector<ll> vec = {1,2,5,6,8,9,10};
    cout << binary_search(all(vec),5) << endl; -> true*/
/*
    vector<ll> vec = {1,2,5,6,8,9,10};
    auto n = upper_bound(all(vec),4);
    cout << *n << endl; -> 5*/

//    cout << fixed << setprecision(15);


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll N;
    cin >> N;
    vector<ll> n(N);
    rep(i,N)cin >> n[i];
    ll ans = __gcd(n[0],n[1]);
    rep(i,N - 2){
        ans = __gcd(ans,n[i + 2]);
    }
    cout << ans << "\n";
}

Measured memory_bytes: 3984
#include <stdio.h>
int main(void){
    int n, q;
    int S[10000];
    int T[500];
    int count = 0;

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

    scanf("%d", &q);
    for (int i = 0; i < q; i++){
        scanf("%d", &T[i]);

        for (int k = 0; k < n; k++){
            if (S[k] == T[i]){
                count += 1;
                break;
            }
        }
    }

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

    
}


Measured memory_bytes: 2112
#include <iostream>
#include <algorithm>
#include <numeric>
#include <queue>
#include <utility>
#include <cmath>
using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)

int main() {
	int N, A, B, C, D;
	cin >> N >> A >> B >> C >> D;

	string S;
	cin >> S;

	//case1

	bool ans = false;

	if(D>C){
		bool flag1 = true;
		for(int i=B-1;i<D;++i){
			if(i>B-1){
				if(S[i-1]=='#' && S[i]=='#'){
					flag1 = false;
				}
			}
		}
		bool flag2 = true;
		for(int i=A-1;i<C;++i){
			if(i>A-1){
				if(S[i-1]=='#' && S[i]=='#'){
					flag2 = false;
				}
			}
		}

		if(flag1 && flag2) ans = true;

	}else{
		bool flag1 = true;
		for(int i=B-1;i<D;++i){
			if(i>B-1){
				if(S[i-1]=='#' && S[i]=='#'){
					flag1 = false;
				}
			}
		}
		bool flag2 = true;
		for(int i=A-1;i<C;++i){
			if(i>A-1){
				if(S[i-1]=='#' && S[i]=='#'){
					flag2 = false;
				}
			}
		}

		bool flag3 = false;
		for(int i=B-1;i<D;++i){
			if(i>B){
				if(S[i-2]=='.' && S[i-1]=='.' && S[i]=='.'){
					flag3 = true;
				}
			}
		}
		
		if(S[B-2]=='.' && S[B-1]=='.' && S[B]=='.') flag3=true;
		if(S[D-2]=='.' && S[D-1]=='.' && S[D]=='.') flag3=true;

		if(flag1 && flag2 && flag3) ans = true;
	}

	if(ans) cout << "Yes" << endl;
	else cout << "No" << endl;


}


Measured memory_bytes: 640
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
#define INF 1LL<<50
#define fst first
#define snd second
#define pb push_back
#define int long long
#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ITR(itr,mp) for(int itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(int itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define debug(x)  cout << #x << " = " << (x) << endl;
typedef long long ll;
typedef pair<ll,ll> P;

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

  int n;
  cin >> n;

  int x[n],y[n];
  REP(i,n) cin >> x[i] >> y[i];
  
  REP(i,n){
    vector <double>t;
    REP(j,n){
      if(i == j) continue;
      t.push_back(atan2(y[j]-y[i],x[j]-x[i]));
    }
    sort(ALL(t));
    double mx = 0;
    REP(j,n-2){
      mx = max(mx,t[j+1]-t[j]);
    }
    mx = max(mx,t[0]+2*M_PI-t[n-2]);
    cout << fixed << max((mx-M_PI)/(2*M_PI),0.0) << endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<string.h>
#include<cstdlib>
#include<map>
#include<fstream>
#include<string>
#include<sstream>
#include<iomanip>
#include<cmath>
#include<random>
#include<set>
#include<queue>

using namespace std;

long long dp[3][100100] = {};
const long long INF = 1LL << 60;
#define MOD 1000000007
#define Int int64_t
#define PI 3.14159265358979
#define dump(a) cout << a << endl; 

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

/**
* @fn
* 最大値を取ります.Vector<int>を渡すこと.
*/
long long int imax(vector<int> a) {
	int MAX = -10000000;
	for (int i = 0; i < a.size(); i++) {
		if (MAX < a.at(i)) MAX = a.at(i);
	}
	return MAX;
}

/**
* @fn
* 最小値を取ります.Vector<int>を渡すこと.
*/
long long int imin(vector<int> a) {
	int MIN = 1000000000;
	for (int i = 0; i < a.size(); i++) {
		if (MIN > a.at(i)) MIN = a.at(i);
	}
	return MIN;
}

/**
* @fn
* 自然数について、桁数を求める
*/
Int getDigit(Int num) {
	return (Int)(log10(num)) + 1;
}


int get2Digit(Int num) {
	int cnt = 0;
	while (num > 0) {
		if (num % 2 != 0) {
			return cnt;
		}
		cnt++;
		num /= 2;
	}
}

long long int absmin(vector<int> a, long long int b) {
	int mini = 100000000;
	int d = 0;
	for (int i = 0; i < a.size(); i++) {
		if (mini > abs(a.at(i) - b)) {
			mini = abs(a.at(i) - b);
			d = i;
		}
	}
	return d;
}


long long int absmax(vector<int> a, long long int b) {
	int max = -100000000;
	int d = 0;
	for (int i = 0; i < a.size(); i++) {
		if (max < abs(a.at(i) - b)) {
			max = abs(a.at(i) - b);
			d = i;
		}
	}
	return d;
}

int gcd(int a, int b)
{
	if (a < b) swap(a, b);
	if (b < 1) return -1;
	if (a % b == 0) return b;
	return gcd(b, a % b);
}

void haerobatya(int start, int end, char level) {
	if (start > end) swap(start, end);
	for (int i = start; i <= end; i++) {
		if (i < 100) {
			cout << "https://atcoder.jp/contests/abc0" << i << "/tasks/abc0" << i << "_" << level << endl;
		}
		else {
			cout << "https://atcoder.jp/contests/abc" << i << "/tasks/abc" << i << "_" << level << endl;
		}
	}
}

long long int cntmod(long long int warareru, long long int mod) {
	long long int i = 0;
	for (i = 0; true; i++) {
		if (warareru % mod == 0 && warareru >= mod) {
			warareru /= mod;
		}
		else {
			return i;
		}
	}
}

void ansYes(bool a) {
	if (a == true) cout << "Yes" << endl;
	else cout << "No" << endl;
}

void ansYES(bool a) {
	if (a == true) cout << "YES" << endl;
	else cout << "NO" << endl;
}


Int euclidean_gcd(Int a, Int b) {
	while (true) {
		if (a < b) swap(a, b);
		if (!b) break;
		a %= b;
	}
	return a;
}

typedef pair<int, int> pai;


//ここまでライブラリ
//ここから本文

int main() {
	int a[3];
	cin >> a[0] >> a[1] >> a[2];
	sort(a, a + 3);
	cout << a[0] * a[1] / 2 << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD ((ll)(1e9+7))
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#define FIND(v,x) (binary_search(ALL(v),(x)))
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v));reverse(ALL(v))
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define pb push_back
#define fi first
#define se second
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
template<class T> inline bool chmin(T& a, T b){return a>b ? a=b, true : false;}
template<class T> inline bool chmax(T& a, T b){return a<b ? a=b, true : false;}
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;

int main(void)
{
    int N,K;
    cin >> N >> K;
    vector<int> H(N);
    for (int i = 0; i < N; i++) {
        cin >> H[i];
    }
    RSORT(H);
    ll ans = 0;
    Rep(i, K, N){
        ans += H[i];
    }

    pr(ans);
}

Measured memory_bytes: 1024