Task: | Sanalista |
Sender: | Rixu |
Submission time: | 2020-10-01 23:26:11 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.01 s | details |
#2 | WRONG ANSWER | 0.01 s | details |
#3 | WRONG ANSWER | 0.01 s | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%s",temp); ~~~~~^~~~~~~~~~~ input/code.cpp:17:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%s", data); ~~~~~^~~~~~~~~~~~
Code
#include <iostream> int main() { /*allocate TEMP*/ char *temp = new char[1000]; scanf("%s",temp); unsigned int lenght = atoi(temp); /*deallocate TEMP*/ delete[] temp; /*get/prosses the data*/ unsigned int O = 0; for(unsigned int i = 0; i < lenght; i++) { char* data = new char[1000]; scanf("%s", data); unsigned int *L = new unsigned int; *L = 0; while (data[*L] != '\0') { *L += 1; } if(*L % 2 == 0) { bool FF = true; for(unsigned int x = 0; x < *L; x++) { /*doing dumb stuff*/ int a[26] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; switch (data[x]) { case 'a': { a[0] += 1; break; } case 'b': { a[1] += 1; break; } case 'c': { a[2] += 1; break; } case 'd': { a[3] += 1; break; } case 'e': { a[4] += 1; break; } case 'f': { a[5] += 1; break; } case 'g': { a[6] += 1; break; } case 'h': { a[7] += 1; break; } case 'i': { a[8] += 1; break; } case 'j': { a[9] += 1; break; } case 'k': { a[10] += 1; break; } case 'l': { a[11] += 1; break; } case 'm': { a[12] += 1; break; } case 'n': { a[13] += 1; break; } case 'o': { a[14] += 1; break; } case 'p': { a[15] += 1; break; } case 'q': { a[16] += 1; break; } case 'r': { a[17] += 1; break; } case 's': { a[18] += 1; break; } case 't': { a[19] += 1; break; } case 'u': { a[20] += 1; break; } case 'v': { a[21] += 1; break; } case 'w': { a[22] += 1; break; } case 'x': { a[23] += 1; break; } case 'y': { a[24] += 1; break; } case 'z': { a[25] += 1; break; } default: break; } for(unsigned int y = 0; y < 25; y++) { /*its just works*/ if (a[y] % 2 == 1) { FF = true; } } } if (FF) { O++; } } delete[] data; delete L; } printf("%u", O); }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
1000 korvata sopimusaika nuhatartunta korttiautomaatti ... |
correct output |
---|
15 |
user output |
---|
504 |
Test 2
Verdict: WRONG ANSWER
input |
---|
1000 pub hansikaslokero erikoisvalmisteinen unijukka ... |
correct output |
---|
42 |
user output |
---|
504 |
Test 3
Verdict: WRONG ANSWER
input |
---|
1000 haapalastu toipumisaika mustalaiskieli taidelainaamo ... |
correct output |
---|
70 |
user output |
---|
552 |