# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
666245 |
2022-11-27T21:00:15 Z |
Banan |
Catfish Farm (IOI22_fish) |
C++17 |
|
91 ms |
10188 KB |
#include "fish.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define double long double
#define endl '\n'
#define sz(a) (int)a.size()
#define pb push_back
#define fs first
#define sc second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
ll const INF = LONG_LONG_MAX;
long long max_weights(int n, int m, std::vector<int> x, std::vector<int> y, std::vector<int> w)
{
ll ans1=0, ans2=0, ans=0;
if(n==2)
{
for(int i=0;i<m;i++)
{
if(x[i]==0){ans1+=w[i];}
else{ans2+=w[i];}
}
ans=max(ans1, ans2);
}
else
{
vector<ll> val(n, 0);
for(int i=0;i<m;i++)
{
if(x[i]==0){val[y[i]]+=w[i];}
else if(x[i]==1) {ans+=w[i];val[y[i]]-=w[i];}
}
ll cur=ans;
for(int i=0;i<n;i++)
{
cur+=val[i];
ans=max(ans, cur);
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
24 ms |
4168 KB |
Output is correct |
2 |
Correct |
30 ms |
5044 KB |
Output is correct |
3 |
Correct |
1 ms |
980 KB |
Output is correct |
4 |
Correct |
1 ms |
980 KB |
Output is correct |
5 |
Incorrect |
91 ms |
10188 KB |
1st lines differ - on the 1st token, expected: '149814460735479', found: '0' |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
48 ms |
7556 KB |
Output is correct |
3 |
Correct |
57 ms |
9152 KB |
Output is correct |
4 |
Correct |
24 ms |
4296 KB |
Output is correct |
5 |
Correct |
30 ms |
5196 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
300 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
2 ms |
980 KB |
Output is correct |
11 |
Correct |
1 ms |
1068 KB |
Output is correct |
12 |
Correct |
24 ms |
4324 KB |
Output is correct |
13 |
Correct |
28 ms |
5160 KB |
Output is correct |
14 |
Correct |
24 ms |
4276 KB |
Output is correct |
15 |
Correct |
30 ms |
4688 KB |
Output is correct |
16 |
Correct |
26 ms |
4316 KB |
Output is correct |
17 |
Correct |
30 ms |
4660 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
980 KB |
Output is correct |
2 |
Incorrect |
2 ms |
980 KB |
1st lines differ - on the 1st token, expected: '882019', found: '0' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
296 KB |
1st lines differ - on the 1st token, expected: '3', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
296 KB |
1st lines differ - on the 1st token, expected: '3', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
296 KB |
1st lines differ - on the 1st token, expected: '3', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
980 KB |
Output is correct |
2 |
Incorrect |
2 ms |
980 KB |
1st lines differ - on the 1st token, expected: '882019', found: '0' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
24 ms |
4168 KB |
Output is correct |
2 |
Correct |
30 ms |
5044 KB |
Output is correct |
3 |
Correct |
1 ms |
980 KB |
Output is correct |
4 |
Correct |
1 ms |
980 KB |
Output is correct |
5 |
Incorrect |
91 ms |
10188 KB |
1st lines differ - on the 1st token, expected: '149814460735479', found: '0' |
6 |
Halted |
0 ms |
0 KB |
- |