akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
const double EPS = 1e-10;
using namespace std;
class Edge{
public:
    int from,to,value;
    Edge(LL a,LL b,LL c){
        from = a;
        to = b;
        value = c;
    }
    Edge(LL a,LL b){
        from = a;
        to = b;
    }
};



int main(){
    int N,K;cin >> N >> K;
    vector<vector<int>> E(N);
    for(int a = 0;a < N-1;a++){
        int b,c;cin >> b >> c;
        b--, c--;
        E.at(b).push_back(c);
        E.at(c).push_back(b);
    }
    vector<int> visit(N, -1);
    queue<pair<int, vector<int>>> que;
    que.push(make_pair(0, vector<int>(2, 0)));
    while(!que.empty()){
        auto q = que.front();
        que.pop();
        visit.at(q.first) = K-q.second.front()-q.second.back();
    //    cout<<q.first<<" "<<q.second.front()<<" "<<q.second.back()<<endl;
        if(visit.at(q.first) <= 0){
            cout<<0<<endl;
            return 0;
        }
        int cnt = 0;
        for(auto e : E.at(q.first)){
            if(visit.at(e) == -1){
                que.push(make_pair(e, vector<int>({1, q.second.front()+cnt})));
                cnt++;
            }
        }
    }
    LL ans = 1;
    for(int i = 0;i < N;i++){
    //    cout<<visit.at(i)<<endl;
        ans *= visit.at(i);
        ans %= MOD;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 12920
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll> 
#define P pair<ll,ll>
#define ALL(a) (a).begin(),(a).end()
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;cin>>s;
  if(s[2]==s[3]&&s[4]==s[5]) puts("Yes");else puts("No");
  return 0;
}

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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
using P = pair<ll,ll>;
using ld=long double;

int main(){
  int n;cin >>n;
  vector<int>a(n);
  unordered_set<int>s;
  for (int i = 0; i < n; ++i) {
      cin>>a[i];
      s.insert(a[i]);
  }
  sort(all(a));
  if(s.size()>3){
      puts("No");
      return 0;
  }
  vector<int>num;
  int key=a[0];
  int j=0;
  int now=0;
  for (int i = 0; i < n; ++i) {
      if(a[i]!=key){
          num.push_back(now);
          key=a[i];
          now=1;
      }
      else now++;
    }
  if(now!=0){
      num.push_back(now);
  }
  if(n%3!=0){
      if(s.size()!=1)puts("No");
      else if(a[0]!=0)puts("No");
      else puts("Yes");
  }
  else {
      if(s.size()==1){
          if(a[0]==0)puts("Yes");
          else puts("No");
      }
      else if(s.size()==2){
          if(a[0]==0&&num[0]==n/3){
              puts("Yes");
          }
          else puts("No");
      }
      else {
          vector<int>x;
          for(auto e:s){
              x.push_back(e);
          }
          int key=x[0]^x[1]^x[2];
          if(key==0&&num[0]==n/3&&num[1]==n/3) {
              puts("Yes");
          }
          else puts("No");
      }
  }
}


Measured memory_bytes: 6776
#include <iostream>
#include <cmath>
#include <algorithm>
#include <climits>
#include <vector>
#include <string>
#include <set>
#include <iomanip>
#include <map>
#define rep(i,n) for (int i=0;i<(n);++i)
#define REP(i,n) for (int i=0;i<=(n);++i)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
const int INF = 10000000;

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

int main() {
    int n; cin >> n;
    vector<int> a(n);
    int b = 0;
    rep(i, n) {
        cin >> a[i];
        b ^= a[i];
    }
    rep(i, n){
        cout << (b^a[i]);
        if(i != n-1) cout << ' ';
    }
    cout << endl;
}

Measured memory_bytes: 3988
#include<stdio.h>
int parent(int);
int left(int);
int right(int);


int main(){
  int n, i, x;
  int a[250];
  scanf("%d", &n);

  for ( i = 1; i < n+1; i++ ){
    scanf("%d", &a[i]);
  }

  /*if(n==1)printf("node 1: key = %d, \n",a[1]);
  else  if(n==2)printf("node 1: key = %d, left key = %d, \n",a[1],a[2]);
 else{
 printf("node 1: key = %d, left key = %d, right key = %d, \n",a[1],a[2],a[3]);*/
    
 for ( i = 1; i <= n; i++ ){
   printf("node %d: key = %d, ",i,a[i]);
   if(i!=1) printf("parent key = %d, ",a[parent(i)]);
   if(n>=2*i){
     printf("left key = %d, ",a[left(i)]);
   }
   if(n>=2*i+1){
     printf("right key = %d, ",a[right(i)]);
   }
   printf("\n");
   
 }
 return 0;
}

int parent(a){
  return a/2;
}
int left(a){
  return 2*a;
}
int right(a){
  return 2*a+1;
}

Measured memory_bytes: 600
#include<stdio.h>
#define N 100000

int partition(int [], int , int , int ); 

int main(){
  
  int A[N], n, i, q;

  scanf("%d", &n);
  for(i=0;i<n;i++){
    scanf("%d", &A[i]);
  }
  q = partition(A, n, 0, n-1);

  for(i=0;i<n;i++){

    if(i){
      printf(" ");
    }

    if(i==q){
      printf("[");
    }
    
    printf("%d", A[i]);

    if(i==q){
      printf("]");
    }
  }
  printf("\n");

  return 0;
}
int partition(int A[], int n, int p, int r){
  int x, i, j, t;
  
  x = A[r];
  i = p - 1;
  for(j=p;j<=r-1;j++){
    if(A[j]<=x){
      i++;
      t = A[i];
      A[i] = A[j];
      A[j] = t;
    }
  }
  t = A[i+1];
  A[i+1] = A[r];
  A[r] = t;
  
  return i+1;
}

Measured memory_bytes: 992
#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/math/common_factor_rt.hpp>

using namespace std;

int main()
{
    int64_t N, M;
    std::cin >> N >> M;

    if (N > M) {
        std::swap(N, M);
    }

    // N < M

    int64_t ans = 0;
    if (N >= 3) {
        ans = (N-2) * (M - 2);
    }
    else if (N == 2) {
        ans = 0;
    }
    else if (N == 1) {
        if (M >= 3) {
            ans = M - 2;
        }
        else if (M == 1) {
            ans = 1;
        }
    }

    std::cout << ans << std::endl;

    return 0;
}


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

#define print cout <<

class StrProc{
  public :
    string removeTargetStr(string rowStr, string target){
      int start_idx = rowStr.find(target);
      while(start_idx!=string::npos){
        rowStr.replace(start_idx,target.size(),"");
        start_idx = rowStr.find(target);
      }
      return rowStr;
    }

    vector<int> calculateSimiralities(string rowStr, string target){
      int idx_size = rowStr.size() - target.size() + 1;
      vector<int> results(idx_size);
      for(int i=0;i<idx_size;i++){
        string cropped = rowStr.substr(i,target.size());
        results.at(i) = calculateSimirality(cropped,target);
      }
      return results;
    }

    int calculateSimirality(string rowStr, string target){
      int same = 0;
      for(int i=0;i<rowStr.size();i++){
        if(rowStr.at(i)==target.at(i)){
          same +=1;
        }
      }
      return same;
    } 
};

int main(){
    string S,T;
    cin >> S >> T;
    auto pro = StrProc();
    auto sim = pro.calculateSimiralities(S, T);

    int max = *max_element(sim.begin(), sim.end());
    int sub = T.size() - max;
    print sub << endl;
}


Measured memory_bytes: 3644
H, W, N = gets.strip.split(/ /).collect{|n| n.to_i}

table = {}

N.times{
	a, b = gets.strip.split(/ /).collect{|n| n.to_i}
	h_min = [a - 3, 0].max
	h_max = [a - 1, H - 3].min
	w_min = [b - 3, 0].max
	w_max = [b - 1, W - 3].min
	
	(h_min..h_max).each{|h|
		(w_min..w_max).each{|w|
			unless row = table[h]
				row = table[h] = {}
			end
			
			if n = row[w]
				row[w] = n + 1
			else
				row[w] = 1
			end
		}
	}
}

counts = [0] * 10

table.each{|h, row|
	row.each{|w, n|
		counts[n] += 1
	}
}

zero = (H - 2) * (W - 2)

(1..9).each{|n|
	zero -= counts[n]
}

puts zero

(1..9).each{|n|
	puts counts[n]
}



Measured memory_bytes: 113276
import collections


def main():
    n = int(input())
    D = list(map(int, input().split()))

    mod = 998244353

    if D[0] != 0:
        print(0)
        return

    cnt = collections.Counter(D)

    if cnt[0] > 1:
        print(0)
        return

    ans = 1

    for i in range(1, max(D)+1):
        if cnt[i - 1] == 1:
            continue
        ans *= cnt[i - 1] ** cnt[i] % mod
        ans %= mod

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 24376
import collections
s = input()
k = int(input())
d = []
dd = collections.defaultdict(list)
for i in range(len(s)):
    d.append(s[i])
    dd[s[i]] += [1]
for ke in sorted(d.copy()):
    for i in range(len(s)):
        if s[i] == ke:
            for j in range(i + 1, i + 10):
                d.append(s[i:j])
                dd[s[i:j]] += [1]
    if len(dd) >= k:
        d = sorted(collections.Counter(d))
        print(d[k-1])
        exit()


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

int main() {
  int n;
  ll k;
  cin>>n>>k;
  int a[n];
  rep(i,0,n) cin>>a[i];
  int sum=0;
  rep(i,0,n) sum+=a[i];
  vector<int> res;
  for(int i=1;i*i<=sum;i++){
    if(sum%i==0){
      res.push_back(i);
      if(i!=sum/i) res.push_back(sum/i);
    }
  }
  sort(res.begin(),res.end());
  reverse(res.begin(),res.end());
  
  int i=0;
  while(true){
    int b=res[i];
    ll cur=0;
    int c[n];
    rep(i,0,n){
      int d=a[i]%b;
      cur+=d;
      c[i]=d;
    }
    sort(c,c+n);
    reverse(c,c+n);
    int e=cur/b;
    rep(i,0,e) cur-=c[i];
    if(cur<=k){
      cout<<b<<endl;
      break;
    }
    i++;
  }
}


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

#define lint long long
#define P pair<int, int>
#define LLP pair<long long, long long>
#define REP(i, x, n) for(int i = (x), i##_len = (int)(n) ; i < i##_len ; ++i)
#define rep(i, n) for(int i = 0, i##_len = (int)(n) ; i < i##_len ; ++i)
#define reps(i, n) for(int i = 1, i##_len = (int)(n) ; i <= i##_len ; ++i)
#define rrep(i, n) for(int i = (int)(n) - 1 ; i >= 0 ; --i)
#define rreps(i, n) for(int i = (int)(n) ; i > 0 ; --i)
#define SORT(x) sort((x).begin(), (x).end())
#define SORT_INV(x) sort((x).rbegin(), (x).rend())

const int IINF = (1 << 30) - 1;
const long long LLINF = 1LL << 61;
const long long MOD = 1000000007LL;
const int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1};
const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};
const double EPS = 1e-8;

