Submission #616154
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", &N); if (N < 25) { printf("0\n"); return 0; } 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 | 621 Byte |
Status | WA |
Exec Time | 2559 ms |
Memory | 920 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:19:19: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d\n", &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 | AC | 26 ms | 800 KB |
sample_02.txt | WA | 847 ms | 796 KB |
test_01.txt | AC | 24 ms | 800 KB |
test_02.txt | AC | 26 ms | 796 KB |
test_03.txt | AC | 25 ms | 804 KB |
test_04.txt | WA | 33 ms | 676 KB |
test_05.txt | WA | 55 ms | 796 KB |
test_06.txt | WA | 1057 ms | 804 KB |
test_07.txt | WA | 238 ms | 672 KB |
test_08.txt | TLE | 2559 ms | 920 KB |
test_09.txt | TLE | 2557 ms | 796 KB |
test_10.txt | TLE | 2559 ms | 792 KB |
test_11.txt | TLE | 2559 ms | 796 KB |
test_12.txt | TLE | 2559 ms | 800 KB |
test_13.txt | WA | 1050 ms | 796 KB |
test_14.txt | WA | 24 ms | 800 KB |
test_15.txt | AC | 25 ms | 804 KB |