Job 19393

Owner
Lucian Bicsi
Problem
Keyboard
Contest
MindCoding 2017 Round 3 Take Off Labs (Div. 1)
Source
1.25KB
Result
Accepted

Compiler output

prog.cpp: In function 'std::pair<int, int> GetPos(char)':
prog.cpp:14:19: warning: array subscript has type 'char' [-Wchar-subscripts]
  auto &ret = pos[a];
                   ^
prog.cpp:17:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j = 0; j < keyboard[i].size(); ++j)
                    ^
prog.cpp: In function 'int main()':
prog.cpp:43:13: warning: array subscript has type 'char' [-Wchar-subscripts]
     if(Old[a][b] == -1) continue;
             ^
prog.cpp:43:16: warning: array subscript has type 'char' [-Wchar-subscripts]
     if(Old[a][b] == -1) continue;
                ^
prog.cpp:45:13: warning: array subscript has type 'char' [-Wchar-subscripts]
     if(Now[c][b] == -1 || Now[c][b] > Old[a][b] + Dist(a, c))
             ^
prog.cpp:45:16: warning: array subscript has type 'char' [-Wchar-subscripts]
     if(Now[c][b] == -1 || Now[c][b] > Old[a][b] + Dist(a, c))
                ^
prog.cpp:45:32: warning: array subscript has type 'char' [-Wchar-subscripts]
     if(Now[c][b] == -1 || Now[c][b] > Old[a][b] + Dist(a, c))
                                ^
prog.cpp:45:35: warning: array subscript has type 'char' [-Wchar-subscripts]
     if(Now[c][b] == -1 || Now[c][b] > Old[a][b] + Dist(a, c))
                                   ^
prog.cpp:45:44: warning: array subscript has type 'char' [-Wchar-subscripts]
     if(Now[c][b] == -1 || Now[c][b] > Old[a][b] + Dist(a, c))
                                            ^
prog.cpp:45:47: warning: array subscript has type 'char' [-Wchar-subscripts]
     if(Now[c][b] == -1 || Now[c][b] > Old[a][b] + Dist(a, c))
                                               ^
prog.cpp:46:11: warning: array subscript has type 'char' [-Wchar-subscripts]
      Now[c][b] = Old[a][b] + Dist(a, c);
           ^
prog.cpp:46:14: warning: array subscript has type 'char' [-Wchar-subscripts]
      Now[c][b] = Old[a][b] + Dist(a, c);
              ^
prog.cpp:46:23: warning: array subscript has type 'char' [-Wchar-subscripts]
      Now[c][b] = Old[a][b] + Dist(a, c);
                       ^
prog.cpp:46:26: warning: array subscript has type 'char' [-Wchar-subscripts]
      Now[c][b] = Old[a][b] + Dist(a, c);
                          ^
prog.cpp:47:13: warning: array subscript has type 'char' [-Wchar-subscripts]
     if(Now[a][c] == -1 || Now[a][c] > Old[a][b] + Dist(b, c))
             ^
prog.cpp:47:16: warning: array subscript has type 'char' [-Wchar-subscripts]
     if(Now[a][c] == -1 || Now[a][c] > Old[a][b] + Dist(b, c))
                ^
prog.cpp:47:32: warning: array subscript has type 'char' [-Wchar-subscripts]
     if(Now[a][c] == -1 || Now[a][c] > Old[a][b] + Dist(b, c))
                                ^
prog.cpp:47:35: warning: array subscript has type 'char' [-Wchar-subscripts]
     if(Now[a][c] == -1 || Now[a][c] > Old[a][b] + Dist(b, c))
                                   ^
prog.cpp:47:44: warning: array subscript has type 'char' [-Wchar-subscripts]
     if(Now[a][c] == -1 || Now[a][c] > Old[a][b] + Dist(b, c))
                                            ^
prog.cpp:47:47: warning: array subscript has type 'char' [-Wchar-subscripts]
     if(Now[a][c] == -1 || Now[a][c] > Old[a][b] + Dist(b, c))
                                               ^
prog.cpp:48:11: warning: array subscript has type 'char' [-Wchar-subscripts]
      Now[a][c] = Old[a][b] + Dist(b, c);
           ^
prog.cpp:48:14: warning: array subscript has type 'char' [-Wchar-subscripts]
      Now[a][c] = Old[a][b] + Dist(b, c);
              ^
prog.cpp:48:23: warning: array subscript has type 'char' [-Wchar-subscripts]
      Now[a][c] = Old[a][b] + Dist(b, c);
                       ^
prog.cpp:48:26: warning: array subscript has type 'char' [-Wchar-subscripts]
      Now[a][c] = Old[a][b] + Dist(b, c);
                          ^
prog.cpp:56:12: warning: array subscript has type 'char' [-Wchar-subscripts]
    if(Old[b][c] != -1)
            ^
prog.cpp:56:15: warning: array subscript has type 'char' [-Wchar-subscripts]
    if(Old[b][c] != -1)
               ^
prog.cpp:57:25: warning: array subscript has type 'char' [-Wchar-subscripts]
     ans = min(ans, Old[b][c]);
                         ^
prog.cpp:57:28: warning: array subscript has type 'char' [-Wchar-subscripts]
     ans = min(ans, Old[b][c]);
                            ^

Results

Test numberResultTime
1Ok0.5234s
2Ok0.5431s
3Ok0.5491s
4Ok0.5560s
5Ok0.5868s
6Ok0.6332s
7Ok0.6442s
8Ok0.6357s
9Ok0.5575s
10Ok0.6066s
Questions?

Sponsors Gold