답안 #626512

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
626512 2022-08-11T13:43:16 Z whynotshadow 메기 농장 (IOI22_fish) C++17
3 / 100
89 ms 7280 KB
#include "fish.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll N=1e5+9;
const ll INF=1e9;
long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y, std::vector<int> W) {
  ll ans=0,cnt=0,cntt=0,sum1=0,sum2=0;
  for(auto to:W){
    ans+=to;
  }
  for(auto to:X){
    if(to&1) cnt++;
    if(to<=1) cntt++;
  }
  if(cnt==0) return ans;
  else if(cntt==M){
    for(ll i=0; i<M; i++){
        if(X[i]==0) sum1+=W[i];
        else sum2+=W[i];
    }
    return max(sum1,sum2);
  }
}

Compilation message

fish.cpp: In function 'long long int max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 2152 KB Output is correct
2 Correct 26 ms 2636 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 89 ms 7280 KB Output is correct
6 Correct 86 ms 7272 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 14 ms 1460 KB 1st lines differ - on the 1st token, expected: '21261825233649', found: '26722445760742'
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '3', found: '2'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '3', found: '2'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '3', found: '2'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 14 ms 1460 KB 1st lines differ - on the 1st token, expected: '21261825233649', found: '26722445760742'
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 2152 KB Output is correct
2 Correct 26 ms 2636 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 89 ms 7280 KB Output is correct
6 Correct 86 ms 7272 KB Output is correct
7 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '2', found: '1'
8 Halted 0 ms 0 KB -