template<typename T>
bool chmin(T &_a, T _b){
    if(_a > _b){
        _a = _b;
        return true;
    }else{
        return false;
    }
}

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

    int n;
    cin >> n;

    vector<int> a(n), cnt(100000);
    rep(i, n){
        cin >> a[i];
        ++cnt[--a[i]];
    }

    vector<int> v(n + 1);
    rep(i, 100000){
        ++v[cnt[i]];
    }

    for(int i = n ; i > 2 ; --i){
        v[i - 2] += v[i];
        v[i] = 0;
    }

    int ans = v[1] + v[2];
    if(v[2] % 2 == 1){
        --ans;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1408
///                ..:: In The Name Of God ::..
#include <bits/stdc++.h>

#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define endl    '\n' 
#define INF 2e9
#define int ll
#define vi          vector<int>
#define de          deque<int>
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()//全範囲指定を簡略化

typedef long long ll;

using namespace std;

//配列の要素数は　sizeof(ar)/sizeof(ar[0]) で求める

signed main(){

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

    int W, H, x, y ;
    cin >> W >> H >> x >> y;
    double ans = (double)W*H/2;
    
    printf("%.10f %d\n", ans, x + x == W && y + y == H);
    
    return 0;

}


Measured memory_bytes: 256
#include<stdio.h>

int main(void){
  int i,j,a,b,n,s=0,m;

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

  for(i=1;i<=n;i++){
    m=0;
    j=i;
    while(1){
      m+=j%10;
      j/=10;
      if(j==0) break;
    }
    if(m>=a&&m<=b) s+=i;
  }

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

  return 0;
}



Measured memory_bytes: 128
#サイコロの問題C
class Dice:
    def __init__(self, input_dice):
        self.flow = [input_dice[3], input_dice[1], input_dice[0], input_dice[5], input_dice[2], input_dice[4]]
        self.dice = [input_dice[3], input_dice[1], input_dice[0], input_dice[5], input_dice[2], input_dice[4]]
  
    def setNumber(self, n0, n1, n2, n3, n4, n5):
        self.dice[0] = n0
        self.dice[1] = n1
        self.dice[2] = n2
        self.dice[3] = n3
        self.dice[4] = n4
        self.dice[5] = n5
        return self.dice
    
    def roll(self, dir):
        if dir == 'S':
            self.setNumber(self.flow[0], self.flow[2], self.flow[5], self.flow[1], self.flow[4], self.flow[3])
            self.flow = self.dice
            return self.dice
        if dir == 'N':
            self.setNumber(self.flow[0], self.flow[3], self.flow[1], self.flow[5], self.flow[4], self.flow[2])
            self.flow = self.dice
            return self.dice
        if dir == 'W':
            self.setNumber(self.flow[2], self.flow[1], self.flow[4], self.flow[0], self.flow[3], self.flow[5])
            self.flow = self.dice
            return self.dice
        if dir == 'E':
            self.setNumber(self.flow[3], self.flow[1], self.flow[0], self.flow[4], self.flow[2], self.flow[5])
            self.flow = self.dice
            return self.dice

    def identify(self, dice_x):
        for i in range(6):
            if self.dice[i] != dice_x[i]:
                return False
                break
            elif i == 5:
                return True

    def check(self, dice_x):
        import sys
        dice_x = [dice_x[3], dice_x[1], dice_x[0], dice_x[5], dice_x[2], dice_x[4]]
        #以下メモ書き[1,2,3,4,5,6]の入力が与えられたとする
        #以下南北方向を軸に回転させる
        #最初2が前面
        for i in range(4):
            self.roll('W')
            if self.identify(dice_x) == True: 
                print('Yes')
                sys.exit()
        #1を前面に持ってきて回転させる
        self.roll('S')
        for i in range(4):
            self.roll('W')
            if self.identify(dice_x) == True: 
                print('Yes')
                sys.exit()
        #5を前面に持ってきて回転させる
        self.roll('S')
        for i in range(4):
            self.roll('W')
            if self.identify(dice_x) == True: 
                print('Yes')
                sys.exit()
        #6を前面に持ってきて回転させる
        self.roll('S')
        for i in range(4):
            self.roll('W')
            if self.identify(dice_x) == True: 
                print('Yes')
                sys.exit()
        #4を前面に持ってきて回転させる
        self.roll('E')
        self.roll('S')
        for i in range(4):
            self.roll('W')
            if self.identify(dice_x) == True: 
                print('Yes')
                sys.exit()
        #3を前面に持ってきて回転させる
        self.roll('N')
        self.roll('N')
        for i in range(4):
            self.roll('W')
            if self.identify(dice_x) == True: 
                print('Yes')
                sys.exit()
        print('No')

dice = list(map(int, input().split()))
dice_x = list(map(int, input().split()))

d = Dice(dice)
d.check(dice_x)


Measured memory_bytes: 5632
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)

