QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#565746 | #5381. Cryptographer's Conundrum | Nafeeszx | AC ✓ | 0ms | 3872kb | C++20 | 760b | 2024-09-15 22:08:35 | 2024-09-15 22:08:36 |
Judging History
answer
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define trav(a, x) for(auto& a : x)
#define FOR(i, a, b) for (int i=(a); i<=(signed)(b); i++)
#define ROF(i, a, b) for (int i=(a); i>=(signed)(b); i--)
#define F0R(i, a) for (int i=0; i<(signed)(a); i++)
#define vi vector<int>
#define f first
#define s second
#define all(v) (v).begin(), (v).end()
typedef long long ll;
using P = pair<int, int>;
const ll mod = 998244353;
const char c[] = {'P', 'E', 'R'};
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
string s; cin >> s;
int ans = 0;
F0R(i, s.size()) {
if(s[i] != c[i%3]) ans++;
}
cout << ans << '\n';
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3572kb
input:
SECRET
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
HEZIOLUFDSRRPCRQETPEQWEKPFY
output:
18
result:
ok single line: '18'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
PEYYJLVERYERSJFVERYEEPED
output:
13
result:
ok single line: '13'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
PDRGERPERFERPERPERPEXPEHSQGPWRNERMERPBRPERPERDEIVYRPEREER
output:
17
result:
ok single line: '17'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3872kb
input:
EXUHPLXQNRRQIMYTKREEUWBRRSAKSYAIAWOR
output:
32
result:
ok single line: '32'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
PERWERUDSPKRYERPJRGERPURSEFWEVFERSMRPTTYDYPCRPEYPKXPORPPYBPRYWREWRPERFIKSEIPVRRERPCSPZNPWRRRBPEEEERPERPEHPUEEEGPEOFMQAKARERHYRYEHPERPEROERCEBYEBPPNEERPXRPEROCRUEEMER
output:
82
result:
ok single line: '82'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
PERPYRPBNPERESRPERPESRERPERPERPEFPQRPUAPMRPERPPYXIWAEWPWYPTRPERPZRPEJOEFKERPSPPERPVRPBRRERPEDPEESEOOERPERPRRPHRPEPYRRPERIEDPERPERPCTPERAKLPERIARPURMEOVEGUNWPERPERPMRPERPEQPCRPERPYRPERNFJXERRERPETPELPERPERPERPERMERPJRPWRPERPEROERDERPDRPERILHDERPERPERPERPEZKERMERPRRPERNECPENOERPWRPERTVYPERBICPERPEVPER
output:
96
result:
ok single line: '96'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3868kb
input:
PERPERPSRPERPERIERPERPERPERPERPERPEUPEVPERPIRPERPERBERPERPERPERHERPERLEKPERPERPEJPERPEPPHRPERPEIPERPERPERPERPEXPERPWRPERPERPERPERPERNBRPENPEVPERPERPERPERPERPERPDRPIRPER
output:
21
result:
ok single line: '21'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3872kb
input:
PERUERPERPEFPERPERPERPERUZRPERPECPERPEWPERPERPERPEQPERPERPERPPRPERRERPERPERPSRPERPERPERPERPHRJERPEPPERPERPERPERPMRPERPERPERPERPERPERPERPERPESPERPERPKRCERPERPERPERPERPERPERPERVEREEBPERPERPTEPERPERPERPERPERPELPEQPERPERPERPERZERPERPERPERPERPERPERPERPERPERPERPERPERPURPERPERPERPERPERPERPERPERPERPERPERPER
output:
26
result:
ok single line: '26'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
PERPEJIERPERLERAEGPEQPOBPERPERPIRPERPERPERPERDGSPERHERPERAERPERPERPEPXQRPERPMRBERTERPERXERPYRPLRPVRPERPERUERPARUERPEQPEQPEXPTRPERQNRRIRLERPERXEUPBRUHRPEROERPERPEPPERTFRZERPSRQERHERCQRPARPUKPERIERPLRPGYPEVPERAJRPWRHERPERPQRPVRPVRPECPELPERPZRBWLPEVPERLERPBRUEQWERPEUQERPTRPSWPELPERPDVWPXPERVARVWBPERPBR
output:
95
result:
ok single line: '95'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
PERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERKERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERHERPERPERPERPEROERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPEBPERPERPERPERPHRPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPERPER
output:
5
result:
ok single line: '5'