C. Vasily the Bear and Sequence time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasily the bear has got a sequence of positive integers a1, a2, ..., *a**n*. Vasily the Bear wants to write o…
两个二分 枚举位数 #include <bits/stdc++.h> #define MOD 1000000007 using namespace std; typedef long long ll; ll ten[]; ll check1(ll x) { ll ans = ; ll l, r; ; i <= ; i++) { l = ten[i], r = ten[i + ] - ; if (r < x) { ans += i * ( * x - l - r) * (r - l…
E. Santa Claus and Tangerines time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Santa Claus has n tangerines, and the i-th of them consists of exactly ai slices. Santa Claus came to a school…
A /*#include<cstring>#include<algorithm>#include<queue>#include<vector>#include<cstdio>#include<cmath>#include<iostream>*/ #include<bits/stdc++.h> using namespace std; typedef long long ll; ; int main() { in…
CodeForces - 1154G You are given an array a consisting of n integers a1,a2,…,an . Your problem is to find such pair of indices i,j (1≤i<j≤n) that lcm(ai,aj) is minimum possible. lcm(x,y) is the least common multiple of x and y (minimum positive numbe…