#include<iostream>#include<vector>usingnamespace std;boolcmp(vector<int>&A, vector<int>&B){if(A.size()!= B.size())return A.size()> B.size();for(int i = A.size()-1; i >=0; i --)if(A[i]!= B[i])return A[i]> B[i];returntrue;}vector<int>sub(vector<int>&A, vector<int>&B){vector<int> C;for(int i =0, t =0; i < A.size(); i ++){t = A[i]- t;if(i < B.size()) t -= B[i];C.push_back((t +10)%10);if(t <0) t =1;else t =0;}while(C.size()>1&& C.back()==0) C.pop_back();return C;}intmain(){string a, b;vector<int> A, B;cin >> a >> b;for(int i = a.size()-1; i >=0; i --) A.push_back(a[i]-'0');for(int i = b.size()-1; i >=0; i --) B.push_back(b[i]-'0');vector<int> C;if(cmp(A, B)) C =sub(A, B);else C =sub(B, A), cout <<'-';for(int i = C.size()-1; i >=0; i --) cout << C[i];cout << endl;return0;}
深度学习论文分享(八)Learning Event-Driven Video Deblurring and Interpolation 前言Abstract1 Introduction2 Motivation2.1 Physical Model of Event-based Video Reconstruction2.2 Spatially Variant Triggering Threshold 3 Proposed Methods3.1 …
框架的ListFragment的静态库支持版本,用于编写在Android 3.0之前的平台上运行的应用程序,在Android 3.0或更高版本上运行时,仍使用此实现。 List fragment 的基本实现是用于创建fragment中的项目列表 List in Fragments
示例
本示例将向您说明如何基于…
题目链接:Dijkstra求最短路 II
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>using namespace std;typedef pair<int, int> PII;const int N 150010;int n, m;
int h[N…