1 class Solution {
2 public:
3     int largestPalindrome(int n) 
4     {
5         vector<int> res{9,987,123,597,677,1218,877,475};
6         return res[n-1];
7     }
8 };

这里的穷举法,你不得不服

posted on 2018-06-01 15:02  高数考了59  阅读(78)  评论(0)    收藏  举报