akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl

//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;

void wa(){
cout<<"WA"<<endl;
}

int main(){

    string s;
    cin>>s;
    if(s[0]!='A'){
        wa();
    
    }else{
        if(s[1]=='C'||s[1]<'a'){
            wa();
            return 0;
        }else{
            int ccount=0;
            FOR(i,2,(int)s.size()-1){
                if(s[i]=='C'){
                    if(ccount==0){
                        ccount++;
                    }else{
                        wa();
                        return 0;
                    }
                }else if(s[i]<'a'){
                    wa();
                    return 0;
                }
            }
       
        if(ccount){
            if(s[s.size()-1]>='a'){
                
                cout << "AC" << endl;
            }else{
                wa();
                return 0;
            }
        }else{
            wa();
            return 0;
        }
        }
    }

    

    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        String s = scan.next();
            if(s.length() >= 1 && s.length() <= 10){
                if( a >= 3200 && a < 5000){
                    System.out.println(s.toLowerCase());
                }else if(a >= 2800 && a < 3200){
                    System.out.println("red");
            }
        }
    }
}

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

using namespace std;

queue<pair<string, int>> tasks;

int main()
{
	cin.tie(0);
	ios::ios_base::sync_with_stdio(false);
	int taskam, q;
	cin >> taskam >> q;
	for (int i = 0; i < taskam; ++i) {
		string name;
		int thistask;
		cin >> name >> thistask;
		tasks.emplace(make_pair(name, thistask));
	}
	int time = 0;
	while (!tasks.empty()) {
		int tmpt = tasks.front().second;
		string tmpname = tasks.front().first;
		tasks.pop();
		int n = tmpt - q;
		if (n > 0) {
			tasks.emplace(make_pair(tmpname, n));
			time += q;
		}
		else {
			time += tmpt;
			cout << tmpname << " " << time << endl;
		}
	}
}

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

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

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin(),(c).end()

const int MN = 1000010;

int N, Q;
string s;
int l[80];
ll ans[80];
ll sb[MN], sc[MN], nc[MN];

