Task: | Coffee shops |
Sender: | Maxim.A |
Submission time: | 2016-09-17 14:52:43 +0300 |
Language: | C++ |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | UNKNOWN | -- | details |
#2 | UNKNOWN | -- | details |
#3 | UNKNOWN | -- | details |
#4 | UNKNOWN | -- | details |
#5 | UNKNOWN | -- | details |
#6 | UNKNOWN | -- | details |
#7 | UNKNOWN | -- | details |
#8 | UNKNOWN | -- | details |
#9 | UNKNOWN | -- | details |
#10 | UNKNOWN | -- | details |
#11 | UNKNOWN | -- | details |
#12 | UNKNOWN | -- | details |
#13 | UNKNOWN | -- | details |
#14 | UNKNOWN | -- | details |
#15 | UNKNOWN | -- | details |
#16 | UNKNOWN | -- | details |
#17 | UNKNOWN | -- | details |
#18 | UNKNOWN | -- | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:27:11: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] fscanf(stdin, "%d", &len); ~~~~~~^~~~~~~~~~~~~~~~~~~ input/code.cpp:34:15: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] fscanf(stdin, "%d", &newVal); ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
Code
/* * File: main.c * Author: aftenim1 * * Created on August 19, 2016, 8:39 PM */ #include <stdio.h> #include <stdlib.h> #include <stdio.h> int dmin(int a, int b) { if(a <= b) { return a; } else { return b; } } //stdInput int main() { int sum = 0; int M1 = 1000; int n = 0; int M2 = 1000; int len; fscanf(stdin, "%d", &len); for(int i = 0; i < len; i ++) { int firstm = dmin(M1, n); int secondm = dmin(firstm, M2); sum += secondm; int newVal; fscanf(stdin, "%d", &newVal); printf("%d, min %d\n", newVal, secondm); M1 = n; n = M2; M2 = newVal; } printf("\n%d", sum); }
Test details
Test 1
Verdict: UNKNOWN
input |
---|
9 1 1 1000 1 1000 1000 1 1 1 |
correct output |
---|
4 |
user output |
---|
(not available) |
Test 2
Verdict: UNKNOWN
input |
---|
100 5 6 3 10 10 1 8 3 8 4 3 1 10 4... |
correct output |
---|
152 |
user output |
---|
(not available) |
Test 3
Verdict: UNKNOWN
input |
---|
1000 4 5 5 7 3 4 9 5 1 5 9 9 1 9 2 ... |
correct output |
---|
1383 |
user output |
---|
(not available) |
Test 4
Verdict: UNKNOWN
input |
---|
10000 10 8 9 6 3 5 2 9 4 7 6 3 1 1 2... |
correct output |
---|
13686 |
user output |
---|
(not available) |
Test 5
Verdict: UNKNOWN
input |
---|
100000 9 7 6 1 9 9 9 4 7 9 6 5 9 1 8 ... |
correct output |
---|
136447 |
user output |
---|
(not available) |
Test 6
Verdict: UNKNOWN
input |
---|
1000000 2 7 4 4 5 6 5 9 5 9 1 6 8 3 5 ... |
correct output |
---|
1355562 |
user output |
---|
(not available) |
Test 7
Verdict: UNKNOWN
input |
---|
1000000 4 8 3 6 4 5 4 9 3 6 8 7 8 1 5 ... |
correct output |
---|
1358066 |
user output |
---|
(not available) |
Test 8
Verdict: UNKNOWN
input |
---|
1000000 4 5 5 9 3 2 2 8 5 9 6 4 6 7 10... |
correct output |
---|
1356381 |
user output |
---|
(not available) |
Test 9
Verdict: UNKNOWN
input |
---|
1000000 6 3 1 2 8 5 5 4 7 6 7 10 10 1 ... |
correct output |
---|
1357998 |
user output |
---|
(not available) |
Test 10
Verdict: UNKNOWN
input |
---|
1000000 5 5 4 6 10 8 10 5 7 9 7 7 6 4 ... |
correct output |
---|
1358217 |
user output |
---|
(not available) |
Test 11
Verdict: UNKNOWN
input |
---|
1 42 |
correct output |
---|
42 |
user output |
---|
(not available) |
Test 12
Verdict: UNKNOWN
input |
---|
2 58 105 |
correct output |
---|
58 |
user output |
---|
(not available) |
Test 13
Verdict: UNKNOWN
input |
---|
2 5 3 |
correct output |
---|
3 |
user output |
---|
(not available) |
Test 14
Verdict: UNKNOWN
input |
---|
1000000 1000 1000 1000 1000 1000 1000 ... |
correct output |
---|
333334000 |
user output |
---|
(not available) |
Test 15
Verdict: UNKNOWN
input |
---|
1000000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
correct output |
---|
333334 |
user output |
---|
(not available) |
Test 16
Verdict: UNKNOWN
input |
---|
1 1 |
correct output |
---|
1 |
user output |
---|
(not available) |
Test 17
Verdict: UNKNOWN
input |
---|
3 5 7 4 |
correct output |
---|
7 |
user output |
---|
(not available) |
Test 18
Verdict: UNKNOWN
input |
---|
6 2 7 1 7 7 4 |
correct output |
---|
7 |
user output |
---|
(not available) |