QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#336655#6616. Edward Gaming, the Champion552Hz#WA 0ms3700kbC++141.8kb2024-02-24 18:45:092024-02-24 18:45:09

Judging History

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

  • [2024-02-24 18:45:09]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3700kb
  • [2024-02-24 18:45:09]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
const int N=200010;
const ll mod=998244353;
//const ll mod=1e9+7;
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define per(i,a,n) for (int i=n;i>=a;i--)
#define vi vector <int>
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define sz(a) ((int) (a).size())
#define me(f, x) memset(f, x, sizeof(f))
#define uint unsigned int
#define ull unsigned long long 
#define i128 __int128
#define pb emplace_back
#define pii pair<int,int>
#define debug(x) std::cout<<x<<endl
#define endl '\n'
#define mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
template<typename type>
inline void read(type &x)
{
    x=0;bool flag(0);char ch=getchar();
    while(!isdigit(ch)) flag=ch=='-',ch=getchar();
    while(isdigit(ch)) x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
    flag?x=-x:0;
}
template<typename type>
inline void write(type x,bool mode=1)//0为空格,1为换行
{
    x<0?x=-x,putchar('-'):0;static short Stack[50],top(0);
    do Stack[++top]=x%10,x/=10; while(x);
    while(top) putchar(Stack[top--]|48);
    mode?putchar('\n'):putchar(' ');
}
//head~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//begin~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//end~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
string s;
string pos="edgnb";
void solve(){
	cin>>s;
	ll cnt=0,ptr=0;
	for(auto v:s){
		if(v==pos[ptr]){
			ptr++;
		}else{
			ptr=0;
		}
		if(ptr==5){
			cnt++;
			ptr=0;
		}
	}
	cout<<cnt;
}


int main() 
{
	std::ios::sync_with_stdio(false);
	cin.tie(0); 
	cout.tie(0);
	int _=1;
	while(_--){
		solve();
	}
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3552kb

input:

edgnb

output:

1

result:

ok 1 number(s): "1"

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3700kb

input:

zvyialcqxheifpykfedliuoyzcjhlnrfiptqfrydtcczdpfkjxcauuaqzypyerpykxwqlpzblevnfyijtjrvkxqgekfivkdotqhytdxliwyzvmrhvpkrtfxdprldadpbqubhuongrnadywckhgesbfxvnuwmrrxlxwnzrwlyihgaprtyddmkiuhhhkjxfffiztbbhwialvooqkgvwjpxhxbhuqowmrxtgskhaabmkehbnshvswaxgvqtzfkdkixtqahjwdowubpdqeovrvrubarblkuuredcacccamoswpwq...

output:

2840

result:

wrong answer 1st numbers differ - expected: '2841', found: '2840'