Submission #30468732
Source Code Expand
Copy
#include <bits/stdc++.h>using namespace std;const int N=1e5+10;typedef long long ll;int mod=1e9+7;int a[202],c[202];int n,m;bool judge(){for(int i=0;i<=n+m;i++)if(c[i]) return 1;return 0;}vector<int>ve;
#include <bits/stdc++.h> using namespace std; const int N=1e5+10; typedef long long ll; int mod=1e9+7; int a[202],c[202]; int n,m; bool judge() { for(int i=0;i<=n+m;i++) if(c[i]) return 1; return 0; } vector<int>ve; int main() { cin>>n>>m; for(int i=0;i<=n;i++) cin>>a[i]; int p=n; for(int i=0;i<=n+m;i++) cin>>c[i]; int s=n+m; int mm=m+1; while(mm--){ if(c[s]==0) { ve.push_back(0); s--; continue; } int k=c[s]/a[p]; c[s]=0; ve.push_back(k); for(int i=1;i<=p;i++) c[s-i]-=a[p-i]*k; s--; } for(int i=ve.size();i<m+1;i++) ve.push_back(0); reverse(ve.begin(),ve.end()); for(int i=0;i<ve.size();i++) cout<<ve[i]<<" "; return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Polynomial division |
User | Rebirth |
Language | C++ (GCC 9.2.1) |
Score | 400 |
Code Size | 898 Byte |
Status | AC |
Exec Time | 8 ms |
Memory | 3576 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:49:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 49 | for(int i=0;i<ve.size();i++) | ~^~~~~~~~~~
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example_00.txt, example_01.txt |
All | example_00.txt, example_01.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
example_00.txt | AC | 8 ms | 3372 KB |
example_01.txt | AC | 2 ms | 3500 KB |
hand_00.txt | AC | 2 ms | 3516 KB |
hand_01.txt | AC | 4 ms | 3532 KB |
hand_02.txt | AC | 5 ms | 3532 KB |
hand_03.txt | AC | 2 ms | 3528 KB |
hand_04.txt | AC | 2 ms | 3420 KB |
hand_05.txt | AC | 2 ms | 3576 KB |
random_00.txt | AC | 2 ms | 3536 KB |
random_01.txt | AC | 3 ms | 3552 KB |
random_02.txt | AC | 2 ms | 3532 KB |
random_03.txt | AC | 2 ms | 3516 KB |
random_04.txt | AC | 3 ms | 3516 KB |
random_05.txt | AC | 2 ms | 3432 KB |
random_06.txt | AC | 2 ms | 3520 KB |
random_07.txt | AC | 3 ms | 3500 KB |
random_08.txt | AC | 2 ms | 3548 KB |
random_09.txt | AC | 2 ms | 3376 KB |
random_10.txt | AC | 2 ms | 3500 KB |
random_11.txt | AC | 2 ms | 3436 KB |