def main():
    a,b = LI()
    c = 1
    r = 0
    for i in range(30):
        if c >= b:
            return r
        c += a-1
        r += 1

    return -1


print(main())



Measured memory_bytes: 5580
n = int(input())
s = input()

max_count = 0

for i in range(1, n):
    s1 = ''.join(set(s[:i]))
    s2 = ''.join(set(s[i:]))
    count = 0
    for j in range(len(s1)):
        if s1[j] in s2:
            count += 1
    if count > max_count:
        max_count = count
print(max_count)

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

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

bool isPrime(int n){
    if(n==1)return false;
    if(n==2)return true;
    
    for(int i=2;i<=sqrt(n);i++){
        if(n%i==0)return false;
    }
    return true;
}


int main(){
    int n;
    while(cin>>n){
        if(n==0)break;
        
        vi pri;
        for(int i=2;i<n;i++){
            if( isPrime(i) )pri.pb(i);
        }
        int c=0;
        for(int i=0;i<pri.size();i++){
            if( n-pri[i]>0 && pri[i]<=n-pri[i] && isPrime( n-pri[i] ) ){
                c++;
            }
        }
        cout<<c<<endl;
    }
}

Measured memory_bytes: 1252
s=input()

for i in range(8):
	li=[]
	for j in range(3):
		if i>>j &1:
			li += '+'
		else:
			li += '-'
	ans=s[0] +li[0] +s[1]+li[1]+s[2]+li[2]+s[3]
	val=eval(ans)
	if val == 7:
		print( ''.join(ans)+'=7')
		break

Measured memory_bytes: 3060
// みなさん私はカーティキー・シャルマです。LNMIITで勉強しています。私は2年目で、コロナパンデミックが発
// 生しています。世界は終わりそうだ。だから私はそれを最大限に生きたいと思っています。それはつまり、コー
// ドを最大限に意味しているのです。私の好きなアニメは「キメツノヤイバ」で、私の一番の男の子はゼニツで、
// 私の一番の女の子はネズコです。私の好きな呼吸スタイルは息吹です。私の最高の悪魔の血の芸術は、
// ククシボによって使用される月の息です。ムーザンは亡くなり、今ではタンジローがポップの新しい魔王です。
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <string>
using namespace std;
typedef double  dbl;
typedef long long int lld;
#define PI 3.14159265358979323
#define foi(i,n) for(lld i = 0; i < n; i+=1)
#define fod(i,n) for(lld i=n-1; i >=0; i-=1)
#define MAX std::numeric_limits<lld>::max()
#define MIN std::numeric_limits<lld>::min()
#define FastIO  ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int main ()
{
      
      FastIO
      lld a[5];
      for(lld i = 0; i < 5; i += 1){
            cin >> a[i];
            if (a[i] == 0){
                  cout << i+1;
                  return 0;
            }
      }
      return 0;
}

Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace std;
int n,m,k;
#define int long long
#define sc(x) scanf("%lld",&(x))
int A[200005];

