Submission #19139951
Source Code Expand
Copy
/** @Author: Luisvacson* @LastEditors: Luisvacson* @Descriptions: None* @Date: 2021-01-02 20:00:40* @LastEditTime: 2021-01-02 20:02:31* @FilePath: \C++\Practice\ABC187A.cpp*/#include <bits/stdc++.h>using namespace std;inline int f(int x){int sum = 0;while (x) {sum += x % 10;x /= 10;}return sum;}
/* * @Author: Luisvacson * @LastEditors: Luisvacson * @Descriptions: None * @Date: 2021-01-02 20:00:40 * @LastEditTime: 2021-01-02 20:02:31 * @FilePath: \C++\Practice\ABC187A.cpp */ #include <bits/stdc++.h> using namespace std; inline int f(int x) { int sum = 0; while (x) { sum += x % 10; x /= 10; } return sum; } signed main() { int a, b; scanf("%d%d", &a, &b); printf("%d\n", max(f(a), f(b))); return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Large Digits |
User | Luisvacson |
Language | C++ (GCC 9.2.1) |
Score | 100 |
Code Size | 492 Byte |
Status | AC |
Exec Time | 6 ms |
Memory | 3824 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:25:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] 25 | scanf("%d%d", &a, &b); | ~~~~~^~~~~~~~~~~~~~~~
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | hand_01.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
hand_01.txt | AC | 6 ms | 3720 KB |
random_01.txt | AC | 3 ms | 3580 KB |
random_02.txt | AC | 2 ms | 3824 KB |
random_03.txt | AC | 2 ms | 3632 KB |
random_04.txt | AC | 2 ms | 3752 KB |
random_05.txt | AC | 3 ms | 3716 KB |
random_06.txt | AC | 2 ms | 3720 KB |
random_07.txt | AC | 2 ms | 3712 KB |
random_08.txt | AC | 2 ms | 3708 KB |
random_09.txt | AC | 2 ms | 3640 KB |
sample_01.txt | AC | 2 ms | 3584 KB |
sample_02.txt | AC | 2 ms | 3716 KB |
sample_03.txt | AC | 2 ms | 3712 KB |