Submission #19280282


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
template<class T> bool chmax(T &a, const T &b) { if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;}
//-------------------------------------------------------


ll N,M;
ll mo;
ll modpow(ll a, ll n = mo-2) {
	ll r=1;a%=mo;
	while(n) r=r*((n%2)?a:1)%mo,a=a*a%mo,n>>=1;
	return r;
}

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N>>M;
	mo=M*M;
	ll A=modpow(10,N);
	cout<<A/M%M<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}

Submission Info

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

Compile Error

./Main.cpp: In function ‘void solve()’:
./Main.cpp:26:6: warning: unused variable ‘i’ [-Wunused-variable]
   26 |  int i,j,k,l,r,x,y; string s;
      |      ^
./Main.cpp:26:8: warning: unused variable ‘j’ [-Wunused-variable]
   26 |  int i,j,k,l,r,x,y; string s;
      |        ^
./Main.cpp:26:10: warning: unused variable ‘k’ [-Wunused-variable]
   26 |  int i,j,k,l,r,x,y; string s;
      |          ^
./Main.cpp:26:12: warning: unused variable ‘l’ [-Wunused-variable]
   26 |  int i,j,k,l,r,x,y; string s;
      |            ^
./Main.cpp:26:14: warning: unused variable ‘r’ [-Wunused-variable]
   26 |  int i,j,k,l,r,x,y; string s;
      |              ^
./Main.cpp:26:16: warning: unused variable ‘x’ [-Wunused-variable]
   26 |  int i,j,k,l,r,x,y; string s;
      |                ^
./Main.cpp:26:18: warning: unused variable ‘y’ [-Wunused-variable]
   26 |  int i,j,k,l,r,x,y; string s;
      |                  ^
./Main.cpp: In function ‘int main(int, char**)’:
./Main.cpp:6:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
    6 | #define FOR(x,to) for(x=0;x<(to);x++)
      |                            ^
./Main.cpp:38:38: note: in expansion of macro ‘FOR’
   38 |  FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
      |                                      ^~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status AC
AC × 23
Set Name Test Cases
Sample
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 2 ms 3504 KB
example_01 AC 2 ms 3456 KB
example_02 AC 2 ms 3608 KB
max_random_00 AC 2 ms 3508 KB
max_random_01 AC 2 ms 3508 KB
max_random_02 AC 2 ms 3496 KB
max_random_03 AC 1 ms 3568 KB
max_random_04 AC 5 ms 3564 KB
small_m_00 AC 3 ms 3656 KB
small_m_01 AC 7 ms 3548 KB
small_m_02 AC 4 ms 3496 KB
small_m_03 AC 3 ms 3500 KB
small_m_04 AC 5 ms 3496 KB
small_m_05 AC 3 ms 3580 KB
small_m_06 AC 2 ms 3584 KB
small_m_07 AC 2 ms 3612 KB
small_m_08 AC 2 ms 3548 KB
small_m_09 AC 2 ms 3584 KB
special_00 AC 3 ms 3444 KB
special_01 AC 2 ms 3452 KB
special_02 AC 2 ms 3604 KB
special_03 AC 2 ms 3452 KB
special_04 AC 2 ms 3568 KB