signed main()
{
   sc(n);
   for(int i=0;i < n;i++){
      sc(A[i]);
   }
   sort(A,A+n);
   int ans = 0;
   if(n == 1);
   else if(n==2){
    ans += A[n-1];
   }else if(n==3){
     ans += A[n-1]+A[n-2];
   }else{
      ans += A[n-1];
      for(int i=0;i<n-2;i++){
        ans += A[n-2-i/2];
      }
   }

  cout<<ans;
}


Measured memory_bytes: 5328
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <utility>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(i,x) for(auto i=(x).begin(); i!=(x).end();i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vec vector
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
//template<typename T>void pp(T x){cout<<x<<endl;}

using namespace std;

int main(){
    int n;
    int ans=0;
    cin>>n;
    vector<int> v(n);
    rep(i,0,n){
        cin>>v[i];
    }
    v.erase(unique(all(v)),v.end());
    rep(i,1,v.size()-1){
        if((v[i-1]<v[i]&&v[i]>v[i+1])||(v[i-1]>v[i]&&v[i]<v[i+1])){
            ans++;
            i++;
        }
    }
    
    cout<<ans+1<<endl;
        return 0;
}

Measured memory_bytes: 640
if __name__ == "__main__":
    N = int(input())
    mod = 10 ** 9 + 7

    # すべての組み合わせ
    ans = 1
    for i in range(N):
        ans *= 10
        ans %= mod

    tmp1 = 1
    for i in range(N):
        tmp1 *= 9
        tmp1 %= mod

    tmp2 = 1
    for i in range(N):
        tmp2 *= 8
        tmp2 %= mod

    ans -= tmp1*2
    ans += tmp2
    ans %= mod

    print(ans)


Measured memory_bytes: 9184
#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;}


signed main(){
    int W,H;
    char c;
    cin>>W>>H>>c;

    vector<string>f(H,string(W,'.'));

    f[0][0]=f[0][W-1]=f[H-1][0]=f[H-1][W-1]='+';
    f[H/2][W/2]=c;

    for(int j=1;j<W-1;j++)f[0][j]=f[H-1][j]='-';
    for(int i=1;i<H-1;i++)f[i][0]=f[i][W-1]='|';

    rep(i,H)cout<<f[i]<<endl;
    return 0;
}

Measured memory_bytes: 3148
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
const int N = 5005;
const int mod = 1e9 + 7; 
using namespace std;

int n, m, f[N][N]; 
char s[N]; 

template < typename T >
inline T read()
{
	T x = 0, w = 1; char c = getchar();
	while(c < '0' || c > '9') { if(c == '-') w = -1; c = getchar(); }
	while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return x * w; 
}

int fpow(int x, int y)
{
	int res = 1;
	for( ; y; y >>= 1, x = 1ll * x * x % mod)
		if(y & 1) res = 1ll * res * x % mod;
	return res; 
}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("cpp.in", "r", stdin); 
#endif
	n = read <int> (), scanf("%s", s + 1), m = strlen(s + 1);
	f[0][0] = 1;
	for(int i = 0; i < n; i++)
		for(int j = 0; j < n; j++)
		{
			f[i + 1][j + 1] = (2ll * f[i][j] + f[i + 1][j + 1]) % mod; 
			f[i + 1][max(j - 1, 0)] = (f[i][j] + f[i + 1][max(j - 1, 0)]) % mod; 
		}
	printf("%lld\n", 1ll * f[n][m] * fpow(fpow(2, m), mod - 2) % mod); 
	return 0; 
}


Measured memory_bytes: 100996
import java.util.Scanner;

class Main{
  static class Card{
    String ch;
    int num;

    Card(){}
    Card(String ch, int num){
      this.ch = ch;
      this.num = num;
    }
    Card(Card card){
      this.ch = card.ch;
      this.num = card.num;
    }
  }

  static void trace(Card[] cards){
    for(int i = 0; i < cards.length; i++){
      System.out.print(cards[i].ch + " ");
      System.out.println(cards[i].num);
    }
  }

  static int partition(Card[] cards, int p, int r){
    int x = cards[r].num;
    int i = p-1;
    for(int j = p; j < r; j++){
      if(cards[j].num <= x){
        i++;
        Card tmp = cards[i];
        cards[i] = cards[j];
        cards[j] = tmp;
      }
    }
    Card tmp = cards[i+1];
    cards[i+1] = cards[r];
    cards[r] = tmp;
    return i+1;
  }

  static void quickSort(Card[] cards, int p, int r){
    if(p < r){
      int q = partition(cards, p, r);
      quickSort(cards, p, q-1);
      quickSort(cards, q+1, r);
    }
  }

  static void merge(Card[] a, int left, int mid, int right){
    int n1 = mid - left;
    int n2 = right - mid;
    Card[] L = new Card[n1+1];
    Card[] R = new Card[n2+1];

    for(int i = 0; i < n1; i++)
      L[i] = a[left + i];

    for(int i = 0; i < n2; i++)
      R[i] = a[mid + i];


    L[n1] = new Card();
    R[n2] = new Card();
    L[n1].num = 1000000001;
    R[n2].num = 1000000001;

    int i = 0;
    int j = 0;

    for(int k = left; k < right; k++){
      if(L[i].num <= R[j].num)
        a[k] = L[i++];
      else
        a[k] = R[j++];
    }
  }