int main() {
	cin >> N >> s >> Q;

	rep(i, N) {
		sb[i+1] = sb[i];
		if (s[i] == 'M') {
			++sb[i+1];
		}
	}

	rep(i, N) {
		sc[i+1] = sc[i];
		nc[i+1] = nc[i];
		if (s[i] == 'C') {
			sc[i+1] += sb[i+1];
			++nc[i+1];
		}
	}

	rep(i, Q) {
		cin >> l[i];
	}

	rep(i, N) {
		if (s[i] == 'D') {
			rep(j, Q) {
				int r = min(N, i + l[j]);
				ll num = nc[r] - nc[i];
				ll sm = sc[r] - sc[i];
				ll t = sm - num * sb[i];
				ans[j] += t;
			}
		}
	}

	rep(i, Q) {
		cout << ans[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 24836
#include<bits/stdc++.h>
using namespace std;
inline long long getnum()
{
    long long now=0;long long fh=1;char ch=getchar();
    while(ch<'0' || ch>'9'){if(ch=='-')fh=-1;ch=getchar();}
    while(ch>='0' && ch<='9'){now=(now<<3)+(now<<1)+ch-'0';ch=getchar();}
    return now*fh;
}
int x[100003],n,ans;
int main()
{
  n=getnum();
  for (int i=1;i<=n;i++)
  {
    x[getnum()]++;
  }
  for (int i=1;i<=100000;i++)
  {
    ans=max(ans,x[i-1]+x[i]+x[i+1]);
  }
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 640
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int upchar(const void* left, const void* right) {
  return strcmp((char *)left,(char *)right);
}

int main(void){
  int n;

  scanf("%d", &n);

  char str[n][11];
  int i, cnt = 1;

  for(i = 0; i < n; i++){
    scanf("%s", str[i]);
  }

  qsort(str, n, sizeof(char) * 11, upchar);
  for(i = 0; i < n - 1; i++){
    if(strcmp(str[i], str[i + 1]) != 0){
      cnt += 1;
    }
  }

  printf("%d", cnt);

  return 0;
}


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

static const int mod = 998244353;

int fast_power(int a, int b) {
  long long p = 1, q = a;
  while (b) {
    if (b & 1)
      p = p * q % mod;
    q = q * q % mod;
    b >>= 1; 
  }

  return p;
}

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

  vector<int> f(n + 1), g(n + 1);
  f[0] = 1, g[0] = 1;
  for (int i = 1; i <= n; i++) {
    f[i] = 1LL * f[i - 1] * i % mod;
    g[i] = fast_power(f[i], mod - 2);
  }

  long long ans = 0;
  for (int i = 0; i <= k; i++)
    if (n - i - 1 >= 0) {
      long long c = 1LL * f[n - 1] * g[i] % mod * g[n - i - 1] % mod;
      long long t = 1LL * m * fast_power(m - 1, n - i - 1) % mod;
      ans = (ans + c * t % mod) % mod;
    }

  printf("%lld\n", ans);

  return 0;
}

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

int A[26];
ll mod = 1e9 + 7;

int main() {
    int N; cin >> N;
    string S; cin >> S;
    rep(i, N){
        int a = S[i] - 'a';
        A[a]++;
    }

    ll ans = 1;
    rep(i, 26){
        ans *= A[i] + 1;
        ans %= mod;
    }

    ans--;
    if(ans < 0){
        ans += mod;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3752
cnt = int(input())
in_str = [int(i) for i in input().split()]
submit = 0
for i in range(1,cnt-1):
  if in_str[i-1]<=in_str[i] and in_str[i]<=in_str[i+1]:
    submit += 1
  elif in_str[i-1]>=in_str[i] and in_str[i]>=in_str[i+1]:
    submit += 1
print(submit)

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

int main() {
  int r;
  cin >> r;
  cout << 3*r*r << endl;
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <array>
#include <cassert>
#include <bitset>
using namespace std;
using LL = long long int;

const LL MOD = 1000000007;

LL mpow(LL a, LL x) {
	if (x == 0)return 1;
	LL half = mpow(a, x / 2);
	half *= half;
	half %= MOD;
	if (x % 2) {
		half *= a;
		half %= MOD;
	}
	return half;
}


int N;
int par[222222];
vector<int>child[222222];
int vnum[222222];
int cnt[222222];
int dep[222222];

void dfs(int v, int cou) {
	dep[v] = cou;
	for (int ch : child[v]) {
		dfs(ch, cou + 1);
	}
}

struct node {
	LL nil, one;
	LL sum;
};

node operator+(const node&n1, const node&n2) {
	LL nil = (n1.nil * n2.nil) % MOD;
	LL one = (n1.nil * n2.one + n1.one * n2.nil) % MOD;
	return {
		nil,one,n1.sum + n2.sum
	};
}

void merge(vector<node> &prime, vector<node> &brnch) {
	assert(prime.size() >= brnch.size());
	int diff = prime.size() - brnch.size();
	for (int i = 0; i < brnch.size(); ++i) {
		node grow = prime[i + diff] + brnch[i];
		prime[i + diff] = grow;
	}
}

//yes,no
vector<node> dp(int v) {
	if (child[v].empty()) {
		return vector<node>(1, { 1,1,1 });
	}
	/*
	vector<node>res = dp(child[v][0]);

	for (int i = 1; i < child[v].size(); ++i) {
	vector<node>tmp = dp(child[v][i]);
	if (tmp.size() > res.size()) {
	merge(tmp, res);
	//res = move(tmp);
	swap(res, tmp);
	}
	else {
	merge(res, tmp);
	}
	}
	*/
	vector<pair<int, int>>srt;
	vector<vector<node>>tame;
	for (int ch : child[v]) {
		tame.emplace_back(dp(ch));
		srt.push_back({ tame.back().size(),tame.size() - 1 });
	}
	sort(srt.begin(), srt.end());
	//vector<node>&res = tame[srt[0].second];
	int las = 0;
	for (int i = 1; i < srt.size(); ++i) {
		//vector<node>&tmp = tame[srt[i].second];
		/*
		if (tmp.size() > res.size()) {
		merge(tmp, res);
		res = move(tmp);
		//swap(res, tmp);
		}
		else {
		merge(res, tmp);
		}
		*/
		merge(tame[srt[i].second], tame[srt[i - 1].second]);
		las = tame[srt[i - 1].second].size();
	}
	vector<node>&res = tame[srt[srt.size() - 1].second];
	int cnt = 0;
	for (auto itr = res.rbegin(); itr != res.rend(); ++itr) {
		if (cnt >= las)break;
		LL zero = mpow(2, itr->sum) + MOD;
		zero = (zero - itr->one) % MOD;
		itr->nil = zero;
		cnt++;
	}
	res.push_back({ 1,1,1 });
	return std::move(res);
}

int main(void)
{
	cin >> N;
	for (int i = 0; i < N; ++i) {
		cin >> par[1 + i];
		child[par[1 + i]].push_back(i + 1);
	}
	dfs(0, 0);
	vector<node> ans = dp(0);
	for (int i = 0; i <= N; ++i) {
		cnt[dep[i]]++;
	}
	LL answer = 0;
	for (int i = 0; i < ans.size(); ++i) {
		LL kis = N + 1 - cnt[ans.size() - 1 - i];
		kis = mpow(2, kis);
		kis *= ans[i].one;
		kis %= MOD;
		answer += kis;
		answer %= MOD;
	}
	cout << answer << endl;
	return 0;
}


Measured memory_bytes: 65648
#include <stdio.h>
#include <math.h>

int main(void)
{
	int i, n;
	double h, m, dif;
	
	scanf("%d", &n);
	
	for (i = 0; i < n; i++){
		scanf("%lf:%lf", &h, &m);
		
		dif = fabs(360 * h / 12 + 30 * m / 60 - 360 * m / 60);
		if (dif > 180){
			dif = 360 - dif;
		}

		if (dif < 30){
			printf("alert\n");
		}
		else if (dif < 90){
			printf("warning\n");
		}
		else {
			printf("safe\n");
		}
	}
	
	return (0);
}

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

using ll = long long;
using namespace std;

const int N = 1e5 + 1;
int a[N], b[N], c[N], dp[N][3];

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

#ifdef LOCAL_DEFINE	
	freopen("in.txt", "r", stdin);
#endif
	
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i)
		cin >> a[i] >> b[i] >> c[i];

	dp[0][0] = a[0];
	dp[0][1] = b[0];
	dp[0][2] = c[0];

	for (int i = 1; i <= n; ++i)
	{
		dp[i][0] = a[i] + max(dp[i - 1][1], dp[i - 1][2]);
		dp[i][1] = b[i] + max(dp[i - 1][0], dp[i - 1][2]);
		dp[i][2] = c[i] + max(dp[i - 1][0], dp[i - 1][1]);
	}
	
	cout << max(dp[n][0], max(dp[n][1], dp[n][2])) << '\n';

	return 0;
}

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

int main(){
  vector<vector<int>> a(3,vector<int>(3));
  vector<vector<int>> c(3,vector<int>(3));
  rep(i,3){
    rep(j,3){
      cin >> a.at(i).at(j);
    }
  }

  int n,sum;
  cin >> n;

  vector<int> b(n);
  rep(k,n)cin >> b.at(k);
  

  rep(i,3){
      sum = 0;
    rep(j,3){
      rep(k,n){
        if(b.at(k) == a.at(i).at(j)){
          c.at(i).at(j) = 1;
          sum ++;
          if(sum == 3){
          cout << "Yes";
          return 0;
          }
        }
      }
    }

    
  
  }
    
  rep(j,3){
    sum = 0;
    rep(i,3){
      if(c.at(i).at(j)==1) sum ++;
      if(sum == 3){
        cout << "Yes";
        return 0;
      }
    }
  }
  sum = 0;
  rep(i,3){
    if(c.at(i).at(i)==1){
      sum ++;
      if(sum == 3){
        cout << "Yes";
        return 0;
      }
    }
  }

    if(c.at(0).at(2)==1){
      if(c.at(1).at(1)==1){
        if(c.at(2).at(0)==1){
          cout << "Yes";
          return 0;
        }
      }
    }  
         
  cout << "No";
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main (String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int x, y, c;
        String str;

        str = sc.nextLine();
        int w = Integer.parseInt(str);
        int[] a = new int[w];
        for (int i = 0; i < w; i++)
        {
            a[i] = i + 1;
        }

        str = sc.nextLine();
        int n = Integer.parseInt(str);

        for (int i = 0; i < n; i++)
        {
            str = sc.nextLine();
            String[] X = str.split(",", -1);
            x = Integer.parseInt(X[0]);
            y = Integer.parseInt(X[1]);
            c = a[x-1];
            a[x-1] = a[y-1];
            a[y-1] = c;
        }
        sc.close();

        for (int i = 0; i < w; i++) System.out.println(a[i]);
    }
}


Measured memory_bytes: 25912
#include <bits/stdc++.h>
using namespace std;
#define END '\n'
#define int long long
#define pb push_back
#define pii pair<int, int>
#define ff first
#define ss second
#define trace(x) cerr<<x<<END;
#define loop(i, a, b) for(int i = (a); i < (b); i++)
#define loopb(i, b, a) for(int i = (b); i > (a); --i) 
const int mod = 1e9+7;
const int mod1 = 998244353;
const int inf = 9223372036ll;
  
void solve()
 {
  int a,p;
  cin>>a>>p;
  int tot = a*3 + p;
  cout<<tot/2;
 
 }
signed main()
 {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0); 

     solve();
  //cerr<<END<<1.0*clock();
  return 0;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
int a[105], s, n, m;
int main() {
	std::cin >> n >> m;
	for (int i = 1; i <= n; ++i) std::cin >> a[i], s += a[i];
	std::sort(a + 1, a + n + 1), std::reverse(a + 1, a + n + 1);
	if (a[m] * 4 * m < s) puts("No");
	else puts("Yes");
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdio.h>
#include <algorithm>
#include <map>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
#define ll long long
#define rn(i,n) for(int i=1;i<=n;i++)

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

  r(i,n){
    cin>>a.at(i);
    if(a.at(i)==0){
      s[a.at(i)]++;
      s[a.at(i)+1]++;
    }else{
    s[a.at(i)]++;
    s[a.at(i)+1]++;
    s[a.at(i)-1]++;
  }
  }
  int maxi=0;
  r(i,s.size()){
    maxi=max(maxi,s[i]);
  }

  cout<<maxi<<endl;

  return 0;
}


Measured memory_bytes: 1152
n, k, q, *a = map(int, open(0).read().split())
a = map(lambda x: x - 1 , a)

answers = [0] * n
for i in a:
    answers[i] += 1

for i in range(n):
    num = k - (q - answers[i])
    if 0 < num:
        print('Yes')
    else:
        print('No')

Measured memory_bytes: 13988
fn solve(s: String) -> usize {
    let mut result = 0;

    for c1 in "0123456789".chars() {
        for c2 in "0123456789".chars() {
            for c3 in "0123456789".chars() {
                let v1 = s.splitn(2, c1).collect::<Vec<&str>>();
                if v1.len() == 2 {
                    let v2 = v1[1].splitn(2, c2).collect::<Vec<&str>>();
                    if v2.len() == 2 {
                        let v3 = v2[1].splitn(2, c3).collect::<Vec<&str>>();
                        if v3.len() == 2 {
                            result += 1
                        }
                    }
                }
            }
        }
    }
    result
}

fn main() {
    read_none();
    let s = read_s();

    println!("{}", solve(s));
}

fn read_none() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
}

fn read_s() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().to_string()
}


Measured memory_bytes: 2268
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define all(v) begin(v), end(v)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 2000000000
#define int long long int

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define LEQ(n, m) ((n) <= (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))
#define GEQ(n, m) ((n) + EPS >= (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

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

namespace std {
    bool operator<(const P& a, const P& b) {
        return a.X != b.X ? a.X < b.X : a.Y < b.Y;
    }
}

int n, m;
int ans;
vector< vector<int> > G;
void dfs(int p, vector<bool> v) {
    int cnt = 0;
    rep(i,0,n) if(v[i]) cnt++;
    if(cnt == n) {
        ans++;
        return;
    }

    rep(i,0,G[p].size()) {
        int next = G[p][i];
        if(v[next]) continue;
        v[next] = true;
        dfs(next, v);
        v[next] = false;
    }
}

signed main() {
    cin >> n >> m;
    G.resize(n);
    rep(i,0,m) {
        int a, b; cin >> a >> b;
        a--; b--;
        G[a].pb(b);
        G[b].pb(a);
    }
    ans = 0;
    vector<bool> v(n);
    v[0] = true;
    dfs(0, v);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		new Main().doIt();
	}
	void doIt() {
		abc113c();
	}
	void abc113c() {
		HashMap<Integer, ArrayList<Record>> data = new HashMap<Integer, ArrayList<Record>>();
		int N = sc.nextInt(), M = sc.nextInt();
		String [] ans = new String[M];
		for(int i = 0; i < M; i++) {
			int p = sc.nextInt(), y = sc.nextInt();
			if(! data.containsKey(p)) {
				data.put(p,  new ArrayList<Record>());
			}
			data.get(p).add(new Record(y, i));
		}
		for(Integer key: data.keySet() ) {
			ArrayList<Record> ar = data.get(key);
			Collections.sort(ar);
			int nth = 0;
			for(Record r: ar) {
				ans[r.id] = String.format("%06d%06d", key, ++nth);
			}
		}
		for(int i = 0; i < M; i++) {
			System.out.println(ans[i]);
		}
	}
	class Record implements Comparable<Record> {
		Record(int y, int id) {
			this.year = y;
			this.id = id;
		}
		int year, id;
		public int compareTo(Record o) {
			if (year != o.year) {
				return year - o.year;
			} else {
				return id - o.id;
			}
		}
	}
}


Measured memory_bytes: 176904
#include <stdio.h>

int main(void) {
  char s;
  int count = 0;

  scanf("%c", &s);

  if (s == '1') {
    ++count;
  }

  scanf("%c", &s);

  if (s == '1') {
    ++count;
  }

  scanf("%c", &s);

  if (s == '1') {
    ++count;
  }

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


Measured memory_bytes: 128
N = int(input())
A = list(map(int, input().split()))
max_A = sum(A) - A[-1]
dp = [[0 for _ in range(max_A+1)] for _ in range(N+1)]
dp[0][A[0]] = 1

for i in range(1, N-1):
    for sum_A in range(max_A+1):
        if 0 <= sum_A - A[i] <= 20:
            dp[i][sum_A] += dp[i-1][sum_A-A[i]]
        if sum_A + A[i] <= 20:
            dp[i][sum_A] += dp[i-1][sum_A+A[i]]

print(dp[N-2][A[-1]])



Measured memory_bytes: 6028
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<math.h>
using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int a,b,x;

int main(){
    while(cin>>a>>b){
        x=a+b;
        cout<<(int)log10(x)+1<<endl;
    }
}



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

int gettop(int a)
{
	while(true)
	{
		if (a / 10 == 0)
		{
			return a;
		}
		else
		{
			a /= 10;
		}
	}
}

int pow(int a, int n)
{
	int res = a;
	rep(i,n)
	{
		res *= 10;
	}
	return res;
}

int main()
{
	int N;
	cin >> N;
	ll ans = 0;
	int top,bot,now,cnt,res;
	for (int i = 1; i <= N; ++i)
	{
		//cout << i << " ";
		now = i;
		top = gettop(i);
		bot = now % 10;
		if (top == 0 || bot == 0) continue;
		if (top == bot) ans++;
		if (bot * 10 + top <= N) ans++;
		cnt = 1;
		while(true)
		{
			res = N - pow(bot,cnt+1) - top;
			if (res < 0) break;
			ans += min(res / 10 + 1,pow(1,cnt));
			cnt++;
		}
		//cout << ans << endl;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <vector>
#include <map>
#include <functional>
#include <iomanip>
#include <queue>

#define PI 3.14159265358979
#define MOD 1000000007

//fixed << setprecision(15) <<

using namespace std;

int main(void) {
	long long int  m, n;
	string s, t;
	char u;
	bool flag = true;
	cin >> s;
		if(s == "ABC")cout << "ARC" << endl;
			else cout << "ABC" << endl;
	return 0;
}

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

int main() {
  string S;
  cin >> S;
  int COUNT = 0;
  for (int i = 0; i < S.size(); i++)
    COUNT += (S.at(i)+i)%2; 
  cout << ((S.size() >= COUNT*2) ? COUNT : S.size()-COUNT) <<endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
int main(){
	int N;
	cin >> N;
	vector<string> S(N);
	for(int i = 0; i < N; i++)
		cin >> S.at(i);

	map<string, int> count;

	for(int i = 0; i < N; i++){
		count[S.at(i)];
		count[S.at(i)] = count[S.at(i)]+1;
	}

	int max = -1;
	for(auto iter = count.begin(); iter != count.end(); iter++)
		if(max < iter->second)
			max = iter->second;
	for(auto iter = count.begin(); iter != count.end(); iter++)
		if(max == iter->second)
			cout << iter->first << endl;
		

	return 0;
}

Measured memory_bytes: 26752
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int Z,A,B,C,P,Q,R;
  cin >> Z;
  A = Z%100;
  B = A%10;
  P = (Z-A)/100;
  Q = (A-B)/10;
  cout << P+Q+B << endl;
}

Measured memory_bytes: 256
public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);
		StringBuilder sb = new StringBuilder();

		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h==0 && w==0) break;

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

					if (i%2 == 1 && j%2 == 1) {
						sb.append("#");
					} else if (i%2 == 0 && j%2 == 0) {
						sb.append("#");
					} else {
						sb.append(".");
					}

				}
				sb.append("\n");
			}
			sb.append("\n");
		}

		System.out.print(sb);
	}

}

