QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#665077 | #5599. Repetitive Song | enze114514 | WA | 51ms | 14704kb | C++20 | 906b | 2024-10-22 02:17:12 | 2024-10-22 02:17:12 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define pb push_back
const ld pi = 3.14159265358979323846;
const ll INF = 1e18;
const int mod = (int)1e9 + 7;
template<typename T>
T chmax(T a, T b) {
return a > b ? a : b;
}
template<typename T>
T chmin(T a, T b) {
return a > b ? b : a;
}
const int N = 3e3 + 1, M = N * 2;
void solve() {
int n;
cin >> n;
map<string, int> mp;
int d = (int)1e9;
for(int i = 0; i < n; i++){
string s;
cin >> s;
if(mp.count(s)){
d = chmin(d, i - mp[s]);
}
mp[s] = i;
}
cout << n - d << endl;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t = 1;
// cin >> t;
while (t--) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3576kb
input:
10 bow bow chick chicka chicka bow bow chick chicka chicka
output:
9
result:
ok single line: '9'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
31 head shoulders knees and toes knees and toes head shoulders knees and toes knees and toes eyes and ears and mouth and nose head shoulders knees and toes knees and toes
output:
29
result:
ok single line: '29'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
297 sitting on a park bench eyeing little girls with bad intent snots running down his nose greasy fingers smearing shabby clothes hey aqualung drying in the cold sun watching as the frilly panties run hey aqualung feeling like a dead duck spitting out pieces of his broken luck oh aqualung sun strea...
output:
296
result:
ok single line: '296'
Test #4:
score: 0
Accepted
time: 6ms
memory: 3772kb
input:
100000 down up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up ...
output:
99999
result:
ok single line: '99999'
Test #5:
score: 0
Accepted
time: 51ms
memory: 14704kb
input:
100000 bigone aaaaaaaaaaaaaaaaaaaa baaaaaaaaaaaaaaaaaaa caaaaaaaaaaaaaaaaaaa daaaaaaaaaaaaaaaaaaa eaaaaaaaaaaaaaaaaaaa faaaaaaaaaaaaaaaaaaa gaaaaaaaaaaaaaaaaaaa haaaaaaaaaaaaaaaaaaa iaaaaaaaaaaaaaaaaaaa jaaaaaaaaaaaaaaaaaaa kaaaaaaaaaaaaaaaaaaa laaaaaaaaaaaaaaaaaaa maaaaaaaaaaaaaaaaaaa naaaaaaaaaaaa...
output:
1
result:
ok single line: '1'
Test #6:
score: 0
Accepted
time: 1ms
memory: 3544kb
input:
824 really dont mind if you sit this one out my words but a whisper your deafness a shout i may make you feel but i cant make you think your sperms in the gutter your loves in the sink so you ride yourselves over the fields and you make all your animal deals and your wise men dont know how it feels ...
output:
823
result:
ok single line: '823'
Test #7:
score: 0
Accepted
time: 32ms
memory: 4268kb
input:
100000 the iliad by homer as translated by samuel butler 1898 scroll 1 sing o goddess the anger did it send hurrying down to hades and many a hero did it yield a prey to dogs and vultures for so was the will of zeus fulfilled from the day on which the son of atreus king of men and great achilles fir...
output:
99999
result:
ok single line: '99999'
Test #8:
score: -100
Wrong Answer
time: 0ms
memory: 3604kb
input:
1 onelongwordtestcasea
output:
-999999999
result:
wrong answer 1st lines differ - expected: '0', found: '-999999999'