1002. A+B for Polynomials (25)
2016-09-21 01:41
288 查看
题目:1002. A+B for Polynomials (25)
#include <iostream> #include <cstdio> #include <set> using namespace std; double poly[1000]; set<int,greater<int>> mst; int main() { int k,n; double a; cin>>k; while(k--) { cin>>n>>a; poly +=a; mst.insert(n); } cin>>k; while(k--) { cin>>n>>a; poly +=a; if(poly ==0) mst.erase(n); else mst.insert(n); } cout<<mst.size(); for(auto x:mst) printf(" %d %.1lf",x,poly[x]); return 0; }
相关文章推荐
- 1002. A+B for Polynomials (25)
- 1002. A+B for Polynomials (25)
- PAT-A-1002. A+B for Polynomials (25)
- PAT - 甲级 - 1002. A+B for Polynomials (25)
- PAT甲级-1002. A+B for Polynomials (25)多项式
- 1002. A+B for Polynomials (25)
- 1002. A+B for Polynomials (25)
- 1002. A+B for Polynomials (25)
- 1002. A+B for Polynomials (25)
- 1002. A+B for Polynomials (25)
- 1002. A+B for Polynomials (25)
- 1002. A+B for Polynomials (25)
- PAT甲 1002. A+B for Polynomials (25)
- PAT (Advanced Level) 1002. A+B for Polynomials (25) 合并同类项
- 1002. A+B for Polynomials (25)
- pat 1002. A+B for Polynomials (25)
- 1002. A+B for Polynomials (25)
- PAT 1002. A+B for Polynomials (25)(多项式加法)(待修改)
- 1002. A+B for Polynomials (25)
- 1002. A+B for Polynomials (25)