diff --git a/src/2/P11615.cpp b/src/2/P11615.cpp new file mode 100644 index 0000000..c94c21c --- /dev/null +++ b/src/2/P11615.cpp @@ -0,0 +1,14 @@ +#include +#include + +using ll = int64_t; + +volatile const ll n{}; + +int main(){ + // std::cin>>*(ll *)(void*)&n; + std::cout<<*(ll *)(void*)&n<<'\n'; + for(ll i=1;i<=n;i++){ + + } +} \ No newline at end of file diff --git a/src/2/P3370.cpp b/src/2/P3370.cpp new file mode 100644 index 0000000..08595bb --- /dev/null +++ b/src/2/P3370.cpp @@ -0,0 +1,38 @@ +#include +#include +#include +#include +#include +using namespace std; + +using ull= unsigned long long; + +ull base = 131; +ull a[10010]; +char s[10010]; +int n, ans = 1; +int prime = 233317; +const ull mod = 212370440130137957ll; + +ull hashe(char s[]) { + int len = strlen(s); + ull ans = 0; + for (int i = 0; i < len; i++) + ans = (ans * base + (ull)s[i]) % mod + prime; + return ans; +} + +int main() { + iostream::sync_with_stdio(false);cin.tie(nullptr),cout.tie(nullptr); + cin >> n; + for (int i = 1; i <= n; i++) { + cin >> s; + a[i] = hashe(s); + } + sort(a + 1, a + n + 1); + for (int i = 1; i < n; i++) { + if (a[i] != a[i + 1]) + ans++; + } + cout << ans << '\n'; +} \ No newline at end of file