C. Playlist time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You have a playlist consisting of nn songs. The ii-th song is characterized by two numbers titi and bibi — its length and beauty…
#include<bits/stdc++.h>using namespace std;const long long mod=998244353;long long f[200007][2],g[200007][2];long long a[200007],b[200007],c[200007];int n,k,cnt1,cnt2;long long qpow(long long a,long long p){ long long ans=1; while(p){ i…
从这里开始 小结 题目列表 Problem A Diagonal Walking Problem B String Typing Problem C Matrix Walk Problem D Fight Against Traffic Problem E Water Taps Problem F Runner's Problem Problem G Castle Defense Problem H Path Counting Problem I Yet Another String Match…
A - Minimizing the String solved 题意:给出一个字符串,可以移掉最多一个字符,在所有可能性中选取一个字典序最小的. 思路:显然,一定可以移掉一个字符,如果移掉的字符的后一个字符大于当前字符,那么字典序会变大. 那只需要从左往右,遇到第一个后面的字符大于当前字符的就可以移掉该字符. #include <bits/stdc++.h> using namespace std; #define N 200010 int n; char s[N]; int main()…
A. Vasya and Book Solved. 三种方式取$Min$ #include <bits/stdc++.h> using namespace std; #define ll long long #define INF 0x3f3f3f3f3f3f3f3f int t; ll n, x, y, d; ll calc(ll x) { ? x / d : x / d + ; } int main() { scanf("%d", &t); while (t--…