Submission #19723170


Source Code Expand

Copy
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <map>
#define LL long long
#define LD long double
#define DB double
using namespace std;
const int MAXN = 3e6 + 5;
LL N, M;

LL mpow (LL b, LL mo) {
	if (b == 1)  return 10 % mo;
	LL ret = mpow (b >> 1, mo);
	if (b & 1) return ret * ret % mo * 10 % mo;
	else return ret * ret % mo;
}

int main() {
#ifdef IN
	freopen ("x.in", "r", stdin);
	freopen ("x.out", "w", stdout);
#endif
	int i,j,k;
	scanf ("%lld%lld", &N, &M);
	printf ("%lld\n", (mpow (N, M * M) / M) % M);
	return 0;
}

Submission Info

Submission Time
Task A - Simple Math 2
User WAC
Language C++ (GCC 9.2.1)
Score 300
Code Size 614 Byte
Status AC
Exec Time 6 ms
Memory 3824 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:26:6: warning: unused variable ‘i’ [-Wunused-variable]
   26 |  int i,j,k;
      |      ^
./Main.cpp:26:8: warning: unused variable ‘j’ [-Wunused-variable]
   26 |  int i,j,k;
      |        ^
./Main.cpp:26:10: warning: unused variable ‘k’ [-Wunused-variable]
   26 |  int i,j,k;
      |          ^
./Main.cpp:27:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   27 |  scanf ("%lld%lld", &N, &M);
      |  ~~~~~~^~~~~~~~~~~~~~~~~~~~

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 6 ms 3672 KB
example_01 AC 3 ms 3560 KB
example_02 AC 3 ms 3620 KB
max_random_00 AC 2 ms 3748 KB
max_random_01 AC 2 ms 3564 KB
max_random_02 AC 3 ms 3820 KB
max_random_03 AC 2 ms 3624 KB
max_random_04 AC 2 ms 3596 KB
small_m_00 AC 2 ms 3824 KB
small_m_01 AC 3 ms 3672 KB
small_m_02 AC 2 ms 3688 KB
small_m_03 AC 2 ms 3672 KB
small_m_04 AC 2 ms 3664 KB
small_m_05 AC 2 ms 3748 KB
small_m_06 AC 2 ms 3616 KB
small_m_07 AC 3 ms 3752 KB
small_m_08 AC 2 ms 3716 KB
small_m_09 AC 3 ms 3672 KB
special_00 AC 2 ms 3672 KB
special_01 AC 2 ms 3820 KB
special_02 AC 2 ms 3596 KB
special_03 AC 2 ms 3712 KB
special_04 AC 2 ms 3688 KB