Measured memory_bytes: 27384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef long double ld;

ll inv(ll a, ll b){
    return (a > 1 ? b - inv(b%a, a)*b/a : 1);
}

#define rc(s) return cout << s, 0
#define fi first
#define se second
#define L (nod << 1)
#define R (L | 1)
#define smax(X, Y) ((X) > (Y) ? (X) : (Y))
#define smin(X, Y) ((X) < (Y) ? (X) : (Y))

const ld e = 2.71828182845904523536028747;
const ld PI = 3.14159265359;
const ll inf = (1LL<<62);
const int iinf = (1<<30);

char a[300], c;

int main(){
    a['A'] = 'T'; a['T'] = 'A';
    a['C'] = 'G'; a['G'] = 'C';
    cin >> c;
    cout << a[c];
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
const int INF = 2147483647;//int max
const int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;
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; }

int main() {
    int n,m;
    cin >> n >> m;
    vector<P> d(m);
    rep(i,m)cin >> d.at(i).first >> d.at(i).second;
    rep(i,1000){
        bool b = true;
        string s = to_string(i);
        if(s.length() == n){
            rep(j,m){
                int k = s[d.at(j).first-1]-'0';
                int l = d.at(j).second;
                if(k != l){
                    b = false;
                    break;
                }
            }
            if(b){
                cout << s << endl;
                return 0;
            }
        }
        
    }
    cout << -1 << endl;
    return 0;
}
/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int H;

