ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#213972 | #2739. 阿空的核聚变 | erican | 60 | 120ms | 1220kb | C++11 | 1.5kb | 2024-11-14 20:40:06 | 2024-11-14 23:06:12 |
answer
// Problem: D. 阿空的核聚变
// Contest: undefined - NOIP2024训练赛 05
// URL: http://noi.ac/contest/1157/problem/2739
// Memory Limit: 1024 MB
// Time Limit: 1000 ms
// Challenger: Erica N
// ----
//
#include<bits/stdc++.h>
using namespace std;
#define rd read()
#define ull unsigned long long
#define int long long
#define pb push_back
#define itn int
#define ps second
#define pf first
#define rd read()
int read(){
int xx = 0, ff = 1;char ch = getchar();
while (ch < '0' || ch > '9'){
if (ch == '-')ff = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9')xx = xx * 10 + (ch - '0'), ch = getchar();
return xx * ff;
}
#define zerol = 1
#ifdef zerol
#define cdbg(x...) do { cerr << #x << " -> "; err(x); } while (0)
void err() {cerr << endl;}
template<template<typename...> class T, typename t, typename... A>
void err(T<t> a, A... x) {
for (auto v: a) cerr << v << ' ';err(x...);
}
template<typename T, typename... A>
void err(T a, A... x) {
cerr << a << ' ';err(x...);
}
#else
#define dbg(...)
#endif
const int N=2e5+5;
const ull P=137;
const int INF=1e18+7;
/*
策略
*/
char stk[N];
int top;
string s;
signed main(){
cin>>s;
int n=s.size();
s=" " +s;
int q=rd;
while(q--){
int l=rd,r=rd;
top=0;
for(int i=l;i<=r;i++){
stk[++top]=s[i];
while(top>1&&stk[top]==stk[top-1]){
char c=stk[top];
top-=2;
if(c!='z')stk[++top]=c+1;
}
}
if(!top)puts("Yes");
else puts("No");
}
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 2ms
memory: 1212kb
input:
wwwwyyyvttttutsrqquuusstttuvutrrsvvwxvvwvvvvwuuvwvvwwuuurrssswywvvwvurrstxwvvxxxxxxyzvvvssrrsttvuuwy...
output:
No No No No No No No No Yes No No No No No No No No No No No No No No No No No No No No No No No No ...
result:
ok 3000 lines
Test #2:
score: 10
Accepted
time: 0ms
memory: 1212kb
input:
wvvvvwwttuvwwyyxxwvvwwzywvttuusstuuwyyywwxyywvuttuuuttwxwwyyyxxzzxxxwvuuyyyyzvvvvwvvvvwwwztssuuuwwwy...
output:
No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No Y...
result:
ok 3000 lines
Test #3:
score: 10
Accepted
time: 0ms
memory: 1208kb
input:
zywwxyyzyyvuttwvvwxutssvuuvyyzzyxxyxxzzyyxxyxxxxzyxxwuuvwwxwwyxxyvvttuvxyyyxxyyyyyxxyyxwwxxyyyvuuwww...
output:
No No No No No No No No No No No No No No No No Yes No No No No No No No No No No No No No No No No ...
result:
ok 3000 lines
Test #4:
score: 10
Accepted
time: 32ms
memory: 1216kb
input:
zzzyywwxyzxxyzyyzzyyyyzyyzyxxzzzzyyyyyxxyyzzyxxzzyyzzzyyzyyzzzzyyyyzzzxwwwwxzzzzyyzxxyyyzzyyyyyyzzzy...
output:
No No No Yes No Yes No No Yes No Yes No No No No No No Yes No No No No No No No No No No Yes No No N...
result:
ok 3000 lines
Test #5:
score: 10
Accepted
time: 43ms
memory: 1216kb
input:
yxxyxxzzyyxxyyxxxxxxxwvuuxvvwyyxxxxyyyyxxwwxzyxxyxxyyyxwvuttywvvxxxywwxywwxxwuuuuzxxyxwwxvvwwuuvxyww...
output:
No Yes No No No No No No No No No No No No No No No No Yes No No No No No No No No No No No No No No...
result:
ok 3000 lines
Test #6:
score: 10
Accepted
time: 43ms
memory: 1220kb
input:
xxyywvvxyuuuuvvwwxxxttuvvvzvvwwwyyywwsstuuttvvwvttuwvurrrrsqqrxxvvttttvxuuvwvusstvvxwwyxxzzxwwxutsss...
output:
No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No N...
result:
ok 3000 lines
Test #7:
score: 0
Time Limit Exceeded
input:
yyzzzyyzzzyyzzzzyzzyyzyyzzyzzyzzzzyyzyyzzyzyzyyzyzyzzzzzzyzzyzzzyyyzyyzzyyyzzyzyyzzzyyzyyzzzyzyzyzyy...
output:
No Yes No No Yes No No No No No No No No No No No No No No No No No No No No No No No No No No No No...
result:
Test #8:
score: 0
Time Limit Exceeded
input:
yzzzzyzzyyzyzzzyyyzyyzyzzzyzyzzzzzzzyyyzyyzyzzzzyzzyyyyyzyyzyzyyzzzyzzyzzyzzzzzyyzyyyyyzyyyzzyzyzzyy...
output:
No No No No No No No No No No No No No No No No No No No No No No No No No No Yes No Yes Yes No No N...
result:
Test #9:
score: 0
Time Limit Exceeded
input:
yyyyxxyzxxxxxxwvuuvvwzxxwwvuuvuuxutssvutssuttxxyxxxvvttuvxxywwxxwwyywwxyyywwxzyxwwxxywwwwyyyywwxyyvv...
output:
No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No N...
result:
Test #10:
score: 0
Time Limit Exceeded
input:
ywwxyyxxyzzzyxxyyyyzzzzzzyyzzyxxzzyyyxxzzzywwxzzyyzwwxxwwyyzyyzzzyyzyyyxwwyxxyyzyyyxxyyzyxxyyzzywwxw...
output:
No No No No No No No No Yes No No No No No Yes No No Yes No No No Yes No No No No Yes No No No No No...