better snippet

This commit is contained in:
Barrett Ruth 2025-10-07 22:59:00 -04:00
parent 5af8e1373e
commit 024226ef53
2 changed files with 13 additions and 24 deletions

View file

@ -1,24 +0,0 @@
---
title: "countGoodNumbers.cpp"
date: "07/10/2025"
---
```cpp
class Solution {
public:
static constexpr long long MOD = 1e9 + 7;
long long mpow(long long a, long long b, long long mod=MOD) {
long long ans = 1;
while (b > 0) {
if (b & 1) ans = (ans * a) % MOD;
a = (a * a) % MOD;
b >>= 1;
}
return ans;
}
int countGoodNumbers(long long n) {
long long even = (n + 1) / 2, odd = n / 2;
return (mpow(5, even) * mpow(4, odd)) % MOD;
}
};
```

View file

@ -0,0 +1,13 @@
---
title: "noice.cc"
date: "07/10/2025"
---
```cpp
#include <iostream>
int main() {
std::cout << "I'm surprised that you found this";
return 0;
}
```