답안 #1026356

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1026356 2024-07-18T02:25:30 Z Mardonbekhazratov 메기 농장 (IOI22_fish) C++17
3 / 100
191 ms 17456 KB
#include "fish.h"

#include <iostream>
#include <vector>
#include <tuple>
#include <set>
#include <map>

using namespace std;
#define ll long long

int n,m;
vector<int>x,y,w;
ll ans=0;

long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y, std::vector<int> W) {
    tie(n,m,x,y,w)=tie(N,M,X,Y,W);
    bool su1=true,su2=true;
    for(int i=0;i<m;i++){
        if(x[i]%2==1) su1=false;
        if(x[i]>1) su2=false;
    }
    if(su1){for(int i=0;i<m;i++) ans+=w[i];return ans;}
    if(su2){
        set<pair<int,int>>s;
        map<int,int>id;
        for(int i=0;i<m;i++){
            s.insert({x[i],y[i]});
            if(x[i]==1) id[y[i]]=i;
        }
        for(int i=0;i<m;i++){
            if(x[i]==0 && s.find({1,y[i]})!=s.end()){
                ans+=max(w[i],w[id[y[i]]]);
            }
            else if(x[i]==1 && s.find({0,y[i]})!=s.end()){}
            else ans+=w[i];
        }
        return ans;
    }
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 15 ms 3164 KB Output is correct
2 Correct 18 ms 3932 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 54 ms 10868 KB Output is correct
6 Correct 59 ms 10868 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 191 ms 17456 KB 1st lines differ - on the 1st token, expected: '40604614618209', found: '56666856824716'
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 1 ms 348 KB 1st lines differ - on the 1st token, expected: '882019', found: '0'
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '3', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '3', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '3', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 1 ms 348 KB 1st lines differ - on the 1st token, expected: '882019', found: '0'
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 15 ms 3164 KB Output is correct
2 Correct 18 ms 3932 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 54 ms 10868 KB Output is correct
6 Correct 59 ms 10868 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Incorrect 191 ms 17456 KB 1st lines differ - on the 1st token, expected: '40604614618209', found: '56666856824716'
9 Halted 0 ms 0 KB -