mirror of
https://gitcode.com/Zengtudor/alg2025.git
synced 2025-10-29 11:33:03 +00:00
Compare commits
3 Commits
de497e2c80
...
9d948bead1
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d948bead1 | |||
| 63a72b5f14 | |||
| eb1f6031d1 |
24
src/10/11/P7988.cpp
Normal file
24
src/10/11/P7988.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
#include <istream>
|
||||
using ll = int64_t;
|
||||
|
||||
#define sl static inline
|
||||
|
||||
const ll maxn = 2e5+5;
|
||||
ll n, a[maxn];
|
||||
|
||||
sl void dfs(){
|
||||
|
||||
}
|
||||
|
||||
int main(){
|
||||
std::iostream::sync_with_stdio(false);
|
||||
std::cin.tie(nullptr);
|
||||
|
||||
std::cin>>n;
|
||||
for(ll i=1;i<=n;i++){
|
||||
std::cin>>a[i];
|
||||
}
|
||||
|
||||
}
|
||||
35
src/10/12/P3879.cpp
Normal file
35
src/10/12/P3879.cpp
Normal file
@ -0,0 +1,35 @@
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
#include <istream>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <string>
|
||||
using ll = int64_t;
|
||||
|
||||
ll n,m,l;
|
||||
std::map<std::string,std::set<ll>> s;
|
||||
std::string tmp;
|
||||
|
||||
int main(){
|
||||
std::iostream::sync_with_stdio(false);
|
||||
std::cin.tie(nullptr);
|
||||
|
||||
std::cin>>n;
|
||||
for(ll i=1;i<=n;i++){
|
||||
std::cin>>l;
|
||||
for(ll j=1;j<=l;j++){
|
||||
std::cin>>tmp;
|
||||
s[tmp].insert(i);
|
||||
}
|
||||
}
|
||||
std::cin>>m;
|
||||
while(m--){
|
||||
std::cin>>tmp;
|
||||
if(std::map<std::string,std::set<ll>>::const_iterator p = s.find(tmp);p!=s.end()){
|
||||
for(const ll i:p->second){
|
||||
std::cout<<i<<" ";
|
||||
}
|
||||
}
|
||||
std::cout<<"\n";
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user