Submission #1731778
Source Code Expand
#include <stdio.h> int main(void) { int a,i,count = 0; char b[100]; scanf("%d%s",&a,b); for (i = 0; i < strlen(b); i++) { if (b[i] == 'I') { count++; }else{ count--; } } printf("%d\n",count+1); return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Increment Decrement |
User | gunmaken |
Language | C (GCC 5.4.1) |
Score | 0 |
Code Size | 298 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 128 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:8:21: warning: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration] for (i = 0; i < strlen(b); i++) { ^ ./Main.c:8:21: warning: incompatible implicit declaration of built-in function ‘strlen’ ./Main.c:8:21: note: include ‘<string.h>’ or provide a declaration of ‘strlen’ ./Main.c:7:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d%s",&a,b); ^
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 200 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt |
All | sample_01.txt, sample_02.txt, subtask_1_alld_01.txt, subtask_1_alldmax_01.txt, subtask_1_alli_01.txt, subtask_1_allimax_01.txt, subtask_1_max_01.txt, subtask_1_max_02.txt, subtask_1_rand_01.txt, subtask_1_rand_02.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_alld_01.txt | WA | 1 ms | 128 KB |
subtask_1_alldmax_01.txt | WA | 1 ms | 128 KB |
subtask_1_alli_01.txt | WA | 1 ms | 128 KB |
subtask_1_allimax_01.txt | WA | 1 ms | 128 KB |
subtask_1_max_01.txt | WA | 1 ms | 128 KB |
subtask_1_max_02.txt | WA | 1 ms | 128 KB |
subtask_1_rand_01.txt | WA | 1 ms | 128 KB |
subtask_1_rand_02.txt | WA | 1 ms | 128 KB |