Submission #474048

# Submission time Handle Problem Language Result Execution time Memory
474048 2021-09-16T17:45:53 Z ValiAntonie Memory (IOI10_memory) C++14
0 / 100
1 ms 200 KB
#include "grader.h"
#include "memory.h"
#include <bits/stdc++.h>
 
using namespace std;
 
 
void play() {
    // faceup();
    int ap[100], path[100], nr;
    for(int i=1;i<=50;i++){
        char x = faceup(i);
        ap[x]++;
        if(ap[x] == 1){
            path[x] = i;
        }
        else{
            if(i % 2 == 0){
                if(faceup(i-1) == x)
                    continue;
                else{
                    faceup(path[x]);
                    faceup(i);
                }
            }
            else{
                faceup(path[x]);
            }
        }
    }
}

Compilation message

memory.cpp: In function 'void play()':
memory.cpp:13:12: warning: array subscript has type 'char' [-Wchar-subscripts]
   13 |         ap[x]++;
      |            ^
memory.cpp:14:15: warning: array subscript has type 'char' [-Wchar-subscripts]
   14 |         if(ap[x] == 1){
      |               ^
memory.cpp:15:18: warning: array subscript has type 'char' [-Wchar-subscripts]
   15 |             path[x] = i;
      |                  ^
memory.cpp:22:33: warning: array subscript has type 'char' [-Wchar-subscripts]
   22 |                     faceup(path[x]);
      |                                 ^
memory.cpp:27:29: warning: array subscript has type 'char' [-Wchar-subscripts]
   27 |                 faceup(path[x]);
      |                             ^
memory.cpp:10:29: warning: unused variable 'nr' [-Wunused-variable]
   10 |     int ap[100], path[100], nr;
      |                             ^~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -