当前位置: 首页 > wzjs >正文

东莞学校网站建设大学英文网站建设举措

东莞学校网站建设,大学英文网站建设举措,金华网站建设yw126,宇泽佛山网站建设个人主页:Guiat 归属专栏:每日一题 文章目录 1. 【2.24】P10424 [蓝桥杯 2024 省 B] 好数2. 【2.25】P8665 [蓝桥杯 2018 省 A] 航班时间3. 【2.26】P10905 [蓝桥杯 2024 省 C] 回文字符串4. 【2.27】P10425 [蓝桥杯 2024 省 B] R 格式5. 【2.28】P10426…

在这里插入图片描述

个人主页:Guiat
归属专栏:每日一题

在这里插入图片描述

文章目录

  • 1. 【2.24】P10424 [蓝桥杯 2024 省 B] 好数
  • 2. 【2.25】P8665 [蓝桥杯 2018 省 A] 航班时间
  • 3. 【2.26】P10905 [蓝桥杯 2024 省 C] 回文字符串
  • 4. 【2.27】P10425 [蓝桥杯 2024 省 B] R 格式
  • 5. 【2.28】P10426 [蓝桥杯 2024 省 B] 宝石组合
  • 6. 【3.1】P10912 [蓝桥杯 2024 国 B] 数星星
  • 7. 【3.2】P10914 [蓝桥杯 2024 国 B] 跳石头

正文

1. 【2.24】P10424 [蓝桥杯 2024 省 B] 好数

题目链接:https://www.luogu.com.cn/problem/P10424

【AC_Code】

#include <iostream>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;int N, cnt;bool check(int n)
{int number = 1;while (n > 0){if (number % 2 == 1) { if ((n % 10) % 2 == 0) return false; }else if ((n % 10) % 2 != 0) return false;n /= 10; number ++;}return true;
}int main()
{IOS; cin >> N;for (int i = 1; i <= N; i ++) if (check(i)) cnt ++;cout << cnt << '\n';return 0;
}

2. 【2.25】P8665 [蓝桥杯 2018 省 A] 航班时间

题目链接:https://www.luogu.com.cn/problem/P8665

【AC_Code】

#include <iostream>
#include <iomanip>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;int solve()
{int h1, m1, s1, h2, m2, s2, d = 0; char c1, c2, c3, c4, c5, c6;cin >> h1 >> c1 >> m1 >> c2 >> s1 >> h2 >> c3 >> m2 >> c4 >> s2;if (cin.peek() == ' ') cin >> c5 >> d >> c6;return (86400 * d + 3600 * h2 + 60 * m2 + s2) - (3600 * h1 + 60 * m1 + s1);
}int main()
{IOS; int T; cin >> T;while (T --){int ans = (solve() + solve()) >> 1;cout << setw(2) << setfill('0') << ans / 3600 << ':'<< setw(2) << setfill('0') << (ans % 3600) / 60 << ':'<< setw(2) << setfill('0') << ans % 60 << '\n';}return 0;
}

3. 【2.26】P10905 [蓝桥杯 2024 省 C] 回文字符串

题目链接:https://www.luogu.com.cn/problem/P10905

【AC_Code】

#include <iostream>
#include <string>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;void solve()
{string s; cin >> s; int l = 0, r = s.length() - 1;while (s[l] == 'l' || s[l] == 'q' || s[l] == 'b') l ++;while (s[r] == 'l' || s[r] == 'q' || s[r] == 'b') r --;bool flag = true;for (int i = l, j = 0; i <= (l + r) / 2; i ++, j ++) if (s[i] != s[r - j]) flag = false;if ( ! flag ) cout << "No\n";else if (l == 0) cout << "Yes\n";else if (r == s.length() - 1) cout << "No\n";else if (s.length() - r < l) cout << "No\n";else{l --; r ++;while (s[l] == s[r] && l >= 0 && r <= s.length()) l --, r ++;if (r == s.length() || l == -1) cout << "Yes\n";else cout << "No\n";}
}int main()
{IOS; int T; cin >> T; while (T--) solve();return 0;
}

4. 【2.27】P10425 [蓝桥杯 2024 省 B] R 格式

题目链接:https://www.luogu.com.cn/problem/P10425

【AC_Code】

#include <iostream>
#include <algorithm>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;const int N = 1e6;
int n, a[N], pos, len; string q;void solve()
{reverse(q.begin(), q.end());pos = q.find('.'); q.erase(pos, 1); len = q.size();for (int i = 0; i < len; i ++) a[i + 1] = q[i] - '0';for (int i = 1; i <= n; i ++){for (int i = 1; i <= len; i ++) a[i] *= 2;for (int i = 1; i <= len; i ++) a[i + 1] += a[i] / 10, a[i] %= 10;if (a[len + 1]) len ++;}if (a[pos] >= 5) a[pos + 1] ++;for (int i = pos + 1; i <= len; i ++) a[i + 1] += a[i] / 10, a[i] %= 10;if (a[len + 1]) len ++;for (int i = len; i > pos; i --) cout << a[i]; cout << '\n';
}int main()
{IOS; cin >> n >> q; solve();return 0;
}

