A. Dice Rolling 签到. #include <bits/stdc++.h> using namespace std; int t, n; int main() { scanf("%d", &t); while (t--) { scanf("%d", &n); ) puts("); else { ; res += n / ; printf(); } } ; } B. Letters Rearranging 签到. #…
传送门:http://codeforces.com/contest/1093/problem/D D. Beautiful Graph time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given an undirected unweighted graph consisting of nn vertices a…
题目链接:https://codeforces.com/contest/1093 A. Dice Rolling 题意: 有一个号数为2-7的骰子,现在有一个人他想扔到几就能扔到几,现在问需要扔多少次,能使扔出的总和等于xi. 题解: 由于是special judge,模拟一下搞搞就行了= = 代码如下: #include <bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; int n; while(t--…
F - Vasya and Array dp[ i ][ j ] 表示用了前 i 个数字并且最后一个数字是 j 的方案数. dp[ i ][ j ] = sumdp [i - 1 ][ j ], 这样的话会有不合法的方案算进去,而且不合法的方案只有 i - len + 1 到 i 这一段相同才会 出现, 所以如果 i - len + 1 到 i 可以变成一样的话要减去 sumdp[ i - len ] - dp[ i - len ][ j ] #include<bits/stdc++.h> #…
A. Minimum Integer 签到. #include <bits/stdc++.h> using namespace std; #define ll long long ll l, r, d; int main() { int t; scanf("%d", &t); while (t--) { scanf("%lld%lld%lld", &l, &r, &d); if (d < l) printf(&quo…