Record Detail

Compile Error

/in/square.cpp: In function 'std::vector<int> square_sort(std::vector<int>&)':
/in/square.cpp:15:21: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   for (int i = 0; i < A.size(); i++)
                   ~~^~~~~~~~~~
/in/square.cpp:23:25: error: conversion to 'int' from 'std::vector<int>::size_type {aka long unsigned int}' may alter its value [-Werror=conversion]
   for (int i = A.size() - 1; i != 0; i--)
                ~~~~~~~~~^~~
/in/square.cpp:29:22: error: conversion to 'int' from 'std::vector<int>::size_type {aka long unsigned int}' may alter its value [-Werror=conversion]
  int size = A.size() - 1;
             ~~~~~~~~~^~~
/in/square.cpp:30:37: error: conversion to 'int' from 'std::vector<int>::size_type {aka long unsigned int}' may alter its value [-Werror=conversion]
  for (int left = 0, right = A.size()-1; left <= right; size--)
                             ~~~~~~~~^~
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Homework 1
Language
C++
Submit At
2021-09-25 16:44:57
Judged At
2021-09-25 16:44:57
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes