#include <bits/stdc++.h>
using namespace std;
int n, x, a[10];
int main()
{
while (cin >> x) a[n++] = x;
int t = 0;
for (int i = 1; i <= 3; i++)
{
t = a[t];...
#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int n, f[N];
bool st[N];
int main()
{
cin >> n;
f[0] = f[1] = 1;
st[1] = true;
for (int i = 2; f[i - 1] <= ...
#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
typedef pair<double, double> PDD;
void solve()
{
PDD p[5];
for (int i = 1; i <= 3; i++) cin >> p[i].y >> p[i].x...
#include <bits/stdc++.h>
using namespace std;
string s;
int cnt[26];
int main()
{
int T;
cin >> T;
while (T--)
{
memset(cnt, 0, sizeof cnt);
bool flag = ...
这道题还是经过当时群友提醒才知道怎么做的 XD
赛后再整理了一会,我是这样理解的:
每次操作可以贪心地将一组数字的每一个对应位都只变成剩余1个1或者没有1
比如 3 | 5 = 011 | 101 = 011 | 100 = 3 | 4这样就实现了5->4的变小过程
最后答案就是所有数字的或和
#include <bits/stdc++.h>
usi...
class Solution {
public:
int countEven(int num) {
int res = 0;
for (int i = 1; i <= num; i++) {
int t = i, sum = 0;
while (t) {
sum +...
#include <bits/stdc++.h>
using namespace std;
int main(){
double h;
scanf("%lf",&h);
printf("%.9f\n",sqrt(h*(12800000+h)));
return 0;
}
#include <bits/stdc++.h>
using...