Submission #3777623
Source Code Expand
#include <stdio.h> int main(){ int K, S; int count = 0; scanf("%d %d", &K, &S); for(int X = 0; X <= K; X++){ for(int Y = 0; Y <= K; Y++){ int Z = S - (X + Y); if(Z >= 0 && Z <= K){ count++; } } } printf("%d\n", count); return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Sum of Three Integers |
User | fumi0102 |
Language | C (GCC 5.4.1) |
Score | 200 |
Code Size | 311 Byte |
Status | AC |
Exec Time | 6 ms |
Memory | 128 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:7:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d", &K, &S); ^
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt |
All | sample_01.txt, sample_02.txt, subtask_1_01.txt, subtask_1_02.txt, subtask_1_03.txt, subtask_1_04.txt, subtask_1_05.txt, subtask_1_06.txt, subtask_1_07.txt, subtask_1_08.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 1 ms | 128 KB |
sample_02.txt | AC | 1 ms | 128 KB |
subtask_1_01.txt | AC | 6 ms | 128 KB |
subtask_1_02.txt | AC | 2 ms | 128 KB |
subtask_1_03.txt | AC | 5 ms | 128 KB |
subtask_1_04.txt | AC | 1 ms | 128 KB |
subtask_1_05.txt | AC | 1 ms | 128 KB |
subtask_1_06.txt | AC | 1 ms | 128 KB |
subtask_1_07.txt | AC | 5 ms | 128 KB |
subtask_1_08.txt | AC | 1 ms | 128 KB |