当前位置:网站首页>“蔚来杯“2022牛客暑期多校训练营1
“蔚来杯“2022牛客暑期多校训练营1
2022-07-27 05:46:00 【eyuhaobanga】
先占个坑,慢慢补
A
AC代码:
数学几何题
AC代码:
#include <bits/stdc++.h> using namespace std; using LL = long long; const double PI = acos(-1.0); void Solve() { double r, xq, yq, d; cin >> r >> xq >> yq >> d; double zhouchang = 2 * PI * r; double len = sqrt(xq * xq + yq * yq); double c = len + d; double x = len - d; double now1 = acos(c / r); double now2 = acos(x / r); double now3 = now1 > now2 ? now1 - now2 : now2 - now1; cout << fixed << setprecision(9) << zhouchang * now3 / PI / 2 << '\n'; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; while (T--) { Solve(); } return 0; }AC代码:
#include <bits/stdc++.h> using namespace std; using LL = long long; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); string s; cin >> s; int len = s.size(); int cnt = 0; for (int i = 0; i < len; i++) { if (s[i] == '9') { cnt++; } else { break; } } if (cnt >= len - 1) { cout << s <<'\n'; } else { for (int i = 0; i < len - 1; i++) { cout << 9; } cout << '\n'; } return 0; }概率期望DP+逆元
AC代码:
#include <bits/stdc++.h> using namespace std; using LL = long long; const LL mod = 1e9 + 7; LL dp[150][30]; LL qp(LL a, LL b, LL res) { for (; b; b >>= 1, a = a * a % mod) { if (b & 1) { res = res * a % mod; } } return res % mod; } LL inv(LL x, LL y) { return qp(x, mod - 2, y); } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); //1.没摸到 2.四张全摸到 for (int i = 1; i <= 4 * 34 - 13; i++) { for (int j = 1; j <= 13; j++) { if (i < 3 * j) { continue; } LL iinv = inv(i, 3 * j); if (j == 1) { dp[i][j] = (1 + dp[i - 1][j] * (1 + mod - iinv)) % mod; } else { dp[i][j] = (1 + dp[i - 1][j] * (1 + mod - iinv) + dp[i - 1][j - 2] * iinv) % mod; } } } int T; cin >> T; for (int j = 1; j <= T; j++) { string s; cin >> s; map<string, int> mp; for (int i = 0; i < 26; i += 2) { string x = ""; x += s[i]; x += s[i + 1]; mp[x]++; } int ans = 0; for (auto it : mp) { if (it.second == 2) { ans++; } } cout << "Case #" << j << ": " << dp[4 * 34 - 13][13 - 2 * ans] << '\n'; } return 0; }
边栏推荐
- Express receive request parameters
- 大疆livox定制的格式CustomMsg格式转换pointcloud2
- PNA polypeptide PNA TPP | GLT ala ala Pro Leu PNA | suc ala Pro PNA | suc AAPL PNA | suc AAPM PNA
- Book borrowing management system based on SSM
- 内部类--看这篇就懂啦~
- 基于SSM音乐网站管理系统
- Basic statement of MySQL (1) - add, delete, modify and query
- 从技术原理看元宇宙的可能性:Omniverse如何“造”火星
- 【Latex格式】双栏双图左右并排有小标题、上下并列有小标题
- Vscode connection remote server development
猜你喜欢

regular expression

聊聊大火的多模态

Shell programming specifications and variables

Dimension problems and contour lines

基于SSM学生学籍管理系统

Reflection on pytorch back propagation

PNA polypeptide PNA TPP | GLT ala ala Pro Leu PNA | suc ala Pro PNA | suc AAPL PNA | suc AAPM PNA

Leetcode series (I): buying and selling stocks

DNA coupled PbSe quantum dots | near infrared lead selenide PbSe quantum dots modified DNA | PbSe DNA QDs

Image super-resolution evaluation index
随机推荐
DNA coupled PbSe quantum dots | near infrared lead selenide PbSe quantum dots modified DNA | PbSe DNA QDs
PNA polypeptide PNA TPP | GLT ala ala Pro Leu PNA | suc ala Pro PNA | suc AAPL PNA | suc AAPM PNA
Drools(5):Drools高级语法
Neural network parameter initialization
用typescript实现排序-递增
Pytorch model
Event capture and bubbling - what is the difference between them?
PNA modified polypeptide arms PNA PNA DNA suc aapf PNA suc - (ALA) 3 PNA
强网杯2021 pwn 赛题解析——babypwn
Visual horizontal topic bug1:filenotfounderror: could not find module 'mvcameracontrol dll‘ (or one of it
PHP defines the array using commas,
Jest single test style problem [identity obj proxy] NPM package
pre-commit install 时 CalledProcessError
DNA modified noble metal nanoparticles | DNA modified gold nanoparticles (scientific research level)
Bert and RESNET can also be trained on mobile phones?!
DataScience:数据生成之在原始数据上添加小量噪声(可自定义噪声)进而实现构造新数据(dataframe格式数据存储案例)
CASS11.0.0.4 for AutoCAD2010-2023免狗使用方法
VScode连接远程服务器开发
Livox SLAM(带LIO+闭环检测优化)
O2O电商线上线下一体化模式分析