题目总链接:https://codeforces.com/contest/1096 A. Find Divisible 题意: 给出l,r,在[l,r]里面找两个数x,y,使得y%x==0,保证有解. 题解: 直接输出l,2*l就好啦,但我还是写了个循环... 代码如下: #include <bits/stdc++.h> using namespace std; typedef long long ll; ; int T; ll l,r; int main(){ cin>>T; w…
https://codeforces.com/contest/1096/problem/D 题意 给一个串s,删掉一个字符的代价为a[i],问使得s的子串不含"hard"的最小代价 题解 定义\(dp[i][j]\)为到第i位下一个将要匹配j的最小代价 \(若s[i]==t[j]\) 删掉:\(min(dp[i+1][j],dp[i][j]+a[i])\) 不删,若j<3:\(min(dp[i+1][j+1],dp[i][j])\) \(若s[i]!=t[j]\) 不用删:\(m…
https://codeforces.com/contest/1096/problem/C 题意 问是否存在一正多边形内三点构成的角度数为ang,若存在输出最小边数 题解 三点构成的角是个圆周角,假设n为多边形边数,则能构成的角范围是\(\frac{180}{n} \leq ang \leq \frac{n-2}{n}*180\),每次变化\(\frac{180}{n}\) 首先明确正多边形一定存在,并且最大边数不会超过360,若边数等于360,则可以组成的角的范围是\(0.5\leq ang…
我好菜啊. A - Find Divisible 好像没什么可说的. #include<cstdio> #include<cstring> #include<algorithm> #include<queue> #include<set> #include<map> #include<vector> #include<cmath> #include<cctype> using namespace s…
#include<bits/stdc++.h>using namespace std;char s[100007];long long a[100007];long long dp[100007][4];int main(){    int n;    scanf("%d",&n);    scanf("%s",s);    for(int i=0;i<n;i++)        scanf("%lld",&a[…
感慨 最终就做出来一个题,第二题差一点公式想错了,又是一波掉分,不过我相信我一定能爬上去的 A Find Divisible(思维) 上来就T了,后来直接想到了题解的O(1)解法,直接输出左边界和左边界*2即可 代码 #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long x,y,t; cin>>t;…
Educational Codeforces Round 71 (Rated for Div. 2)-E. XOR Guessing-交互题 [Problem Description] ​ 总共两次询问,每次询问给出\(100\)个不同的数,评测系统对于每次询问,随机从\(100\)个数中选择一个数\(a\),返回\(x\oplus a\).让你通过两次返回的值猜出\(x\)值是多少.要求两次询问的\(200\)个数互不相同,且题目保证\(x\)值固定不变. [Solution] ​ 题目要求所…
Problem   Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec Problem Description Input Output The only line should contain the minimal number of days required for the ship to reach the point (x2,y2)(x2,y2). If it…
Problem   Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec Problem Description Input The input contains a single line consisting of 2 integers N and M (1≤N≤10^18, 2≤M≤100). Output Print one integer, the total n…
Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include<bits/stdc++.h> using namespace std; #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 #define IT set<ll>::iterator #define sqr(x)…