Codeforces 385C - Bear and Prime Numbers(素數篩+前綴和+hashing)

385C - Bear and Prime Numbershtml 思路:記錄數組中1-1e7中每一個數出現的次數,而後用素數篩看哪些能被素數整除,並加到記錄該素數的數組中,而後1-1e7求一遍前綴和。ios 代碼:c++ #include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #
相關文章