mirror of
https://gitcode.com/Zengtudor/alg2025.git
synced 2025-12-17 04:33:02 +00:00
refactor(P3879.cpp): 显式声明迭代器类型以增强代码可读性
将auto替换为具体的迭代器类型声明,使代码意图更清晰
This commit is contained in:
parent
63a72b5f14
commit
9d948bead1
@ -25,7 +25,7 @@ int main(){
|
|||||||
std::cin>>m;
|
std::cin>>m;
|
||||||
while(m--){
|
while(m--){
|
||||||
std::cin>>tmp;
|
std::cin>>tmp;
|
||||||
if(const auto p = s.find(tmp);p!=s.end()){
|
if(std::map<std::string,std::set<ll>>::const_iterator p = s.find(tmp);p!=s.end()){
|
||||||
for(const ll i:p->second){
|
for(const ll i:p->second){
|
||||||
std::cout<<i<<" ";
|
std::cout<<i<<" ";
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user