  static void mergeSort(Card[] a, int left, int right){
    if(left + 1 < right){
      int mid = (left + right) / 2;
      mergeSort(a, left, mid);
      mergeSort(a, mid, right);
      merge(a, left, mid, right);
    }
  }

  static boolean areSame(Card[] cards1, Card[] cards2, int n){
    int i = 0;
    for(i = 0; i < n; i++){
      if(!cards1[i].ch.equals(cards2[i].ch))
        return false;
      if(cards1[i].num != cards2[i].num)
        return false;
    }
    return true;
  }

  public static void main(String[] args){
    Scanner stdIn = new Scanner(System.in);

    int n = stdIn.nextInt();
    Card[] cards = new Card[n];
    for(int i = 0; i < n; i++){
      cards[i] = new Card();
      cards[i].ch = stdIn.next();
      cards[i].num = stdIn.nextInt();
    }
    Card[] cards2 = new Card[n];
    for(int i = 0; i < n; i++)
      cards2[i] = new Card(cards[i]);

    quickSort(cards, 0, cards.length-1);
    mergeSort(cards2, 0, cards.length);

    if(areSame(cards, cards2, n))
      System.out.println("Stable");
    else
      System.out.println("Not stable");

    trace(cards);

  }
}

Measured memory_bytes: 116164
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
using namespace std;
struct node
{
	int l,c;
}a[5];
bool cmp(node x,node y)
{
	return 1LL*x.c*y.l<1LL*y.c*x.l;
}
long long n;
int main()
{
	a[0].l=1;
	a[1].l=2;
	a[2].l=4;
	a[3].l=8;
	for (int i=0;i<4;i++)
	{
		scanf("%d",&a[i].c);
	}
	sort(a,a+4,cmp);
	cin>>n;
	n=n*4;
	long long ans1=0,ans2=0;
	for (int i=0;i<4;i++)
	{
		ans1+=1LL*(n/(long long)a[i].l)*a[i].c;
		if (ans1>=1000000000000)
		{
			ans2+=ans1/1000000000000;
			ans1%=1000000000000;
		}
		n%=a[i].l;
	}
	if (ans2>0)
	{
		printf("%lld",ans2);
		long long p=1000000000000;
		for (int i=12;i>0;i--)
		{
			if (ans1>=i)
			{
				break;
			}
			else
			{
				printf("0");
			}
		}
		if (ans1>0)
		{
			printf("%lld\n",ans1);
		}
	}
	else
	{
		printf("%lld\n",ans1);
	}
    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int i = 0;
		int num = 0;
		String str;
		ArrayList<Integer> numList = new ArrayList<Integer>();
		while (true) {
			str = br.readLine();
			num = Integer.parseInt(str);
			if (num == 0) {
				break;
			}
			numList.add(num);
			i++;
		}
		int length = i;
		for (i = 0; i < length; i++) {
			System.out.println("Case " + (i + 1) + ": " + numList.get(i));
		}

	}

}

Measured memory_bytes: 32904
while True:
    n, m = map(int, raw_input().split())

    if n == 0:
        break

    taro = [int(raw_input()) for i in range(n)]
    taro_sum = sum(taro)
    hanako = [int(raw_input()) for j in range(m)]
    hanako_sum = sum(hanako)

    pair = (101, 101)

    for t in taro:
        for h in hanako:
            if taro_sum - t + h == hanako_sum - h + t:
                if h + t <= sum(pair):
                    pair = (t, h)

    if pair == (101, 101):
        print - 1
    else:
        print pair[0], pair[1]

