답안 #1011264

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1011264 2024-06-30T08:26:27 Z mindiyak 메기 농장 (IOI22_fish) C++17
3 / 100
56 ms 13908 KB
#include "fish.h"
#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <cmath>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<int, int> pl;
typedef pair<ld, ld> pd;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<ld> vd;
typedef vector<long> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i, a, b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i, a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto &a : x)
#define uid(a, b) uniform_int_distribution<int>(a, b)(rng)
#define len(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define F first
#define nl endl
#define S second
#define lb lower_bound
#define ub upper_bound
#define aint(x) x.begin(), x.end()
#define raint(x) x.rbegin(), x.rend()
#define ins insert
const int MOD = 1000000007;

long long max_weights(int N, int M, vector<int> X, vector<int> Y, vector<int> W) {
  bool sub1 = 1,sub2 = 1;
  for(int i:X){
    if(i%2 == 1)sub1 = 0;
    if(i>1)sub2=0;
  }


  if(sub1){
    ll ans = 0;
    for(int i:W)ans += i;
    return ans;
  }else if(sub2){
    ll ans1 = 0,ans2 = 0;
    FOR(i,0,N){
      if(X[i]==0)ans1+=W[i];
      if(X[i]==1)ans2+=W[i];
    }
    return max(ans1,ans2);
  }
  return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 3928 KB Output is correct
2 Correct 17 ms 4444 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 55 ms 13648 KB Output is correct
6 Correct 56 ms 13908 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 436 KB 1st lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 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 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '882019', found: '0'
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 3928 KB Output is correct
2 Correct 17 ms 4444 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 55 ms 13648 KB Output is correct
6 Correct 56 ms 13908 KB Output is correct
7 Incorrect 1 ms 436 KB 1st lines differ - on the 1st token, expected: '2', found: '1'
8 Halted 0 ms 0 KB -