QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#565746#5381. Cryptographer's ConundrumNafeeszxAC ✓0ms3872kbC++20760b2024-09-15 22:08:352024-09-15 22:08:36

Judging History

你现在查看的是最新测评结果

  • [2024-09-15 22:08:36]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3872kb
  • [2024-09-15 22:08:35]
  • 提交

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;
}   

詳細信息

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'