Submission #616100
Source Code Expand
// scanf 等でエラーを出さないように追加 #define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <string> #include <vector> #include <algorithm> #include <numeric> #include <set> int main() { int N = 0; scanf("%d", N); int num = 0; for (int i = 5; i <= N; i += 10) { int digit = strlen(std::to_string(i).c_str()); int dec_digit = (int)pow(10, digit-1); if (i / dec_digit == 2) { num++; } } printf("%d\n", num); return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - ニコニコ数 |
User | Umineko4396 |
Language | C++11 (GCC 4.9.2) |
Score | 0 |
Code Size | 566 Byte |
Status | RE |
Exec Time | 538 ms |
Memory | 796 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:19:15: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int’ [-Wformat=] scanf("%d", N); ^ ./Main.cpp:19: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 | Subtask1 | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 60 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt |
Subtask1 | sample_01.txt, sample_02.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | RE | 538 ms | 792 KB |
sample_02.txt | RE | 289 ms | 796 KB |
test_01.txt | RE | 281 ms | 792 KB |
test_02.txt | RE | 281 ms | 792 KB |
test_03.txt | RE | 422 ms | 792 KB |
test_04.txt | RE | 280 ms | 792 KB |
test_05.txt | RE | 276 ms | 784 KB |
test_06.txt | RE | 278 ms | 796 KB |
test_07.txt | RE | 275 ms | 792 KB |
test_08.txt | RE | 275 ms | 648 KB |
test_09.txt | RE | 280 ms | 792 KB |
test_10.txt | RE | 279 ms | 676 KB |
test_11.txt | RE | 284 ms | 788 KB |
test_12.txt | RE | 275 ms | 784 KB |
test_13.txt | RE | 282 ms | 788 KB |
test_14.txt | RE | 282 ms | 788 KB |
test_15.txt | RE | 285 ms | 796 KB |