# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
600895 |
2022-07-21T08:51:48 Z |
Arnch |
Viruses (BOI20_viruses) |
C++17 |
|
2 ms |
980 KB |
// oooo
/*
har chi delet mikhad bebar ~
gitar o ba khodet nabar! ~
;Amoo_Hasan;
*/
#include<bits/stdc++.h>
//#pragma GCC optimize("O3,no-stack-protector,unroll-loops")
//#pragma GCC target("avx2,fma")
using namespace std;
typedef long long ll;
typedef long double ld;
#define Sz(x) int((x).size())
#define All(x) (x).begin(), (x).end()
#define wtf(x) cout<<#x <<" : " <<x <<endl
constexpr ll inf = 1e18, N = 1e3 + 10;
int a[N], k[N];
int b[N][N];
ll dp[N];
vector<int> vc[N], ind[N];
int main() {
ios :: sync_with_stdio(0), cin.tie(0);
int g, n, m; cin >>g >>n >>m;
for(int i = 0; i < n; i++) {
cin >>a[i] >>k[i];
for(int j = 0; j < k[i]; j++) {
cin >>b[i][j];
}
ind[a[i]].push_back(i);
}
for(int i = 0; i < m; i++) {
int s; cin >>s;
for(int j = 0; j < s; j++) {
int u; cin >>u;
vc[i].push_back(u);
}
}
assert(m == 0);
for(int i = 0; i < N; i++) dp[i] = 100000000000000ll;
dp[0] = dp[1] = 1;
for(int tim = 0; tim < N; tim++) {
for(int i = 0; i < n; i++) {
ll cnt = 0;
for(int j = 0; j < k[i]; j++) {
cnt += dp[b[i][j]];
}
dp[a[i]] = min(dp[a[i]], cnt);
}
}
for(int i = 2; i < g; i++) {
if(dp[i] >= 100000000000000ll) cout<<"YES" <<endl;
else
cout<<"NO " <<dp[i] <<endl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
724 KB |
Output is correct |
2 |
Correct |
2 ms |
724 KB |
Output is correct |
3 |
Correct |
1 ms |
596 KB |
Output is correct |
4 |
Correct |
1 ms |
468 KB |
Output is correct |
5 |
Correct |
1 ms |
468 KB |
Output is correct |
6 |
Incorrect |
1 ms |
468 KB |
Output isn't correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
724 KB |
Output is correct |
2 |
Correct |
2 ms |
724 KB |
Output is correct |
3 |
Runtime error |
2 ms |
980 KB |
Execution killed with signal 6 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
980 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
724 KB |
Output is correct |
2 |
Correct |
2 ms |
724 KB |
Output is correct |
3 |
Correct |
1 ms |
596 KB |
Output is correct |
4 |
Correct |
1 ms |
468 KB |
Output is correct |
5 |
Correct |
1 ms |
468 KB |
Output is correct |
6 |
Incorrect |
1 ms |
468 KB |
Output isn't correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
724 KB |
Output is correct |
2 |
Correct |
2 ms |
724 KB |
Output is correct |
3 |
Correct |
1 ms |
596 KB |
Output is correct |
4 |
Correct |
1 ms |
468 KB |
Output is correct |
5 |
Correct |
1 ms |
468 KB |
Output is correct |
6 |
Incorrect |
1 ms |
468 KB |
Output isn't correct |
7 |
Halted |
0 ms |
0 KB |
- |