摘要: //模拟乘法进位操作 string add(string x, string y) { reverse(x.begin(), x.end()); reverse(y.begin(), y.end()); string ans; if (x.empty() && y.empty())return an 阅读全文
posted @ 2021-11-18 20:28 Zupernova 阅读(44) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <vector> #include <stack> #include <set> #include <string> #include <algorithm> using namespace std; int main(void) { int 阅读全文
posted @ 2021-11-18 20:27 Zupernova 阅读(13) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; int find(int a[],int len); void main() { int a[]={1,2,3,5,7,8,16}; int len=sizeof(a)/sizeof(int); cout<<find( 阅读全文
posted @ 2021-11-18 20:26 Zupernova 阅读(28) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: ListNode* reverseList(ListNode* head) { if(!head)return NULL; ListNode* pre=new ListNode(-1); ListNode* tmp; while(head){ tmp 阅读全文
posted @ 2021-11-18 20:25 Zupernova 阅读(40) 评论(0) 推荐(0) 编辑
摘要: 经典解法一维 #include <iostream> using namespace std; bool sign = false; int num[9][9]; void Output() { for (int i = 0; i < 9; i++){ for (int j = 0; j < 8; 阅读全文
posted @ 2021-11-18 20:24 Zupernova 阅读(78) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; bool cmp(const string& p1,const string& p2) { return 阅读全文
posted @ 2021-11-18 20:23 Zupernova 阅读(14) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; class Solution { public: string intToRoman(int num) { char* c[4][10]={ {"","I","II","III","IV","V","VI","VII", 阅读全文
posted @ 2021-11-18 20:23 Zupernova 阅读(40) 评论(0) 推荐(0) 编辑
摘要: bool fun(vector<int>& track, vector<int>& nums) { stack<int> t; int i = 0,j=0; for (int i = 0; i < nums.size();i++) { if (t.empty()||t.top() != track[ 阅读全文
posted @ 2021-11-18 20:22 Zupernova 阅读(68) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <vector> using namespace std; int main(void) { vector<int> m = { 5,6,7,8,9,10,11,12,14,15 }; vector<int> ans; int des = 2 阅读全文
posted @ 2021-11-18 20:21 Zupernova 阅读(16) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <string> #include <cmath> #include <vector> #include <map> #include <algorithm> using namespace std; int m, n; vector<vec 阅读全文
posted @ 2021-11-18 20:20 Zupernova 阅读(49) 评论(0) 推荐(0) 编辑