結果
| 問題 | No.3637 PANDORA |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-25 14:21:53 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 938 bytes |
| 記録 | |
| コンパイル時間 | 2,720 ms |
| コンパイル使用メモリ | 364,424 KB |
| 実行使用メモリ | 13,312 KB |
| 最終ジャッジ日時 | 2026-08-25 14:22:10 |
| 合計ジャッジ時間 | 10,248 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| サンプル | 0 % | AC * 2 |
| 小課題1 | 5 % | WA * 4 |
| 小課題2 | 10 % | WA * 4 |
| 小課題3 | 5 % | WA * 8 |
| 小課題4 | 10 % | WA * 5 |
| 小課題5 | 20 % | WA * 10 |
| 小課題6 | 20 % | AC * 2 WA * 14 |
| 小課題7 | 30 % | AC * 6 WA * 32 |
| 合計 | 0 点 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
string c;
cin>>c;
map<char,set<int> > d;
for(int i=0;i<a;i++){
if(d.count(c.at(i))){
d.at(c.at(i)).insert(i);
}
else{
set<int> s;
s.insert(i);
d[c.at(i)]=s;
}
}
for(int i=0;i<b;i++){
int e;
cin>>e;
if(e==1){
int f;
char g;
cin>>f;
cin>>g;
d.at(c.at(f-1)).erase(f-1);
c.at(f-1)=g;
if(d.count(g)){
d.at(g).insert(f-1);
}
else{
set<int> s;
s.insert(f-1);
d[g]=s;
}
}
else{
string h;
cin>>h;
int n=0;
bool an=true;
for(int j=0;j<h.size();j++){
if(!d.count(h.at(j))||d.at(h.at(j)).size()==0){
cout<<"No"<<endl;
n=false;
break;
}
for(int k:d.at(h.at(j))){
if(k>=n){
n=k;
break;
}
}
if(c.at(n)!=h.at(j)){
cout<<"No"<<endl;
n=false;
break;
}
}
if(n){
cout<<"Yes"<<endl;
}
}
}
}