Measured memory_bytes: 6260
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <tuple>
#include <numeric>
using namespace std; using ll = long long; using ld = long double;  using pll = pair<ll, ll>;
using vl = vector<ll>; using vll = vector<vl>; using vpll = vector<pll>;
using vs = vector<string>; using tll = tuple<ll, ll, ll>; using vtll = vector<tll>;
const ld PI = 3.1415926535897932;
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define co(i) cout << i << endl;
#define co2(i,j) cout << i << " " << j << endl;
#define co3(i) cout << i << " ";
#define po(i) cout << i.first << " " << i.second << endl;
void in() {}
void debug_out() { cerr << endl; }
template<typename Head, typename... Tail>
void debug_out(Head h, Tail... t) {
	cerr << " " << h;
	if (sizeof...(t) > 0) cerr << " :";
	debug_out(t...);
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> vec) {
	for (size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
	return os;
}
ll ctoi(char c) {
	switch (c) {
	case '0': return 0; case '1': return 1; case '2': return 2;
	case '3': return 3; case '4': return 4; case '5': return 5;
	case '6': return 6; case '7': return 7; case '8': return 8;
	case '9': return 9;  default: return 0;
	}
}
bool pairCompare(const pll firstElof, pll secondElof)
{
	return firstElof.first > secondElof.first;
}
//**Snippetリスト**//
//rep, vin, all, iteLoop, bitSearch, bitList, nod, digitDP, treeDP//
//gcdlcm, isPrime, eratos, primeFactorize, Npow, combination, divisor, modinv, doubling//
//dfs, bfs, dijkstra, WarshallFloyd, BellmanFord, UnionFind, Kruskal, RMQ, LCA//
ll i, j, k, l; ll N, M, K, H, W, L, X, Y, Z, R, Q;
ll MOD = 1000000007, INF = 1LL << 60, ans = 0, z = 0, o = 1;
vpll flag, D; vll path;
//***********//
int main() {
	cin >> N >> K;
	vl A(N);
	for (i = 0; i < N; i++) cin >> A[i];
	for (i = 0; i < N-1; i++) {
		for (j = i+1; j < N; j++) {
			if (A[i] > A[j]) ans++;
		}
	}
	(ans *= K) %= MOD;
	for (i = 0; i < N; i++) {
		ll pre = 0;
		for (j = 0; j < N; j++) {
			if (A[i] > A[j]) pre++;
		}
		ll pre2 = ((K - 1) * K / 2) % MOD;
		(pre *= pre2) %= MOD;
		(ans += pre) %= MOD;
	}
	co(ans);
}

Measured memory_bytes: 3604
n=gets.strip.to_i
a=gets.strip.split.map(&:to_i)
rui=[]
rui<<0
(0..n-1).each do |i|
  rui<<rui[i]+a[i]
end

h = Hash.new(0)
rui.each do |r|
  h[r]+=1
end

ans=0
h.each do |k,v|
  ans+=v*(v-1)/2
end

puts ans


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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

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

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

#define INF 1e9

int n,w,h;

int main(){
  cin>>w>>h>>n;
  int res = 0;
  int bx,by;
  cin>>bx>>by;--bx;--by;
  int x,y;
  REPR(i,n){
    cin>>x>>y;--x;--y;
    int tx = x-bx,ty = y-by;
    if(tx*ty>=0){
      res += max(abs(tx),abs(ty));
    }else{
      res += abs(tx)+abs(ty);
    }
    bx = x;
    by = y;

  }
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 1160
N = int(input())
ans = []
if N <= 26:
    print(chr(96 + N))
else:
    while N != 0:
        val = N % 26
        if val == 0:
            val = 26
            N = N //26 - 1
        else:
            N //= 26
        ans.append(chr(96 + val))
    ans.reverse()
    print(''.join(ans))


Measured memory_bytes: 9104
#include <bits/stdc++.h>
#define ll long long int
#define yorn(f) cout<<((f)?"Yes":"No")<<endl;
#define YORN(f) cout<<((f)?"YES":"NO")<<endl;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define put(x) cout << x << endl;
#define println(x) cout << x << endl;
using namespace std;
int main()
{
    vector<int> v(5);
    rep(i, 5) cin >> v[i];
    int sum = 0;
    int best = 10;
    rep(i, 5) {
        sum += (v[i] + 9) / 10 * 10;
        if (1 <= v[i] % 10 && best > v[i] % 10) {
            best = v[i] % 10;
        }
    }

    if (best <= 9) {
        sum -= 10 - best;
    }
    put(sum)
    
    return 0;
}

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

template<class T> inline void chmin(T& a, T b) {if (a > b) a = b;}
template<class T> inline void chmax(T& a, T b) {if (a < b) a = b;}


long double d2(vector<long double> &a, vector<long double> &b) {
  return (a[0]-b[0])*(a[0]-b[0]) + (a[1]-b[1])*(a[1]-b[1]);
}

int main() {
  int N;
  cin >> N;
  long double x,y,ep=1e-8,ok=2000,ng=0,now=1000;
  vector<vector<long double>> c(N);
  rep(i,N) {
    cin >> x >> y;
    c[i] = {x,y};
  }

  

  bool flag;
  rep (aaaaaaaa,40) {
    flag = false;
    rep(i,N-1)rep2(j,i+1,N) {
      vector<vector<long double>> tmp;
      if (d2(c[i],c[j]) - ep >4*now*now) continue;
      // else if (d2(c[i],c[j]) == 4*now*now) tmp.push_back({(c[i][0]+c[j][0])/2, (c[i][1]+c[j][1])/2});
      else {
        vector<long double> H,p1,p2, p = {c[j][0]-c[i][0], c[j][1]-c[i][1]};
        
        long double td = p[0]*p[0]+p[1]*p[1];
        rep(div,2) p[div] *= sqrt(((4*now*now - (td))/ (td)))/2;
        
        p1 = {-p[1], p[0]};p2 = {p[1], -p[0]};
        H = {(c[i][0]+c[j][0])/2, (c[i][1]+c[j][1])/2};
        tmp.push_back({H[0]+p1[0], H[1]+p1[1]});
        tmp.push_back({H[0]+p2[0], H[1]+p2[1]});
      }

      for (auto t:tmp) {
        // printf("%.8lf %.8lf\n",t[0],t[1]);
        bool out = false;
        rep(al,N) {
          if (i==al || j==al) continue;
          if (d2(t,c[al])-ep > now*now) {
            // printf("{%.3Lf,%.3Lf} {%.3Lf,%.3Lf}  ",t[0],t[1],c[al][0],c[al][1]);
            // printf("%.3Lf %.3Lf\n",d2(t,c[al]),now*now);
            
            out=true;
            break;
          }
        }
        if (out) continue;
        flag = true;
        break;
      }
    }
    

    if (flag) ok = now;
    else ng = now;
    now = (ok+ng)/2;
    // printf("%.8Lf\n", now);
  }
  printf("%.8Lf\n", now);
} 

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define pb push_back
#define mp make_pair
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define ff first
#define ss second
#define INF (ll) (1e9)
#define mod (ll) (1e9 + 7)
#define endl "\n"
#define tt ll testcase; cin>>testcase; while(testcase--)
 
const int mxn = 1*(1e5) + 5;
ll n, m;
 
void solve(){
	cin >> n;
	string s;
	cin >> s;
	int r=0, w=0;
	for(int i=0; i<n; i++) {
		if(s[i] == 'R') r++;
	}
	w = n-r;
	int c=0;
	for(int i=0; i<r; i++) {
		if(s[i] == 'W') {
			c++;
		}
	}
	cout<<c;
}	

int main(){
	fast;
	// #ifndef ONLINE_JUDGE 
 //   freopen("input.txt", "r", stdin); 
 //   freopen("output.txt", "w", stdout); 
 //   #endif 
   
	// tt
		solve();
		return 0;
}

Measured memory_bytes: 3772
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CsTest
{
    public class Program
    {
        static void Main(string[] args)
        {
            int[] inputs = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            Console.WriteLine(inputs.All(x => x > 0 && x < 10) ? inputs[0] * inputs[1] : -1);
        }
    }
}

Measured memory_bytes: 13396
#include <algorithm>
#include <array>
#include <bitset>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <queue>

using namespace std;

struct BoolName : numpunct<char> {
  string t, f;
  BoolName (string t = "Yes", string f = "No") : t(t), f(f) {}
  string do_truename() const {return t;}
  string do_falsename() const {return f;}
};

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15) << boolalpha;
    cout.imbue(locale(cout.getloc(), new BoolName));
  }
} initializer;

template<typename T> istream& operator>>(istream &s, vector<T> &v) {
  for (T &t : v) s >> t;
  return s;
}

template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
  for (const T &t : v) s << t << endl;
  return s;
}

