제출 #210202

#제출 시각아이디문제언어결과실행 시간메모리
210202sealnot123Detecting Molecules (IOI16_molecules)C++14
0 / 100
5 ms376 KiB
#include "molecules.h"
//#include "grader.cpp"

#include<bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define all(a) (a).begin(),(a).end()
#define SZ(a) (int)(a).size()

using namespace std;

typedef pair<int,int> PII;
typedef long long LL;
typedef double DD;
typedef long double LD;
typedef pair<LL,LL> PLL;
typedef pair<DD,DD> PDD;
typedef vector<int> VI;
typedef vector<LL> VL;
const int N=200007;

VI ans;
int n;

VI find_subset(int l, int r, VI w) {
    sort(all(w));
    int i,j,k,a,b,c,d;
    LL sum = 0;
    for(int e: w) sum += e;
    if(sum < l) return ans;
	if(w[0] > r) return ans;
	n = SZ(w);
	LL last = 0;
	for(i=n-1;i>=0;i--){
		if(-sum+w[i] >= last){
			ans.pb(i);
			last += w[i];
		}
		sum -= w[i];
	}
	return ans;
}

컴파일 시 표준 에러 (stderr) 메시지

molecules.cpp: In function 'VI find_subset(int, int, VI)':
molecules.cpp:27:11: warning: unused variable 'j' [-Wunused-variable]
     int i,j,k,a,b,c,d;
           ^
molecules.cpp:27:13: warning: unused variable 'k' [-Wunused-variable]
     int i,j,k,a,b,c,d;
             ^
molecules.cpp:27:15: warning: unused variable 'a' [-Wunused-variable]
     int i,j,k,a,b,c,d;
               ^
molecules.cpp:27:17: warning: unused variable 'b' [-Wunused-variable]
     int i,j,k,a,b,c,d;
                 ^
molecules.cpp:27:19: warning: unused variable 'c' [-Wunused-variable]
     int i,j,k,a,b,c,d;
                   ^
molecules.cpp:27:21: warning: unused variable 'd' [-Wunused-variable]
     int i,j,k,a,b,c,d;
                     ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...