#include<bits/stdc++.h>usingnamespacestd;inta[1005];intv[10005];intmain(){ ios::sync_with_stdio(false); cin.tie(0);intT; cin>>T;while(T--) {intn; cin>>n;for(inti=1;i<=n;i++) { cin>>a[i]; v[a[i]]++;while(v[a[i]]>2) { v[a[i]]--; a[i]++; v[a[i]]...
代码# #include<bits/stdc++.h>#defineintlonglongintans;intpow10[12];intp[12];boolcheck(intnow){while(now){if(now%10==7)returntrue;now/=10;}returnfalse;}boolflag;voiddfs(intnow,inttmp,intlst){if(now>10)return;for(inti=lst;i>=0;i--)if((p[now]+tmp+i*9)%10==7){flag=true;...
#define int __int128 bool check(ll _x){ while(_x){ if(_x%10==7) return true; _x/=10; } return false; } void solve(){ vector<int> vv(20); vv[1]=9; for(int i=2;i<=15;++i) vv[i]=vv[i-1]*10+9; int sum; sum=read(); //快读函数 int ans=INF; if(check(sum...
//F #include<bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define fir first #define sec second const int maxn = 2e5+5, mod = 1e9+7; int n, a[maxn], pre[maxn]; void solve(){ cin >> n; for ( int i = 1; i <= n; i++ ) cin >...
{cin>>x;hash[x]++;}for(inti=1;i<n;i++){if(hash[i]>2){hash[i+1]+=hash[i]-2;hash[i]=2;}}for(inti=1;i<=n;i++){if(hash[i]%2==1){No;return;}}Yes;}intmain(){ios::sync_with_stdio(false);cin.tie(__null);intt=1;cin>>t;for(int_=0;_<t;_++)solve();...
I think there's a mistake in the tests here. Can someone explain me why I got WA in test case 2. There was x = 1 and y = 9. So if we take n=9 S(9)=9 and S(n+1)=S(10)=1, and the answer is YES.round 1004 (div. 2) ...
边看可爱的小东西边打代码 Codeforces Round 1007 (Div. 2) rk 346 603 1 32:56 App Codeforces Round 972 (Div. 2) 补题最积极的一集 827 0 02:01:47 App 【赛时5题/蓝名萌新】Codeforces Round 1004 (Div. 2) 5067 3 01:55:50 App Codeforces Round 1004 (Div. 1) 1990 0 40:56 App ...
App Educational Codeforces Round 174 (Div. 2) 题目讲解 ABCDE (CF2069) 5135 3 01:55:50 App Codeforces Round 1004 (Div. 1) 11.1万 763 03:55:20 App Deepseek崛起:IT行业巨变!未来5年这些编程语言正被淘汰(Java、golang、php、rust、C#...),留给普通程序员的机会不多了! -马士兵 ...
Codeforces Round #495 (Div. 2) C. Sonya and Robots,http://codeforces.com/contest/1004/problem/C题意:在一行上有n个数字,现在在最左边和最右边各放置一个机器人,左右机器人各有一个数字p和q。现在这两个机器人从起点开始分别向右和向左移动,当它们移动到和他们自
1004B-SonyaAndExhibition.cpp 1004C-SonyaAndRobots.cpp 1005A-TanyaAndStairways.cpp 1005B-DeleteFromTheLeft.cpp 1005C-SummarizeToThePowerOfTwo.cpp 1005D-PolycarpAndDiv3.cpp 1006A-AdjacentReplacements.cpp 1006B-PolycarpsPractice.cpp 1006C-ThreePartsOfTheArray.cpp 1006E-MilitaryProblem-...