void set_bool_name(string t, string f) {
  cout.imbue(locale(cout.getloc(), new BoolName(t, f)));
}

int main() {
  int n;
  cin >> n;
  vector<int> x(n), y(n), h(n);
  for (int i = 0; i < n; ++i) cin >> x[i] >> y[i] >> h[i];
  for (int i = 0; i < n; ++i) {
    if (h[i]) {
      swap(x[0], x[i]);
      swap(y[0], y[i]);
      swap(h[0], h[i]);
      break;
    }
  }
  for (int i = 0; i <= 100; ++i) {
    for (int j = 0; j <= 100; ++j) {
      int H = h[0] + abs(x[0] - i) + abs(y[0] - j);
      bool ok = true;
      for (int k = 1; k < n; ++k) {
        if (max(H - abs(x[k] - i) - abs(y[k] - j), 0) != h[k]) {
          ok = false;
          break;
        }
      }
      if (ok) {
        cout << i << " " << j << " " << H << endl;
        return 0;
      }
    }
  }
}



Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <queue>
#include <algorithm>
#include <stack>
#include <cmath>
#include <map>
#include <set>
#include <cstring>
//#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize (2)
#pragma G++ optimize (2)
#define mod 1000000007
#define PI acos(-1.0)
typedef long long ll;
typedef unsigned long long ull;
#define gcd __gcd
//const int INF=0x3f3f3f3f;
const ll INF=1000000000000000000;
//priority_queue<int, vector<int>, greater<int> >p;
int n;
int a[200005],b[200005];
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]);
    sort(a+1,a+n+1);
       int x=a[n]/2;
    int y=lower_bound(a+1,a+n+1,x)-a;
    if(y==x)
        printf("%d %d\n",a[n],a[y]);
    else
    {
        int k;
        if(a[n]%2)k=a[y]-x-1;
        else k=a[y]-x;
        if(x-a[y-1]>k)printf("%d %d\n",a[n],a[y]);
        else printf("%d %d\n",a[n],a[y-1]);
    }
    return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int main()
{

long long a,b,c,d,e;
string sr;
map<char,long long>mp;
map<char,long long>::iterator it;
cin>>sr;
for(long long i=0;i<sr.length();i++)
{

mp[sr[i]]++;



}
for(it=mp.begin();it!=mp.end();it++)
{
char cg=it->first;

if(mp[cg]>1)
{
cout<<"no";
return 0;

}



}
cout<<"yes";



}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <array>
#include <algorithm>
#include <utility>
#include <numeric>


using namespace std;


template <class ...Args>
void Input(Args &...args)
{
	(cin >> ... >> args);
}

template <class T>
void InputArray(std::size_t size, T &t)
{
	t.resize(size);
	for (auto &e : t) {
		cin >> e;
	}
}

template <class ...Args>
void InputArray(std::size_t size, Args &...args)
{
	(InputArray(size, args), ...);
}

template <class ...Args>
void InputVerticalArray(std::size_t size, Args &...args)
{
	(args.resize(size), ...);
	for (int i = 0; i < size; i++) {
		((cin >> args[i]), ...);
	}
}

template <class ...Args>
void Output(const Args &...args)
{
	((cout << args << ' '), ...) << endl;
}

template <class ...Args>
void OutputVertical(const Args &...args)
{
	((cout << args << endl), ...);
}

template <class T>
void OutputArray(const T &t)
{
	for (const auto &e : t) {
		cout << e << ' ';
	}
	cout << endl;
}

template <class ...Args>
void OutputArray(const Args &...args)
{
	(OutputArray(args), ...);
}

template <class ...Args>
void OutputVerticalArray(const Args &...args)
{
	for (int i = 0; i < min({ args.size()... }); i++) {
		((cout << args[i] << ' '), ...) << endl;
	}
}


#define inp(type, ...) \
	type __VA_ARGS__; \
	Input(__VA_ARGS__)

#define inpa(type, size, ...) \
	type __VA_ARGS__; \
	InputArray((size), __VA_ARGS__)

#define inpva(type, size, ...) \
	type __VA_ARGS__; \
	InputVerticalArray((size), __VA_ARGS__)

#define otp(...) \
	Output(__VA_ARGS__)

#define otpv(...) \
	OutputVertical(__VA_ARGS__)

#define otpa(...) \
	OutputArray(__VA_ARGS__)

#define otpva(...) \
	OutputVerticalArray(__VA_ARGS__)

#define rep(counter, range) \
	for (int (counter) = 0; (counter) < (range); (counter)++)

#define repi(range) \
	rep(i, range)

#define rrep(counter, range) \
	for (int (counter) = (range) - 1; (counter) >= 0; (counter)--)

#define rrepi(range) \
	rrep(i, range)

#define repc(element, container) \
	for (auto &(element) : (container))

#define repe(container) \
	repc(e, container)

#define all(container) \
	(container).begin(), (container).end()

#ifdef __CCR__
#	define dlog(x) clog << #x " = " << x << endl
#else
#	define dlog(x)
#endif



int main()
{
	inp(int, a);
	
	
	
	otp(!a);
	
	return 0;
}


Measured memory_bytes: 3628
#include <stdio.h>

#define inf 3000

int main(){
  int i,j,n,v[102][102],d[102],s[102],min,t;

  scanf("%d",&n);
  for(i=1;i<=n;i++){
    for(j=1;j<=n;j++){
      scanf("%d",&v[i][j]);
    }
  }

  for(i=2;i<=n;i++){
    d[i]=inf;
    s[i]=0;
  }

  d[1]=0;
  s[1]=0;

  while(1){
    min = inf;
    for(i=1;i<=n;i++){
      if(d[i]<min && s[i] == 0){
	min = d[i];
	t=i;
      }
    }
    if(min==inf)break;
    s[t]=1;
    for(i=1;i<=n;i++){
      if(s[i]==0 && v[t][i] != -1){
	if(v[t][i]<d[i]){
	  d[i]=v[t][i];
	}
      }
    }
  }

  t=0;
  
  for(i=1;i<=n;i++){
    t+=d[i];
  }

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

  return 0;
}



