제출 #1062620

#제출 시각아이디문제언어결과실행 시간메모리
1062620TsotneSVDetecting Molecules (IOI16_molecules)C++17
100 / 100
38 ms5712 KiB
#pragma once #include <bits/stdc++.h> using namespace std; /* /\_/\ (= ._.) / > \> */ #define fi first #define se second vector<int> find_subset(int l, int u, vector<int> w) { int n = w.size(); pair<int,int> A[n]; for(int i=0;i<n;i++) A[i] = {w[i],i}; sort(A,A+n); int lo = 0,hi = 0; long long sum = 0; while(hi < n) { sum += A[hi++].fi; while(sum > u) sum -= A[lo++].fi; if(sum >= l and sum <= u) { vector<int> ret(hi - lo); for(int i=lo;i<hi;i++) ret[i-lo] = A[i].se; return ret; } } return vector<int>(0); }

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

molecules.cpp:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
#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...