Submission #998573

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9985732024-06-14 08:59:04SharkyCopy and Paste 3 (JOI22_copypaste3)C++17
100 / 100
947 ms160888 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 2502;
const int B = 5000011;
const int M1 = 1000000007;
const int M2 = 998244353;
int prv[N][N], nxt[N][N], h1[N][N], h2[N][N], dp[N][N];
int cv(char c) { return (c - 'a' + 1); }
bool same(int l, int r, int x) {
return (h1[l][l + x] == h1[r][r + x] && h2[l][l + x] == h2[r][r + x]);
}
int32_t main() {
ios::sync_with_stdio(0); cin.tie(0);
int n, a, b, c;
string s;
cin >> n >> s >> a >> b >> c;
s = "?" + s;
for (int i = 0; i < N; i++) for (int j = 0; j < N; j++) dp[i][j] = 1e18;
for (int i = 1; i <= n; i++) {
h1[i][i] = h2[i][i] = cv(s[i]);
dp[i][i] = a;
}
for (int itvl = 1; itvl <= n - 1; itvl++) {
for (int i = 1; i + itvl <= n; i++) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

copypaste3.cpp: In function 'int32_t main()':
copypaste3.cpp:52:31: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   52 |             for (int j = 1; j < v.size(); j++) {
      |                             ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...