Submission #2702725


Source Code Expand

/* c++ -lm hogehoge.cpp -O2 */
/* ./a.out < input.dat > output.dat */
#include <iostream>
#include <vector>
#include <algorithm>
//#include <math.h>
using namespace std;

/*long long sum[100009];
long long temp_sum;
long long now_result;
long long sign0, sign1, sign2;
*/
// sort(aiTable, aiTable + 5, greater<int>());

int N;
int divider[11];
int out;
int now_N;
int pre_N;

int main(){
// input
	scanf("%d",&N);
	divider[0] = 6;
	for(int k=2;k<7;k++){
    divider[k-1] = 6*divider[k-2];
  }
	divider[6] = 9;
	for(int k=2;k<6;k++){
		divider[k-1+6] = 9*divider[k-2+6];
	}
	sort(divider,divider+11, greater<int>());

	out = 0;
	now_N = N;
	for(int k=0;k<11;k++){
		pre_N = now_N;
		now_N = (pre_N%divider[k]);
		out  += (pre_N - now_N)/divider[k];
//		printf("now %d %d %d %d\n",out,k,now_N,divider[k]);;
	}
	out += now_N; // 1^n

	printf("%d",out);
}

Submission Info

Submission Time
Task C - Strange Bank
User ikenakayuki
Language C++14 (GCC 5.4.1)
Score 0
Code Size 898 Byte
Status WA
Exec Time 1 ms
Memory 256 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:24:16: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&N);
                ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 2
WA × 1
AC × 12
WA × 7
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
01.txt WA 1 ms 256 KB
02.txt WA 1 ms 256 KB
03.txt WA 1 ms 256 KB
04.txt AC 1 ms 256 KB
05.txt AC 1 ms 256 KB
06.txt AC 1 ms 256 KB
07.txt AC 1 ms 256 KB
08.txt AC 1 ms 256 KB
09.txt AC 1 ms 256 KB
10.txt AC 1 ms 256 KB
11.txt WA 1 ms 256 KB
12.txt AC 1 ms 256 KB
13.txt WA 1 ms 256 KB
14.txt AC 1 ms 256 KB
15.txt AC 1 ms 256 KB
16.txt WA 1 ms 256 KB
sample_01.txt AC 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt WA 1 ms 256 KB