首页 > 数位dp?
头像 Kidding_Ma
发表于 2023-10-20 21:55:46
Link A 从后往前找第一位偶数。 。 C++ Code #include "bits/stdc++.h" using namespace std; using i64 = long long; int main() { ios::sync_with_stdio(false); 展开全文
头像 ok噜
发表于 2023-10-20 21:02:52
using namespace std; int main(){ int n; int count = 0; int first_bit = 0; int judge = 0; cin>>n; int tep1 = n; while 展开全文
头像 lqh2022
发表于 2023-10-20 21:43:23
D. 答案最多20次,枚举前面几次+1就行。 #include<bits/stdc++.h> #define ll long long using namespace std; void solve(){ ll n; cin >> n; ll y = 展开全文
头像 ok噜
发表于 2023-10-20 21:10:19
```#include <iostream> #include <algorithm> using namespace std; int main(){ int sum = 0; int count = 0; int n; cin>> 展开全文
头像 CARLJOSEPHLEE
发表于 2024-10-29 10:17:11
双端队列,从前往后遍历,把前导零去掉,从后往前遍历,把末位奇数去掉。记录一下初始长度和最后长度,相减得到答案。 from collections import deque a = deque(input().strip()) oldlena = len(a) lena = len(a) while 展开全文
头像 hover2024
发表于 2023-10-20 21:34:01
###d题 思路看代码处 #include <iostream> #include <cstring> #include <algorithm> #include <vector> #include <queue> #include< 展开全文
头像 玉林666
发表于 2023-10-21 00:12:21
题目已经告诉答案了,记忆化搜之[doge] #include<bits/stdc++.h> //#include<algorithm> using namespace std; using ll = long long; using pis = pair<int,in 展开全文