5. 【2.28】P10426 [蓝桥杯 2024 省 B] 宝石组合

题目链接:https://www.luogu.com.cn/problem/P10426

【AC_Code】

#include <iostream>
#include <vector>
#include <algorithm>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;const int MAXN = 1e5 + 10; int n, h[MAXN]; vector<int> fac[MAXN];int gcd(int a, int b) { return __gcd(a, b); }void solve()
{cin >> n; for (int i = 1; i <= n; ++ i) cin >> h[i];sort(h + 1, h + 1 + n);for (int i = 1; i <= n; ++ i) for (int j = 1; j * j <= h[i]; ++j){if (h[i] % j == 0){fac[j].push_back(h[i]);if (h[i] / j != j) fac[h[i] / j].push_back(h[i]);}}for (int i = MAXN; i >= 1; -- i){if (fac[i].size() >= 3){int a = fac[i][0], b = fac[i][1], c = fac[i][2];if (gcd(gcd(a, b), c) == i) { cout << a << " " << b << " " << c << "\n"; return; }}}
}int main()
{IOS; solve();return 0;
}

6. 【3.1】P10912 [蓝桥杯 2024 国 B] 数星星

题目链接:https://www.luogu.com.cn/problem/P10912

【AC_Code】

#include <iostream>
#include <vector>
#include <algorithm>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;const int N = 1e5 + 10, mod = 1e9 + 7;
int n, a[N], b[N], c[N], f[N], l, r, ans;
vector<int> vec[N];int fun(int x, int y) { return 1ll * b[x] * f[y] % mod * f[x - y] % mod; }void DFS(int x, int y)
{for (auto n : vec[x]) if (n != y) DFS(n, x);if (static_cast<int> (vec[x].size()) + 1 >= 1){int p = min(r - 1, static_cast<int> (vec[x].size()));for (int i = l - 1; i <= p; i ++) ans = (ans + fun(vec[x].size(), i)) % mod;}
}void solve()
{cin >> n; b[0] = c[0] = 1; b[1] = 1; c[1] = 1; f[0] = 1; f[1] = 1;for (int i = 2; i <= n; i ++){b[i] = 1ll * b[i - 1] * i % mod;c[i] = 1ll * c[mod % i] * (mod - mod / i) % mod;f[i] = 1ll * f[i - 1] * c[i] % mod;}for (int i = 1; i < n; i ++){int x, y; cin >> x >> y;vec[x].push_back(y); vec[y].push_back(x);}cin >> l >> r;DFS(1, 0);cout << ans << '\n';
}int main()
{IOS; solve();return 0;
}

7. 【3.2】P10914 [蓝桥杯 2024 国 B] 跳石头

题目链接:https://www.luogu.com.cn/problem/P10914

【AC_Code】

#include <iostream>
#include <bitset>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0); using namespace std;const int N = 4e4 + 10; int c[N], n, ans;
bitset<N> f[N];void solve()
{cin >> n;for (int i = 1; i <= n; i ++){cin >> c[i]; f[i][c[i]] = 1;}for (int i = n; i >= 1; i --){if (i + c[i] <= n) f[i] |= f[i + c[i]];if (2 * i <= n) f[i] |= f[2 * i];ans = max(ans, (int)f[i].count());}cout << ans << '\n';
}int main()
{IOS; solve();return 0;
}

结语
感谢您的阅读!期待您的一键三连!欢迎指正!

在这里插入图片描述

http://www.dtcms.com/wzjs/594410.html

相关文章:

  • 成都网站建设好多科技辽宁企业信息公示系统
  • 静态网站html做网站可以不写代码
  • wordpress网站菜单固定外贸联系网站
  • 手机自适应网站建设网站title的作用
  • 深圳网站建设迅美制作网站吗
  • 微网站模板建设的选择网站开发很难么
  • 丰县网站建设7个免费的ui素材网站
  • 珠海响应式网站制作长沙网站建设服务公司
  • 企业网站源码git遵义网站建设哪家好
  • 网站推广方式和手段国家商标查询官网入口
  • 做房产网站不备案可以吗优设网学影视剪辑免费
  • 站内推广方式qq群推广引流免费网站
  • 做个简单的企业小网站汽修行业做环评网站
  • 国外免费可以做网站的服务器网站建设的验收
  • 房管局网站建设北京大学廉政建设研究中心网站
  • jsp和html做的招聘网站wordpress企业中文模板
  • 医院网站建设课程代码加强局网站建设
  • 一个ip做几个网站网站开发费用如何账务处理
  • 2023年推广网站丹阳网络
  • 国内做外单的网站有哪些商丘网约车都有哪些平台
  • 三九集团如何进行网站建设网页模板库
  • 建设网站的基本技术做网站 excel
  • 网站开发绩效考核现在做百度推广有用吗
  • 网站风格包括哪些如何制作统计小程序
  • 织梦做视频网站可以吗投资担保网站建设
  • 网站建设方案设计ppt品牌推广论文
  • 焦作网站制作-焦作网站建设-焦作网络公司-维科网络大数据营销推广精准粉
  • 关键词优化app快速整站优化
  • 网站空间要多大软件开发工作流程
  • 国内最好的软件网站建设东城响应式网站建设