Measured memory_bytes: 2056
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);		
		String s1 = sc.next();
		String s2 = sc.next();
		
		if (s1.compareTo(s2) > 0) {
			System.out.println(">");
		} else if (s1.compareTo(s2) < 0) {
			System.out.println("<");
		} else {
			System.out.println("=");
		}
		return;
	}
}




Measured memory_bytes: 21844
use proconio::input;

#[allow(clippy::unreadable_literal)]
fn main() {
    input! {
        n: usize,
        mut r#as: [u128; n],
    }

    r#as.sort();
    r#as.push(0xdeadbeef);

    if let Some((prod, _)) = itertools::iterate((1, 0), |&(p, i)| (p * r#as[i], i + 1))
        .take_while(|&(p, _)| p <= 10u128.pow(18))
        .nth(n)
    {
        println!("{}", prod);
    } else {
        println!("-1");
    }
}


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

#define rep(i, n) REP(i, 0, n)
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(x) cout << x << endl;
typedef long long ll;

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

    int ans = 0;
    rep(i, n){
        while(s[i] == s[i + 1]){
            i++;
        }
        ans++;
    }
    OP(ans);
}


Measured memory_bytes: 512
/********************************
*MAHBUBCSEJU                    *
*CSE 22                         *
*JAHANGIRNAGAR UNIVERSITY       *
*TIMUS:164273FU                 *
*UVA>>LIGHTOJ>>HUST:mahbubcseju */
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define I(a) scanf("%d",&a)
#define I2(a,b) scanf("%d%d",&a,&b)
#define I3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define L(a) scanf("%lld",&a)
#define L2(a,b) scanf("%lld%lld",&a,&b)
#define L3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define PI(a) printf("%d\n",a)
#define PL(a) printf("%lld\n",a)
#define PT(t) printf("Case %d: ",t)
#define PB push_back
#define x first
#define y second
#define xx first.first
#define xy first.second
#define yx second.first
#define yy second.second
#define SC scanf
#define PC printf
#define NL printf("\n")
#define SET(a) memset(a,0,sizeof a)
#define SETR(a) memset(a,-1,sizeof a)
#define SZ(a) ((int)a.size())
//#define pi 2.0*acos(0.0)
#define R(a) freopen(a, "r", stdin);
#define W(a) freopen(a, "w", stdout);
#define CB(x) __builtin_popcount(x)
#define STN(a) stringtonumber<ll>(a)
#define lol printf("BUG\n")
#define mk make_pair
using namespace std;
template <class T> inline T BM(T p, T e, T M) {
    ll ret = 1;
    for(; e > 0; e >>= 1) {
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    }
    return (T)ret;
}
template <class T> inline T gcd(T a, T b) {
    if(b == 0)return a;
    return gcd(b, a % b);
}
template <class T> inline T mdINV(T a, T M) {
    return BM(a, M - 2, M);
}
template <class T> inline T PW(T p, T e) {
    ll ret = 1;
    for(; e > 0; e >>= 1) {
        if(e & 1) ret = (ret * p);
        p = (p * p);
    }
    return (T)ret;
}
template <class T>string NTS ( T Number ) {
    stringstream ss;
    ss << Number;
    return ss.str();
}
template <class T>T stringtonumber ( const string &Text ) {
    istringstream ss(Text);
    T result;
    return ss >> result ? result : 0;
}
template <class T>bool ISLEFT ( T a,T b,T c) {
    if(((a.xx-b.xx)*(b.yy-c.yy)-(b.xx-c.xx)*(a.yy-b.yy))<0.0)return 1;//Uporer dike //A,b,c, x okkher ordera sorted
    else return 0;
}
#define mx 10000
#define md 1000000007
#define maxp 2050180000

typedef pair<int ,int > P;

////////define value/////

    int main()
    {
        int a[3];
        for(int i=0;i<=2;i++)I(a[i]);
        sort(a,a+3);
        if(a[0]==5&&a[1]==5&&a[2]==7)PC("YES\n");
        else PC("NO\n");


        return 0;
    }


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,x,n) for(int i=x;i<n;i++)
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define MAX 100005
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=1000000009;

signed main(){
  int n;
  cin>>n;
  multiset<int> d;
  rep(i,n){
    int a;cin>>a;
    d.insert(a);
  }

  int m;
  cin>>m;
  set<int> t;
  multiset<int> u;
  rep(i,m){
    int b;cin>>b;
    t.insert(b);
    u.insert(b);
  }
  if(n<m){
    cout<<"NO"<<endl;
    return 0;
  }else{
    bool flag=true;
    auto itr=t.begin();
    rep(i,t.size()){

      if(u.count(*itr)>d.count(*itr)){
        flag=false;
        break;
      }
      itr++;
    }
    cout<<(flag?"YES":"NO")<<endl;
  }

  return 0;
}


Measured memory_bytes: 28416
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstring>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

typedef pair<double, string> pp;

int main()
{
    string l;
    double p, a, b, c, d, e, f, s, m;
    int n;
    while(cin >> n && n)
    {
        vector<pp> ans;
        REP(n)
        {
            cin >> l >> p >> a>>b>>c>>d>>e>>f>>s>>m;
            ans.push_back(pp(-(m * f * s - p)/(a+b+c+(d+e)*m) ,l));
        }
        sort(all(ans));

        REP(n) cout << ans[i].second << endl;
        cout << "#" << endl;
    }

    return 0;
}

Measured memory_bytes: 0
x = int(input())
if x <= 6:
    print(1)
elif 6 < x <=11:
    print(2)
else:
    tmp = x%11
    if tmp == 0:
        print((x//11)*2)
    elif tmp <= 6:
        print((x//11)*2 + 1)
    else:
        print((x//11)*2 + 2)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }

int main() {
  int k;
  cin >> k;
  vector<vector<int>>  G(k + 10, vector<int>(k + 10));
  ll ans = 0;
  for (int i = 1; i <= k; i++) {
      for (int j = 1; j <= k; j++) {
          for (int l = 1; l <= k; l++)
          {
              int G = __gcd(i, j);
              G = __gcd(G, l);
              ans += G;
          }
       }
      
  }
  cout << ans;
  return 0;


}
    
    


Measured memory_bytes: 3756