Submission #19720093


Source Code Expand

Copy
#include <bits/stdc++.h>
// #include <atcoder/all>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
#define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define popcount __builtin_popcount
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
template <class T>
inline bool chmin(T &a, T b)
{
	if (a > b)
	{
		a = b;
		return true;
	}
	return false;
}
template <class T>
inline bool chmax(T &a, T b)
{
	if (a < b)
	{
		a = b;
		return true;
	}
	return false;
}

template <typename T>
T mypow(T x, T n, const T &p = -1)
{ //x^nをmodで割った余り
	T ret = 1;
	while (n > 0)
	{
		if (n & 1)
		{
			if (p != -1)
				ret = (ret * x) % p;
			else
				ret *= x;
		}
		if (p != -1)
			x = (x * x) % p;
		else
			x *= x;
		n >>= 1;
	}
	return ret;
}

using namespace std;
// using namespace atcoder;

void solve()
{
	ll n,m;
	cin>>n>>m;
	ll ans=mypow<ll>(10LL,n,m*m)/m;
	cout<<ans;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}

Submission Info

Submission Time
Task A - Simple Math 2
User tanimanianima364
Language C++ (GCC 9.2.1)
Score 300
Code Size 1456 Byte
Status AC
Exec Time 8 ms
Memory 3640 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 8 ms 3524 KB
example_01 AC 2 ms 3532 KB
example_02 AC 2 ms 3468 KB
max_random_00 AC 2 ms 3528 KB
max_random_01 AC 2 ms 3464 KB
max_random_02 AC 2 ms 3464 KB
max_random_03 AC 2 ms 3512 KB
max_random_04 AC 5 ms 3512 KB
small_m_00 AC 2 ms 3528 KB
small_m_01 AC 2 ms 3468 KB
small_m_02 AC 4 ms 3640 KB
small_m_03 AC 6 ms 3524 KB
small_m_04 AC 2 ms 3604 KB
small_m_05 AC 3 ms 3608 KB
small_m_06 AC 3 ms 3464 KB
small_m_07 AC 3 ms 3608 KB
small_m_08 AC 2 ms 3536 KB
small_m_09 AC 3 ms 3528 KB
special_00 AC 2 ms 3468 KB
special_01 AC 3 ms 3472 KB
special_02 AC 3 ms 3580 KB
special_03 AC 2 ms 3604 KB
special_04 AC 3 ms 3604 KB