A. New Year Garland time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarp is sad — New Year is coming in few days but there is still no snow in his city. To bring himself New Year mood,…
#include <bits/stdc++.h>using namespace std;const long long mod = 1e9+7;unordered_map<long long,long long>mp;long long n,m;long long dp(long long n){ if(n<0) return 0; if(n<m) return 1; if(mp.find(n)!=mp.end())//已经…
#include<bits/stdc++.h>typedef long long ll;const int inf=0x3f3f3f3f;using namespace std;char b[507];int dp[507][507];int main(){ memset(dp,0x3f,sizeof(dp)); int n; scanf("%d",&n); scanf("%s",b+1); for(int i=1;…