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

wordpress建手机站教程wordpress 图片调用代码

wordpress建手机站教程,wordpress 图片调用代码,济南做网站优化,ie 10 常用网站个人主页:Guiat 归属专栏:算法竞赛 文章目录 A. 移动距离(5分填空题)B. 客流量上限(5分填空题)C. 可分解的正整数D. 产值调整E. 画展布置F. 水质检测G. 生产车间H. 装修报价 正文 总共10道题。 A. 移动距离…

在这里插入图片描述

个人主页:Guiat
归属专栏:算法竞赛

在这里插入图片描述

文章目录

  • A. 移动距离(5分填空题)
  • B. 客流量上限(5分填空题)
  • C. 可分解的正整数
  • D. 产值调整
  • E. 画展布置
  • F. 水质检测
  • G. 生产车间
  • H. 装修报价

正文

总共10道题。

A. 移动距离(5分填空题)

【题目】移动距离

【分析】
考察数学。先往右走直线,再走圆弧,即最优解。

【答案】1576

【AC_Code】

#include <bits/stdc++.h>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;void solve()
{int x = 233, y = 666; double r = sqrt(x * x + y * y);double res = r * (1 + atan2(y, x));cout << fixed << setprecision(0)  << res << '\n';
}int main()
{IOS int _ = 1;   // cin >> _;while (_ --) solve();return 0;
}

B. 客流量上限(5分填空题)

【题目】客流量上限

【分析】

【答案】781448427

【AC_Code1】

#include <bits/stdc++.h>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;
using ll = long long; const int mod = 1e9 + 7;int FE(int m, int k, int p)
{ll t = m, res = 1;while (k){if (k & 1) res = res * t % p;k >>= 1; t = t * t % p;}return res;
}void solve()
{cout << FE(2, 1012, mod) << '\n';
}int main()
{IOS int _ = 1;   // cin >> _;while (_ --) solve();return 0;
}

【AC_Code2】

#include <bits/stdc++.h>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;const int mod = 1e9 + 7;int pow(int m, int k, int p)
{int res = 1;while (k --) res = res * m % p;return res;
}void solve()
{cout << pow(2, 1012, mod) << '\n';
}int main()
{IOS int _ = 1;   // cin >> _;while (_ --) solve();return 0;
}

C. 可分解的正整数

【题目】可分解的正整数

【分析】
考察模拟。根据题意,分析出除1以外的任何整数都可以分解。

【AC_Code】

#include <bits/stdc++.h>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;const int N = 1e5 + 10; int a[N], ans;void solve()
{int n; cin >> n;for (int i = 0; i < n; i ++) { cin >> a[i]; if (a[i] != 1) ans ++; }cout << ans << '\n';
}int main()
{IOS int _ = 1;   // cin >> _;while (_ --) solve();return 0;
}

D. 产值调整

【题目】产值调整

【分析】
按题意暴力模拟会超时只有30分。“观察到”如果 A, B, C 三个数相同的话再处理还是不改变三个数大小,此时直接跳出循环来节省时间,可以拿到满分。

【AC_Code】

