摘要: A. Round Down the Price 题意: 给一个数n,要求找到离这个数最近的10的幂次。然后输出两者差值 思路:看了下数据范围,1e9,直接枚举就好了。从1e9开始,如果大于n就除10,否则就停止,相减即可 解决代码: void solve() { int n; cin >> n; i 阅读全文
posted @ 2022-07-12 21:51 nobodyL 阅读(40) 评论(0) 推荐(0)
摘要: A. Grass Field 解决代码: void solve() { int a, b, c, d; cin >> a >> b >>c >>d; int cnt = 0; cnt = a + b +c + d; if(cnt == 0) cout << 0 << endl; else if(cn 阅读全文
posted @ 2022-07-10 11:18 nobodyL 阅读(66) 评论(0) 推荐(0)
摘要: 900——1000 5道 A. Anti Light's Cell Guessing 题意大概是在一个行列确定的坐标系里,最少用几个点可以唯一确定一个点 思路就是判断行列的最小值是否为1,是1的话,最多一个点就可以确定,否则两个点即可。 注意:1*1的方格需要的点是0,故需要特判 解决代码: voi 阅读全文
posted @ 2022-07-08 18:22 nobodyL 阅读(22) 评论(0) 推荐(0)
摘要: A~C A 水题。对两组数据排序之后,比较最大值。 最大值较大的那个人总会赢,当最大值相同时,谁先出牌谁赢 void solve() { int n, m; cin >>n; for(int i = 1; i <= n ;i ++) cin >> a[i]; cin >> m; for(int i 阅读全文
posted @ 2022-05-26 23:37 nobodyL 阅读(19) 评论(0) 推荐(0)
摘要: A~D A 思路:假如不是两位数,那么一定可以找到最大的那个数,直接输出即可。如果是两位数,那就是第二位的数字 void solve() { string st; cin >> st; int lens = st.size(); if(lens == 2) { cout << st[1] << en 阅读全文
posted @ 2022-05-22 20:59 nobodyL 阅读(41) 评论(0) 推荐(0)
摘要: ABC ac代码加补题 A题 #include <iostream> #include <string> #include <cstring> #include <algorithm> #include <cmath> #include <set> #include <queue> #include 阅读全文
posted @ 2022-05-15 20:59 nobodyL 阅读(28) 评论(0) 推荐(0)
摘要: 补题 A题 思路 这题写的时候没想清楚,其实就是解4x + 6y = n ~~一开始没想清楚输出-1的情况,导致后面wa了一堆,还以为是题目问题~~ 输出-1的情况就是n为奇数,或者n小于4的情况 若不输出-1,则最大是n/4辆,最小按理说是n/6辆,但是因为不能没有,所以$(n + 4)/6$,保 阅读全文
posted @ 2022-05-15 20:09 nobodyL 阅读(21) 评论(0) 推荐(0)