답안 #626815

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
626815 2022-08-11T20:50:51 Z ionan6ix 메기 농장 (IOI22_fish) C++17
3 / 100
97 ms 7280 KB
#include "fish.h"

#include <vector>
#include<bits/stdc++.h>
using namespace std;

long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y,
                      std::vector<int> W) {

    bool flag = true;

    for(auto it:X)
        if(it%2)
        {
            flag = false;
            break;
        }

    if(flag)
    {
        long long sol = 0;
        for(auto it:W)
            sol+=it;

        return sol;
    }

    flag = true;

    for(auto it:X)
        if(it>1)
        {
            flag = false;
            break;
        }

    if(flag)
    {
        std::vector<pair<int,int> > y0;
        std::vector<pair<int,int> > y1;

        long long sum0 = 0LL;
        long long sum1 = 0LL;
        
        int sz = X.size();

        for(int i=0;i<sz;i++)
            if(X[i]==0) sum0+=1LL*W[i];
                else sum1+=1LL*W[i];

        return max(sum0,sum1);
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 2156 KB Output is correct
2 Correct 27 ms 2620 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 97 ms 7280 KB Output is correct
6 Correct 89 ms 7268 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 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '882019', found: '0'
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '3', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '3', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '3', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '882019', found: '0'
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 2156 KB Output is correct
2 Correct 27 ms 2620 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 97 ms 7280 KB Output is correct
6 Correct 89 ms 7268 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 -