void insert(int *A, int i);
int extractMax(int *A);
void maxHeapify(int *A, int i);

int main(int argc, char *argv[])
{
  int i, x;
  int A[2000000 + 1];
  char cmd[7 + 1];

  H = 0;

  scanf("%s", cmd);
  while (strcmp(cmd, "end")) {
    if (!strcmp(cmd, "insert")) {
      scanf("%d", &x);
      A[H+1] = x;
      H++;
      insert(A, H);
    } else if (!strcmp(cmd, "extract")) {
      x = extractMax(A);
      printf("%d\n", x);
    }
    scanf("%s", cmd);
  }

  return 0;
}

void insert(int *A, int i)
{
  int p, tmp;

  if (H == 1) return;

  p = (int)floor(i / 2);

  while (p != 0 && A[p] < A[i]) {
    tmp = A[p];
    A[p] = A[i];
    A[i] = tmp;
    i = p;
    p = (int)floor(i / 2);
  }
}

int extractMax(int *A)
{
  int x = A[1], tmp;
  int i, l, r;

  A[1] = A[H--];

  maxHeapify(A, 1);

  return x;
}

void maxHeapify(int *A, int i)
{
  int l, r;
  int largest;
  int tmp;

  l = 2 * i;
  r = 2 * i + 1;

  if (l <= H && A[l] > A[i]) largest = l;
  else largest = i;
  if (r <= H && A[r] > A[largest]) largest = r;

  if (largest != i) {
    tmp = A[largest];
    A[largest] = A[i];
    A[i] = tmp;
    maxHeapify(A, largest);
  }
}

