随笔分类 -  CodeForces

摘要:A.一道模拟题 #include <bits/stdc++.h> using namespace std; typedef long long ll; int main () { int T; cin >> T; while(T--) { int n; cin >> n; std::vector<l 阅读全文
posted @ 2021-03-14 11:19 LightAc 阅读(107) 评论(0) 推荐(0)
摘要:#include<bits/stdc++.h> using namespace std; int main () { int t; cin >> t; while(t--) { int n, k; cin >> n >> k; string s; cin >> s; if(k == 0) { cou 阅读全文
posted @ 2021-03-10 23:11 LightAc 阅读(114) 评论(0) 推荐(0)
摘要:A 题目链接: https://codeforces.com/contest/1459/problem/A 解题思路: 从本质上来讲,这是一道概率题。对应位置上,数字的权重是一样的,所以如果对应位置上前者比后者大,那么对于所有的全排列情况来说,前者大的情况的比例会加上1。最后只需要比较,哪个数对应位 阅读全文
posted @ 2020-12-20 10:19 LightAc 阅读(107) 评论(0) 推荐(1)
摘要:白给题 #include <bits/stdc++.h> using namespace std; int main () { string s; int num; cin >> num; while(num--) { cin >> s; cout << s.size() << endl; } } 阅读全文
posted @ 2020-12-01 11:10 LightAc 阅读(91) 评论(0) 推荐(0)
摘要:A. Marketing Scheme #include <bits/stdc++.h> using namespace std; int main () { int t; cin >> t; while(t--) { int l, r; cin >> l >> r; if(r <= 2 * l - 阅读全文
posted @ 2020-10-31 10:34 LightAc 阅读(79) 评论(0) 推荐(0)
摘要:题目链接:http://codeforces.com/contest/1422 A题 签到题 #include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MODE = 1e9 + 7; string s; 阅读全文
posted @ 2020-10-05 10:21 LightAc 阅读(414) 评论(6) 推荐(2)
摘要:A题 #include <bits/stdc++.h> using namespace std; int main () { int t; cin >> t; while(t--) { int n, x; cin >> n >> x; int ans = 0; for(int i = 0; i < 阅读全文
posted @ 2020-09-29 11:02 LightAc 阅读(194) 评论(0) 推荐(0)
摘要:A题 思路:取出最小值,所有数加到最小值的最大倍数使得不超过k 记录次数即可 #include <bits/stdc++.h> using namespace std; int main () { int T; cin >> T; while(T--) { int n, k; cin >> n >> 阅读全文
posted @ 2020-09-29 11:00 LightAc 阅读(157) 评论(0) 推荐(0)
摘要:A题 容易题。只有严格单调递减情况是NO因为需要n*(n-1)/2次。其余都行 #include <bits/stdc++.h> using namespace std; int main () { int t; cin >> t; while(t--) { int n; cin >> n; vec 阅读全文
posted @ 2020-09-25 11:45 LightAc 阅读(197) 评论(0) 推荐(0)
摘要:比赛链接:http://codeforces.com/contest/1419 A题 题意: 简单博弈论。运用数学知识分析出规律:如果总数是奇数时,最后剩下的一定是位置为奇数位置对应的值。(如果想不明白建议模拟一下过程)在这种情况下,Raze可以选择剩下哪一个,所以如果存在奇数位置存在数为奇数,Ra 阅读全文
posted @ 2020-09-23 21:22 LightAc 阅读(186) 评论(0) 推荐(0)
摘要:题目地址:https://codeforces.com/contest/1358 A. #include <bits/stdc++.h> using namespace std; int main () { int t; cin >> t; while(t--) { int n, m; cin >> 阅读全文
posted @ 2020-05-27 08:59 LightAc 阅读(235) 评论(0) 推荐(0)
摘要:题目链接:https://codeforces.com/contest/1360 /* A题 creat by dzz */ #include <bits/stdc++.h> using namespace std; int main () { int T; cin >> T; while(T--) 阅读全文
posted @ 2020-05-25 09:45 LightAc 阅读(256) 评论(0) 推荐(0)
摘要:A. #include <bits/stdc++.h> using namespace std; typedef long long ll; int main () { ios::sync_with_stdio(false); cin.tie(0); int t; cin >> t; while(t 阅读全文
posted @ 2020-05-19 23:03 LightAc 阅读(183) 评论(0) 推荐(0)
摘要:白给题1 #include <bits/stdc++.h> using namespace std; typedef long long ll; int main () { ios::sync_with_stdio(false); cin.tie(0); int t; cin >> t; while 阅读全文
posted @ 2020-04-27 17:17 LightAc 阅读(199) 评论(1) 推荐(0)
摘要:白给题1 #include <bits/stdc++.h> using namespace std; int main () { ios::sync_with_stdio(false); cin.tie(0); int t; cin >> t; while(t--) { int n; cin >> 阅读全文
posted @ 2020-04-22 10:02 LightAc 阅读(334) 评论(0) 推荐(0)
摘要:A题 模拟过程考查对临界条件的判断 #include<bits/stdc++.h> using namespace std; int main() { int T; cin >> T; while (T--) { int A, B, C, D; cin >> A >> B >> C >> D; in 阅读全文
posted @ 2020-04-01 09:30 LightAc 阅读(209) 评论(0) 推荐(0)
摘要:A. 签到题:思路为:所求答案 = 9 * (字符长度 - 1) + 最高位数 +(- 1)//通过判断语言确定是否需要再减个一 如果a****** > *******则需要加一反之不需要 #include <bits/stdc++.h> using namespace std; typedef l 阅读全文
posted @ 2019-12-14 23:47 LightAc 阅读(179) 评论(0) 推荐(0)
摘要:比赛网址: http://codeforces.com/contest/1196 Example Input 41 3 41 10 10010000000000000000 10000000000000000 1000000000000000023 34 45Output 4551500000000 阅读全文
posted @ 2019-07-25 20:10 LightAc 阅读(194) 评论(0) 推荐(0)
摘要:#include<iostream> #include<iomanip> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> #include<queue> #include<stack> #include<v 阅读全文
posted @ 2019-04-10 14:49 LightAc 阅读(164) 评论(0) 推荐(0)
摘要:A. Example Input 91 3 3 6 7 6 8 8 9Output 4 1 #include <iostream> 2 3 using namespace std; 4 5 int main () { 6 int n; 7 cin >> n; 8 int a[10010]; 9 fo 阅读全文
posted @ 2019-03-23 16:29 LightAc 阅读(237) 评论(0) 推荐(0)

返回顶端