一个简单的模拟,首先先计算当前是几位数,然后根据几位数推断当前的数是什么,然后求出该位即可 #include <cstdio> int main(){ long long k; scanf("%lld", &k); long long cur = 1, cnt = 9; while (cur * cnt < k){k -= cur * cnt; cnt *= 10, ++cur;} long long mod = k % cur, a = (k - 1) /…
http://codeforces.com/problemset/problem/1216/E1 E1. Numerical Sequence (easy version) time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The only difference between the easy and the hard ver…
The only difference between the easy and the hard versions is the maximum value of \(k\). You are given an infinite sequence of form "112123123412345-" which consist of blocks of all consecutive positive integers written one after another. The f…
感觉自己有点强迫症 不都写出来就找理由不写题解 http://codeforces.com/contest/1015 题目链接 A. Points in Segments 题目意思 n个线段 去覆盖1-m 中的点 问你没有覆盖的点的个数和位置 这个数据很小,可以直接暴力查找 思考:如果n<1e6, m<=1e8 呢? #include<bits/stdc++.h> #define int long long #define MAX(a,b,c) max(a,max(b,c)…
E1. Stars Drawing (Easy Edition) time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output A star is a figure of the following type: an asterisk character '*' in the center of the figure and four ra…
A - Points in Segments 题意:implement #include<bits/stdc++.h> using namespace std; typedef long long ll; bool vis[105]; int ans[105], atop; void test_case() { int n, m; scanf("%d%d", &n, &m); while(n--) { int u, v; scanf("%d%d&q…
A. Digits Sequence Dividing 注意特殊情况,在\(n = 2\)时除非\(str[1] >= str[2]\),否则可以把第一个数划分下来,剩下的数直接当成一组,一定满足条件. #include <cstdio> #include <iostream> #include <string> using namespace std; const int N = 310; int n; char s[N]; int main(){ int T;…
一.Description A numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequence of the given numeric sequence (a1, a2, ..., aN) be any sequence (ai1, ai2, ..., aiK), where 1 <= i1 < i2 < ... < iK <= N. For example, seq…
C. Mike and gcd problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mike has a sequence A = [a1, a2, ..., an] of length n. He considers the sequence B = [b1, b2, ..., bn] beautiful if…
目录 Contest Info Solutions A. Drinks Choosing B. Sport Mafia C. Basketball Exercise D1. Submarine in the Rybinsk Sea (easy edition) D2. Submarine in the Rybinsk Sea (hard edition) E. OpenStreetMap Contest Info Practice Link Solved A B C D1 D2 E F 6/7…
题目链接:http://codeforces.com/contest/1163 A .Eating Soup sol:在n / 2.n - m.m三个数中取最小值,结果受这三个值限制.但是m == 0的情况需要特判 思维 #include "bits/stdc++.h" using namespace std; int main() { int n, m; scanf("%d%d", &n, &m); ) {puts(;} printf(, min(…
比赛链接:https://codeforces.com/contest/1440 A. Buy the String 题解 枚举字符串中 \(0\) 或 \(1\) 的个数即可. 代码 #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while (t--) { int n, c0, c1…