Measured memory_bytes: 5708
#include <stdio.h>
int main(void){
    int n, m, s[5+3], c[5+3];
    scanf("%d %d", &n, &m);
    for(int i=0; i<m; i++)scanf("%d %d", &s[i], &c[i]);
    
    int num[3+3];
    for(int i=0; i<n; i++)num[i]=-1;
    
    for(int i=0; i<m; i++){
        if(num[s[i]-1]==-1 || num[s[i]-1]==c[i])num[s[i]-1]=c[i];
        else{
            printf("-1\n");
            return 0;
        }
    }
    
    if(n!=1 && num[0]==0){
        printf("-1\n");
        return 0;
    }
    if(n!=1 && num[0]==-1)num[0]=1;
    
    for(int i=0; i<n; i++)if(num[i]==-1)num[i]=0;
    
    for(int i=0; i<n; i++)printf("%d", num[i]);
    return 0;
}


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

int main()
{
    deque<char> firstWord;
    deque<char> secondWord;
    string b,k;
    cin>>b>>k;
    char wow;
    bool val = false;
    for(int i = 0 ; i<b.size();i++)
    {
        firstWord.push_back(b[i]);
    }
    for(int i = 0 ; i < k.size();i++)
    {
        secondWord.push_back(k[i]);
    }
    for(int i = 0 ; i < b.size();i++)
    {
        if(secondWord==firstWord)
        {
            val = true;
            break;
        }
        wow = secondWord[k.size()-1];
        secondWord.pop_back();
        secondWord.push_front(wow);
    }
    if(val)
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }




    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_range(i, s, e) for (int i = (s); i < (int)(e); i++)
#define rep_rev(i, s, e) for (int i = (s)-1; i >= (int)(e); i--)
#define sort_vec(v) sort((v).begin(),(v).end())
typedef int64_t lint;
// lint mod = 998244353;
// lint mod = 1000000007;
template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

int app() {
  int n;
  cin>>n;

  int n3=n*3;
  vector<int> a(n3);
  rep(i,n3){
    cin>>a[i];
    a[i]--;
  }

  vector<vector<int>> dp(n,vector<int>(n,-2e9));
  vector<int> maxi(n,-2e9),maxj(n,-2e9);
  int maxall=-2e9;

  vector<pair<pair<int,int>,int>> todo;
  auto set=[&](int i,int j,int v){ todo.emplace_back(make_pair(i,j),v); };
  auto get=[&](int i,int j)->int{ return (i<=j)?dp[i][j]:dp[j][i]; };
  auto upgrade=[&](){
    for(auto u:todo){
      int i=u.first.first;
      int j=u.first.second;
      int v=u.second;
      if(i<=j) chmax(dp[i][j],v);
      else chmax(dp[j][i],v);
      chmax(maxi[i],v);
      chmax(maxi[j],v);
      chmax(maxall,v);
    }
    todo.clear();
  };

  set(a[0],a[1],0);
  upgrade();

  int common=0;
  rep(t,n-1){
    int b=2+t*3;
    if(a[b]==a[b+1]&&a[b]==a[b+2]){
      common++;
      continue;
    }
    rep(s,3){
      int c=a[b+s];
      int o1=a[b+(s+1)%3];
      int o2=a[b+(s+2)%3];

      if(o1==o2){
        rep(j,n){
          set(c,j,get(o1,j)+1);
        }
      }
      rep(j,n){
        set(c,j,maxi[j]);
      }

      set(o1,o2,get(c,c)+1);
      set(o1,o2,maxall);
    }

    upgrade();
  }

  int ans=maxall;
  int c=a[n3-1];
  chmax(ans,dp[c][c]+1);

  return ans+common;
}

int main(){cout<<app()<<endl;return 0;}


Measured memory_bytes: 19468
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

int N, K;
map<int, ll> mp;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  cin >> N >> K;
  for (int i = 1; i <= N; i++) {
    mp[i%K]++;
  }
  ll ans = 0;
  for (int i = 1; i <= N; i++) {
    if (2*i % K != 0) continue;
    int j = (K - (i%K)) % K;
    ans += mp[j] * mp[j];
  }
  cout << ans << endl;

  return 0;
}

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

int main(){
  string s; cin>>s;
  long long k; cin>>k;
  int i=0;
  while(k!=0){
    k--;
    if(s.at(i)!='1'){
      cout<<s.at(i)<<endl;
      return 0;
    }i++;
    if(k==0){
      cout<<1<<endl;
      return 0;
    }
  }
}

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

#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
#define show(a, n) rep(i,n) {cout<<a[i]<<' ';} cout<<endl;

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<long long, long long> pll;

const int INF = 1 << 30;
const long long INFL = 1LL << 62;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 1010;
const int HMAX = 10010;

int main() {
	ll h, n;
	cin >> h >> n;
	ll a[N + 1], b[N + 1];
	rep1(i, n) cin >> a[i] >> b[i];

	vector<vector<ll>> dp(N, vector<ll>(HMAX));
	rep(i, n + 3) rep(j, h + 3) dp[i][j] = 0;
	rep(j, h + 3) dp[0][j] = INFL;

	for(int i = 1; i <= n; i++) {
		for(int j = 1; j <= h; j++) {
			if(j <= a[i]) {
				dp[i][j] = min(b[i], dp[i - 1][j]);
			}
			else {
				dp[i][j] = min(dp[i][j - a[i]] + b[i], dp[i - 1][j]);
			}
		}
	}
	cout << dp[n][h] << endl;
}


