#include "courier.h" /* * DO NOT PRINT ANYTHING TO STDOUT. * YOU WILL SCORE ZERO IF YOU DO. */ // R number of rows // C number of columns // M number of instances you need to solve // Q number of queries you are allowed to the API void init(int R, int C, int M, int Q) { char* queryPath = "EE"; double difference = query(1,1,2, queryPath); if (difference == 0) { // Path was optimal! } else { // Path wasn't optimal :( } char pathArray[10]; pathArray[0] = 'S'; pathArray[1] = 'E'; pathArray[2] = 'N'; // Maybe this will be better! difference = query(1, 1, 3, pathArray); } void solve(int rStart, int cStart, int rEnd, int cEnd, int *length, char* const path) { *length = 0; while (rStart < rEnd) { rStart++; path[(*length)++] = 'S'; } while (rStart > rEnd) { rStart--; path[(*length)++] = 'N'; } while (cStart < cEnd) { cStart++; path[(*length)++] = 'E'; } while (cStart > cEnd) { cStart--; path[(*length)++] = 'W'; } }