Submission #1213083
Source Code Expand
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(){ unsigned N; char **S; char *T; int cmp; unsigned a = 0, b = 0; scanf("%u", &N); S = (char **)malloc(sizeof(char *) * N); for(unsigned i = 0; i < N; i++){ S[i] = (char *)malloc(21); scanf("%s", S[i]); } T = (char *)malloc(21); scanf("%s", T); for(unsigned i = 0; i < N; i++){ cmp = strcmp(S[i], T); if(!cmp) b++; else if (cmp < 0) a++; } for(unsigned i = a + 1; i < a + b + 2; i++){ printf("%d ", i); } putchar('\b');putchar('\n'); }
Submission Info
Submission Time | |
---|---|
Task | A - Atcoder Handles |
User | toga57 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 559 Byte |
Status | WA |
Exec Time | 2 ms |
Memory | 512 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:11:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%u", &N); ^ ./Main.cpp:15:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%s", S[i]); ^ ./Main.cpp:18:16: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%s", T); ^
Judge Result
Set Name | Subtask1 | Subtask2 | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 130 | 0 / 120 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Subtask1 | sub1_in1.txt, sub1_in2.txt, sub1_in3.txt |
Subtask2 | sub1_in1.txt, sub1_in2.txt, sub1_in3.txt, sub2_in1.txt, sub2_in2.txt, sub2_in3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sub1_in1.txt | WA | 1 ms | 128 KB |
sub1_in2.txt | WA | 1 ms | 128 KB |
sub1_in3.txt | WA | 1 ms | 128 KB |
sub2_in1.txt | WA | 1 ms | 128 KB |
sub2_in2.txt | WA | 1 ms | 384 KB |
sub2_in3.txt | WA | 2 ms | 512 KB |