Measured memory_bytes: 79360
#include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#define llint long long
#define inf 1e18
#define rep(x, s, t) for(llint (x) = (s); (x) < (t); (x)++)
#define Rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++)

using namespace std;

string s;

bool check(llint l, llint r)
{
	string t, u;
	for(int i = l; i <= r; i++) t += s[i];
	u = t;
	reverse(u.begin(), u.end());
	return t == u;
}

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> s;
	llint n = s.size();
	
	if(check(0, n-1) && check(0, (n-1)/2-1) && check((n+3)/2-1, n-1)) cout << "Yes"<< endl;
	else cout << "No" << endl;
	
	return 0;
}

Measured memory_bytes: 256
angle = 0.0
x = 0.0
y = 0.0
while n = gets do
  h, a = n.split(",").map(&:to_i)
  break if h == 0 && a == 0
  x = x + Math.sin(angle * Math::PI / 180.0) * h 
  y = y + Math.cos(angle * Math::PI / 180.0) * h
  angle = angle + a
end
puts x.to_i
puts y.to_i

Measured memory_bytes: 6168
#include<cstdio>
#include<algorithm>

using namespace std;

char ch[110];
int H, W;

int four, two, one;

int cnt[100];

int main(){
	scanf("%d%d", &H, &W);
	for(int i = 0; i < H; ++i){
		scanf("%s", ch);
		for(int j = 0; j < W; ++j){
			cnt[ch[j] - 'a']++;
		}
	}
	for(int i = 0; i < (H + 1) / 2; ++i){
		for(int j = 0; j < (W + 1) / 2; ++j){
			int tmp = 1;
			if(i * 2 + 1 < H) tmp *= 2;
			if(j * 2 + 1 < W) tmp *= 2;
			if(tmp == 1) one++;
			if(tmp == 2) two++;
			if(tmp == 4) four++;
		}
	}
	for(int i = 0; i < 26; ++i){
		int c = cnt[i];
		int a = c / 4;
		a = min(a, four);
		c -= a * 4;
		four -= a;
		a = c / 2;
		a = min(a, two);
		c -= a * 2;
		two -= a;
		a = c;
		a = min(a, one);
		c -= a;
		one -= a;
		if(c != 0){
			printf("No\n");
			return 0;
		}
	}
	printf("Yes\n");
	return 0;
}


Measured memory_bytes: 128
//
//  main.cpp
//  A
//
//  Created by Hashizo on 2020/04/12.
//  Copyright © 2020 Hashizo. All rights reserved.
//

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <regex>
#include <cmath>

using namespace std;
 
#undef LONG_MAX
#undef LONG_MIN
 
#define LONG_MAX    9223372036854775807
#define LONG_MIN    (-LONG_MAX  -1)
 
#define ll long long
 
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
 
#define SORT(c) sort((c).begin(), (c).end())
#define REVERSE(v) reverse((v).begin(), (v).end())

int main(int argc, const char * argv[]) {
	
	char n[3];
	cin >> n;
	
	if (n[0] == '7' || n[1] == '7' || n[2] == '7') {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}


Measured memory_bytes: 3620
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
struct Edge{
	int v,nxt;
}e[200010];int tot;
int first[100010],deg[100010];
void build(int u,int v)
{
	e[++tot]=(Edge){v,first[u]};
	first[u]=tot;deg[u]++;
	return ;
}
int p[100010];
int p2[100010];
int dis[100010];
int S;
void dfs(int u,int lst)
{
	dis[u]=dis[lst]+1;
	if(dis[u]>dis[S])S=u;
	for(int i=first[u];i;i=e[i].nxt)
		if(e[i].v!=lst)
			dfs(e[i].v,u);
	return ;
}
int a[100010],num;
bool book[100010];
bool dfs2(int u,int lst,int tar)
{
	if(u==tar)
	{
		book[u]=true;
		return true;
	}
	for(int i=first[u];i;i=e[i].nxt)
		if(e[i].v!=lst){
			bool flag=dfs2(e[i].v,u,tar);
			if(flag){
				a[++num]=u;
				book[u]=true;
				return true;
			}
		}
	return false;
}
int main()
{
	int n;scanf("%d",&n);
	for(int i=1;i<n;i++)
	{
		int u,v;
		scanf("%d %d",&u,&v);
		build(u,v);
		build(v,u);
	}
	S=0;
	dfs(1,0);int s=S;S=0;
	dfs(s,0);int t=S;
	dfs2(s,0,t);
	for(int i=1;i<=n;i++)
	{
		if(book[i])continue;
		bool flag=false;
		for(int j=first[i];j;j=e[j].nxt)
			if(book[e[j].v])flag=true;
		if(!flag){
			printf("-1\n");
			return 0;
		}
	}
	int now=0;
	p[++now]=n;int cur=n;
	for(int i=1;i<num;i++)
	{
		int t=deg[a[i]]-2;
		p[++now]=cur-t-1;
		while(t--)
			p[++now]=--cur;
		cur--;
	}
	p[++now]=1;
	reverse(p+1,p+n+1);
	now=0;
	p2[++now]=n;cur=n;
	for(int i=num-1;i>=1;i--)
	{
		int t=deg[a[i]]-2;
		p2[++now]=cur-t-1;
		while(t--)
			p2[++now]=--cur;
		cur--;
	}
	p2[++now]=1;
	reverse(p2+1,p2+n+1);
	for(int i=1;i<=n;i++)
		if(p[i]>p2[i]){
			swap(p,p2);
			break;
		}
		else if(p[i]<p2[i])
			break;
	for(int i=1;i<=n;i++)
		printf("%d ",p[i]);
	return 0;
}

Measured memory_bytes: 9472
n, k = map(int, input().split())
ans = 0
a = [1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072]
for i in range(1, n+1):
    res = k/i
    for j in range(len(a)):
        if res <= a[j]:
            res = j
            break
    ans += (1/n)*(0.5**res)
print(ans)

Measured memory_bytes: 3188
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans=0
for i in range(n):
  # t=max(a[i]-b[i],0)
  # a[i]=min(a[i],b[i])
  ans+=min(a[i],b[i])
  b[i]=max(b[i]-a[i],0)
  ans+=min(b[i],a[i+1])
  # a[i+1]-=b[i]
  a[i+1]=max(a[i+1]-b[i],0)
print(ans)

Measured memory_bytes: 19156
#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int main(){
    string S[100];
    int n,l;

    cin >> n >> l;

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

    for(int i=0;i<n;i++){
        cout << S[i];
    }
    cout << endl;

    return 0;
}

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