#include <bits/stdc++.h>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;void solve()
{int T; cin >> T;while (T --){int A, B, C, K; cin >> A >> B >> C >> K;while (K --){int a = A, b = B, c = C;A = (b + c) / 2; B = (a + c) / 2; C = (a + b) / 2;if (A == B && B == C) break;   // 拿满分关键 }cout << A << ' ' << B << ' ' << C << '\n';}
}int main()
{IOS int _ = 1;   // cin >> _;while (_ --) solve();return 0;
}

E. 画展布置

【题目】画展布置

【分析】

【AC_Code】

#include <bits/stdc++.h>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;
using ll = long long;const int N = 1e5 + 10; ll a[N], ans = LLONG_MAX;void solve()
{int n, m; cin >> n >> m;for (int i = 0; i < n; i ++) cin >> a[i], a[i] *= a[i];sort(a, a + n);for (int l = 0, r = m - 1; r < n; l ++, r ++) ans = min(a[r] - a[l], ans);cout << ans << '\n';  
}int main()
{IOS int _ = 1;   // cin >> _;while (_ --) solve();return 0;
}

F. 水质检测

【题目】水质检测

【分析】

【AC_Code】

#include <bits/stdc++.h>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;void solve()
{string a, b; cin >> a >> b;int last = -1, state = -1, cnt = 0;for (int i = 0; i < a.length(); i ++){if (a[i] == '.' && b[i] == '.') continue;if (last != -1) cnt += i - last - 1;if (a[i] == '#' && b[i] == '#') state = 3;else if (a[i] == '#' && b[i] == '.'){if (state == 2) { cnt ++; state = 3; } else state = 1;}else if (a[i] == '.' && b[i] == '#'){if (state == 1) { cnt ++; state = 3; } else state = 2;}last = i;}cout << cnt << '\n';
}int main()
{IOS int _ = 1;   // cin >> _;while (_ --) solve();return 0;
}

G. 生产车间

【题目】生产车间

【分析】

【AC_Code】

H. 装修报价

【题目】装修报价

【分析】

【AC_Code1】

#include <bits/stdc++.h>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;
using ll = long long;const int mod = 1e9 + 7;int s, ans;ll FE(ll a, ll b, ll p)
{ll ans = 1; a %= p;while (b){if (b & 1) ans = (ans * a) % p;b >>= 1; a = (a * a) % p;}return ans % p;
}void solve()
{int n; cin >> n;for (int i = 1; i <= n; i ++){int a; cin >> a; s ^= a;if (i < n) { ans += 2 * s * FE(3ll, n - i - 1, mod) % mod; }else ans += s;ans %= mod;}cout << ans << '\n';
}int main()
{IOS int _ = 1;   // cin >> _;while (_ --) solve();return 0;
}

【AC_Code2】

#include <bits/stdc++.h>
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);using namespace std;
using ll = long long;const int mod = 1e9 + 7; ll sum, ans;void solve()
{int n; cin >> n;for (int i = 1; i <= n; i ++){int a; cin >> a;ans = (ans * 3 - sum + (sum ^= a) + mod) % mod;}cout << ans << '\n';
}int main()
{IOS int _ = 1;   // cin >> _;while (_ --) solve();return 0;
}

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

在这里插入图片描述


文章转载自:

http://QdrmR5vK.dmwbs.cn
http://RoPT0FQG.dmwbs.cn
http://Ev5li3Uu.dmwbs.cn
http://I82OSbtL.dmwbs.cn
http://Sz2ATXqX.dmwbs.cn
http://PtR8bS4n.dmwbs.cn
http://oOiFzIqu.dmwbs.cn
http://Z2ndDNAA.dmwbs.cn
http://7qUJzGMH.dmwbs.cn
http://6jiHxEGa.dmwbs.cn
http://HB05Zn8S.dmwbs.cn
http://NqnZLPF3.dmwbs.cn
http://wHyWQF2T.dmwbs.cn
http://6XWdcVX1.dmwbs.cn
http://idtYPPgH.dmwbs.cn
http://9xUhPeda.dmwbs.cn
http://1YsK0f3r.dmwbs.cn
http://rWf3W0yE.dmwbs.cn
http://r5EZGEJe.dmwbs.cn
http://2UlX0sgA.dmwbs.cn
http://1MbkXpAn.dmwbs.cn
http://YWZdlBl9.dmwbs.cn
http://uDIn3T5N.dmwbs.cn
http://ZfIeLZCz.dmwbs.cn
http://Xr9GpkvF.dmwbs.cn
http://MDCYdJGU.dmwbs.cn
http://PibAyuFz.dmwbs.cn
http://LjGwgVHO.dmwbs.cn
http://yXXSUPxc.dmwbs.cn
http://TOQhfkP4.dmwbs.cn
http://www.dtcms.com/wzjs/691435.html

相关文章:

  • 百度秒收录的网站河北高端网站设计公司
  • 建设门户网站需要多少钱学校网站建设联系电话
  • 平潭建设局网站wordpress 标签 seo
  • vue做网站前台电子商务网站建设的心得体会
  • 高校思政教育工作网站建设织梦做的网站_别人提交给我留的言我去哪里看
  • 重庆网站建设网络推广c2c电商平台有哪些家
  • 微信内部劵网站怎么做绍兴网站建设企业
  • 网站建设 教学论文wordpress设计类网站
  • 像芥末堆做内容的网站网站图片设置
  • 深圳高端品牌网站建设百度能收录的免费网站
  • 泰州做房产的网站郑州网站建设找哪家
  • html5网站制作分工珠海编程培训机构
  • 自做网站图片版权游戏网站模
  • 集成wamp访问域名打开tp做的网站马来西亚做网站
  • 旅游网站建设策划方案书网站安全建设思考
  • 网站制作宜昌怎么做?有了虚拟主机怎么做网站
  • vue做直播网站青岛定制网站建设推广
  • 简述网站开发的工作流程在线做GO分析的网站
  • 佛山有哪些建设网站的公司什么网站是php做的
  • 怎么查询网站空间商网站设计费用一览表
  • 河南省建设厅网站中级职称胖小七网站建设
  • 宁波网站建设 华企立方互联网营销培训课程
  • 萍乡企业网站制作收益网站制作
  • 网站建设 资质荣誉东莞建网页
  • 网站如何换空间html旅游网页设计代码
  • 网站建设文件夹结构wordpress adsense主题
  • 无锡定制公司网站做影视网站如何加速
  • 佛山格尔做网站的公司科技股份公司网站模板
  • 财务公司网站源码连城县住房和城乡建设局 网站
  • 网站下载app免费安全在seo优化中