Submission #13837173


Source Code Expand

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

#undef _P
#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 ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	ll N;
	cin>>N;
	int ret=0;
	for(i=2;1LL*i*i<=N;i++) if(N%i==0) {
		j=0;
		while(N%i==0) j++, N/=i;
		for(x=1;x<=10;x++) {
			if(j>=x) ret++, j-=x;
		}
	}
	if(N>1) ret++;
	cout<<ret<<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 D - Div Game
User kmjp
Language C++ (GCC 9.2.1)
Score 400
Code Size 948 Byte
Status AC
Exec Time 16 ms
Memory 3656 KB

Compile Error

./Main.cpp: In function ‘void solve()’:
./Main.cpp:16:10: warning: unused variable ‘k’ [-Wunused-variable]
   16 |  int i,j,k,l,r,x,y; string s;
      |          ^
./Main.cpp:16:12: warning: unused variable ‘l’ [-Wunused-variable]
   16 |  int i,j,k,l,r,x,y; string s;
      |            ^
./Main.cpp:16:14: warning: unused variable ‘r’ [-Wunused-variable]
   16 |  int i,j,k,l,r,x,y; string s;
      |              ^
./Main.cpp:16:18: warning: unused variable ‘y’ [-Wunused-variable]
   16 |  int i,j,k,l,r,x,y; string s;
      |                  ^
./Main.cpp: In function ‘int main(int, char**)’:
./Main.cpp:7:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
    7 | #define FOR(x,to) for(x=0;x<(to);x++)
      |                            ^
./Main.cpp:36:38: note: in expansion of macro ‘FOR’
   36 |  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 400 / 400
Status
AC × 5
AC × 32
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, sample_05.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, hand_12.txt, hand_13.txt, hand_14.txt, hand_15.txt, hand_16.txt, hand_17.txt, hand_18.txt, hand_19.txt, hand_20.txt, hand_21.txt, hand_22.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, sample_05.txt
Case Name Status Exec Time Memory
hand_01.txt AC 4 ms 3564 KB
hand_02.txt AC 2 ms 3448 KB
hand_03.txt AC 2 ms 3644 KB
hand_04.txt AC 2 ms 3508 KB
hand_05.txt AC 2 ms 3612 KB
hand_06.txt AC 2 ms 3644 KB
hand_07.txt AC 2 ms 3652 KB
hand_08.txt AC 2 ms 3564 KB
hand_09.txt AC 15 ms 3568 KB
hand_10.txt AC 14 ms 3612 KB
hand_11.txt AC 16 ms 3652 KB
hand_12.txt AC 15 ms 3576 KB
hand_13.txt AC 15 ms 3452 KB
hand_14.txt AC 16 ms 3448 KB
hand_15.txt AC 2 ms 3568 KB
hand_16.txt AC 2 ms 3504 KB
hand_17.txt AC 2 ms 3600 KB
hand_18.txt AC 2 ms 3496 KB
hand_19.txt AC 2 ms 3584 KB
hand_20.txt AC 2 ms 3568 KB
hand_21.txt AC 13 ms 3612 KB
hand_22.txt AC 3 ms 3496 KB
random_01.txt AC 2 ms 3640 KB
random_02.txt AC 2 ms 3548 KB
random_03.txt AC 3 ms 3496 KB
random_04.txt AC 12 ms 3656 KB
random_05.txt AC 2 ms 3600 KB
sample_01.txt AC 2 ms 3612 KB
sample_02.txt AC 2 ms 3580 KB
sample_03.txt AC 2 ms 3496 KB
sample_04.txt AC 2 ms 3568 KB
sample_05.txt AC 2 ms 3600 KB