int main(void)
{
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  if (s == "abc") {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
  return 0;
}


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

using namespace std;

using ll = long long;

int main() {
    int n, m, x;
    cin >> n >> m >> x;

    vector<int> price(n);
    vector<vector<int>> a(n, vector<int> (m));
    for (int i = 0; i < n; i ++) {
        cin >> price[i];
        for (int j = 0; j < m; j++) {
            cin >> a[i][j];
        }
    }

    ll psum = 0;
    vector<ll> ps;
    vector<ll> as(m);
    for (int bit = 0; bit < (1 << n); bit++) {
        for (int i = 0; i < n; i++) {
            if (bit & (1 << i)) {
                psum += price[i];
                for (int j = 0; j < m; j++) {
                    as[j] += a[i][j];
                }
            }
        }
        for (int k = 0; k < m; k++) {
            if (as[k] < x) break;
            if (k == m - 1) ps.push_back(psum);
        }
        for (int l = 0; l < m; l++) as[l] = 0;
        psum = 0;
    }
    
    if (ps.empty()) cout << -1 << endl;
    else {
        sort(ps.begin(), ps.end());
        cout << ps[0] << endl;
    }

    return 0;
}

Measured memory_bytes: 3644
import java.util.*;

public class Main {
	private static long n;
	private static long m;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		n = Long.parseLong(sc.next());
		m = Long.parseLong(sc.next());
		long result;
		if(n*2 <= m)
			result = n + (m - n*2)/4;
		else
			result = m/2;
		System.out.println(result);
	}
}

Measured memory_bytes: 21844
#include<stdio.h>
int main()
{
    int number,i,a,b,people=0,tmp;
    scanf("%d",&number);
    for(i=1;i<=number;i++){
      scanf("%d %d",&a,&b);
      tmp = b-a;
      if(tmp==0){
        people++;
      }else{
        people += tmp+1;
      }
    }
    printf("%d",people);
    return 0;
}



Measured memory_bytes: 128
inp = input().split()
l = int(inp[0])
r = int(inp[1])

if r - l > 2019:
    print(0)
else:
    int_list_pre = list(range(l,r+1))
    int_list = [s%2019 for s in int_list_pre]
    l_l = len(int_list)
    min_mod = 2018

    for i in range(l_l):
        for j in range(l_l):
            if j > i:
                compare = (int_list[i] * int_list[j])%2019
                if compare < min_mod:
                    min_mod = compare


    print(min_mod)



Measured memory_bytes: 3064
#include <iostream>

int main(int argc, char const *argv[]) {
	int a,b,c;
	std::cin >> a >> b >> c;
	if (a == b) {
		std::cout << c << '\n';
	}
	if (b == c) {
		std::cout << a << '\n';
	}
	if (c == a) {
		std::cout << b << '\n';
	}
	return 0;
}


Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
        char[] S_ch = S.toCharArray();
        char[] T_ch = T.toCharArray();
        boolean ans = false;
        for (int i = S.length()-1, j = T.length()-1; i >=0; i--) {
            if (S_ch[i] == T_ch[j] || S_ch[i] == '?') {
                int tmp = i;
                for (; i >=0 && j >=0; i--, j--) {
                    if (S_ch[i] != T_ch[j]) {
                        if (S_ch[i] == '?') {
                            continue;
                        }
                        break;
                    }
                }
                if (j == -1) {
                    ans = true;
                    for (int k = T.length()-1; k >=0; k--) {
                        S_ch[tmp--] = T_ch[k];
                    }
                    break;
                } else {
                    i = tmp;
                    j = T.length()-1;
                }
            }
        }
        if (ans == true) {
            for (int i = 0; i < S.length(); i++) {
                if (S_ch[i] == '?') {
                    System.out.print("a");
                    continue;
                }
                System.out.print(S_ch[i]);
            }
            System.out.println("");
        } else {
            System.out.println("UNRESTORABLE");
        }
    }
}

Measured memory_bytes: 23508
#include <bits/stdc++.h>
using namespace std;
#define db(x) cout << #x << " = " << (x) << "\n";
using ll = long long;
using ld = long double;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    ll n, w;
    cin >> n >> w;
    vector<pair<int, long long>> sack(n + 1);
    for (int i = 1; i <= n; i++)
    {
        cin >> sack[i].first >> sack[i].second;
    }
    sort(sack.begin(), sack.end());
    vector<long long> dp(w + 1);
    for (int i = 1; i <= n; i++)
    {
        for (int j = w; j >= 1; j--)
        {
            if (j >= sack[i].first)
            {
                dp[j] = max(dp[j], dp[j - sack[i].first] + sack[i].second);
            }
        }
    }
    cout << dp[w];
    return 0;
}


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

