Submission #19723884


Source Code Expand

Copy
#include<bits/stdc++.h>
#include<unordered_map>
#include<unordered_set>
#define f(i,a,b) for( int i=a;i<=b;++i)
#define ff(i,a,b) for( int i=a;i>=b;--i)
#define debug(x) cerr << #x << " : " << x << " " << endl
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
const ll mod = 1e9 + 7;
const ll mod2 = 998244353;
const int inf = 0x3f3f3f3f;
const double tiaohe = 0.57721566490153286060651209;
ll oula(ll x) { ll res = x;f(i, 2, x / i) { if (x % i == 0) { res = res / i * (i - 1);while (x % i == 0) x /= i; } }if (x > 1) res = res / x * (x - 1);return res; }
ll quickmod(ll a, ll n, ll m) { ll s = 1;while (n) { if (n & 1) { s = s * a % m; }a = (a*a) % m;n = n / 2; }return s; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
void ex_gcd(ll a, ll b, ll &x, ll &y, ll &d) { if (!b) { d = a, x = 1, y = 0; } else { ex_gcd(b, a % b, y, x, d);y -= x * (a / b); } }
ll inv(ll t, ll p) { ll d, x, y;ex_gcd(t, p, x, y, d);return d == 1 ? (x % p + p) % p : -1; }
bool isPrime(ll x) { if (x == 2)return true;if (x % 2 == 0)return false;for (ll i = 2;i*i <= x;i++) if (x % i == 0)return false; return true; }
inline ll in() { char ch = getchar();ll x = 0, f = 1;while (ch<'0' || ch>'9') { if (ch == '-')f = -1;ch = getchar(); }while (ch >= '0'&&ch <= '9') { x = x * 10 + ch - '0';ch = getchar(); }return x * f; }
//double a = log(n) +tiaohe + 1.0 / (2 * n);
double eqa = (1 + sqrt(5.0)) / 2.0;
double E = 2.7182818284;
const double eps = 1e-8;
const int N = 2e5 + 5;

int main()
{
#ifndef ONLINE_JUDGE 
	freopen("in.txt", "r", stdin);
#endif
	ll n, m;
	cin >> n >> m;
	cout << (quickmod(10, n, m*m) - quickmod(10, n, m)) / m << endl;
	return 0;
}

Submission Info

Submission Time
Task A - Simple Math 2
User DQYZ_HWK
Language C++ (GCC 9.2.1)
Score 300
Code Size 1786 Byte
Status AC
Exec Time 7 ms
Memory 3568 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 23
Set Name Test Cases
Sample example_00, example_01, example_02
All example_00, example_01, example_02, max_random_00, max_random_01, max_random_02, max_random_03, max_random_04, small_m_00, small_m_01, small_m_02, small_m_03, small_m_04, small_m_05, small_m_06, small_m_07, small_m_08, small_m_09, special_00, special_01, special_02, special_03, special_04
Case Name Status Exec Time Memory
example_00 AC 7 ms 3476 KB
example_01 AC 2 ms 3464 KB
example_02 AC 3 ms 3356 KB
max_random_00 AC 2 ms 3568 KB
max_random_01 AC 2 ms 3464 KB
max_random_02 AC 2 ms 3504 KB
max_random_03 AC 2 ms 3528 KB
max_random_04 AC 3 ms 3472 KB
small_m_00 AC 1 ms 3532 KB
small_m_01 AC 3 ms 3480 KB
small_m_02 AC 2 ms 3524 KB
small_m_03 AC 2 ms 3356 KB
small_m_04 AC 2 ms 3504 KB
small_m_05 AC 2 ms 3568 KB
small_m_06 AC 3 ms 3540 KB
small_m_07 AC 2 ms 3564 KB
small_m_08 AC 2 ms 3496 KB
small_m_09 AC 2 ms 3496 KB
special_00 AC 2 ms 3356 KB
special_01 AC 3 ms 3464 KB
special_02 AC 2 ms 3496 KB
special_03 AC 3 ms 3536 KB
special_04 AC 2 ms 3492 KB