int main () {
	int w, h;
	while (cin >> h >> w, h || w) {
		int c[h][w];
		for (int i = 0; i < h; i++) {
			char f[w + 1];
			cin >> f;
			for (int j = 0; j < w; j++) {
				if (f[j] == '*') {
					c[i][j] = 0;
				}
				else if (j == 0) {
					c[i][j] = 1;
				}
				else {
					c[i][j] = c[i][j - 1] + 1;
				}
			}
		}
		int ans = 0;
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				int minc = c[i][j];
				int s = c[i][j];
				for (int k = 0; i - k >= 0 && c[i - k][j] > 0; k++) {
					minc = min(minc, c[i - k][j]);
					s = max(s, (k + 1) * minc);
				}
				ans = max(ans, s);
			}
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 2136
#include <bits/stdc++.h>
using namespace std;
#define modulo 998244353
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 100000000000000000



int main(){
	
	int A,B;
	cin>>A>>B;
	
	string S;
	cin>>S;
	
	for(int i=0;i<S.size();i++){
		if(i==A&&S[i]!='-'){
			cout<<"No"<<endl;
			return 0;
		}
		if(i!=A&&S[i]=='-'){
			cout<<"No"<<endl;
			return 0;
		}
	}
	
	cout<<"Yes"<<endl;
	
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
	int n;
	cin >> n;
	int d = 0;
	for (int i = 0; i < n; ++i) {
		int a, b;
		cin >> a >> b;
		if (d < 3) {
			if (a == b) ++d;
			else d = 0;
		}
	}

	if (d >= 3) cout << "Yes";
	else cout << "No";
}


Measured memory_bytes: 3628
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
 
int main(){
    int n; cin>>n;
    int t,a; cin>>t>>a;
    double mini = 1000000;
    int mini_i = 0;
    for(int i=0;i<n;++i){
        int h; cin>>h;
        double now = abs(t-h*0.006-a);
        if(now < mini){
            mini = now;
            mini_i = i;
        }
    }cout<<mini_i+1<<endl;
    return 0;
}

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

#define show(x) cerr << #x << " = " << x << endl ;
#define input_from_file freopen("input.txt","r",stdin)
#define output_to_file freopen("output.txt" , "w",stdout)
#define output_to_error freopen("error.txt" , "w" ,stderr)
#define fastio ios_base::sync_with_stdio(0)
#define endl '\n'


int main()
{
	#ifdef LOCAL
        input_from_file;
        output_to_file;
        output_to_error;
    #endif
	fastio;cin.tie(0);cout.tie(0);
	int n , x; cin >> n ; 
	map < int, bool > mp;
	bool f = false;
	for(int i = 1 ; i <= n ; ++i)
	{
		cin >> x ; 
		if(!f && mp.find(x) != mp.end())
		{
			f = true;
		}
		else mp[x] = 1 ;
	}
	cout << (f ? "NO" : "YES") ;

	return 0;
}


Measured memory_bytes: 9600
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

double shop(int n,int i){
	const int tanka[3] = {380,550,850};
	const int per[3] = {5,4,3};
	const double wari[3] = {0.8,0.85,0.88};
	return tanka[i] * (n - n % per[i]) * wari[i] + (double)tanka[i] * (n % per[i]);
}
int main(void){
	int i, j, k, n;
	int const wei[3] = {200,300,500};
	double kingaku, *dp;
	scanf("%d",&n);
	n /= 100;
	while(n != 0){
		dp = (double *)malloc(sizeof(double) * (n + 1));
		for(i = 0;i <= n;i++)
			*(dp + i) = 0x7FFFFFFF;
		*dp = 0;
		for(i = 0;i < 3;i++){
			for(j = n;j >= 0;j--){
				if(*(dp + j) != 0x7FFFFFFF){
					for(k = 0;wei[i] * k + j * 100 <= n * 100;k++){
						kingaku = shop(k,i) + dp[j];
						if(kingaku < dp[(wei[i] * k) / 100 + j])
							dp[(wei[i] * k) / 100 + j] = kingaku;
					}
				}
			}
		}
		printf("%d\n",(int)dp[n]);
		scanf("%d",&n);
		n /= 100;
	}
	return 0;
}

Measured memory_bytes: 608
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define all(c) begin(c),end(c)
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
//最大公約数
ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}
//最小公倍数
ll lcm(ll x, ll y) {
  return x/gcd(x, y)*y;
}
//素因数分解
vector<pair<ll,int>> factorize(ll n) {
  vector<pair<ll,int>> res;
  for (ll i = 2; i*i <= n; ++i) {
    if (n%i) continue;
    res.emplace_back(i,0);
    while (n%i == 0) {
      n /= i;
      res.back().second++;
    }
  }
  if (n != 1) res.emplace_back(n,1);
  return res;
}
 
 
 ll mod=998244353;
 
int main() {
  int n;
  cin>>n;
  vector<string> s(n);
  rep(i,n){
    cin>>s.at(i);
  }
  int c[4]={0,0,0,0};

  rep(i,n){
    if(s[i]=="AC")c[0]++;
    if(s[i]=="WA")c[1]++;
    if(s[i]=="TLE")c[2]++;
    if(s[i]=="RE")c[3]++;            
  }
  
  cout<<"AC"<<" x "<<c[0]<<endl;
  cout<<"WA"<<" x "<<c[1]<<endl;
  cout<<"TLE"<<" x "<<c[2]<<endl;
  cout<<"RE"<<" x "<<c[3]<<endl;

}



Measured memory_bytes: 6428
n,m=map(int,input().split())
d={i:set() for i in range(n)}
for i in range(m):
  a,b=map(int,input().split())
  d[a-1].add(b-1)
  d[b-1].add(a-1)
f=False
for x in d[0]:
  if n-1 in d[x]:
    f=True
    break
print('POSSIBLE' if f else 'IMPOSSIBLE')

Measured memory_bytes: 89228
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] arr = new int[n];
		for(int i = 0; i< n; ++i)
			arr[i] = in.nextInt();
		
		Arrays.sort(arr);
		int ans = 1;
		
		int last = arr[n - 1];
		for(int i = n-2; i>= 0; --i) {
			if(arr[i] < last) {
				++ans;
				last = arr[i];
			}
		}
		
		System.out.println(ans);
	}
}

Measured memory_bytes: 23124
M = 10**9 + 7
s = int(input()) - 1
a = [0, 0] + [1] * (s - 1)
for i in range(s - 2):
  a[i + 3] = (a[i + 3] + a[i]) % M
  a[i + 1] = (a[i + 1] + a[i]) % M
print(a[s])


Measured memory_bytes: 9128