제출 #963820

#제출 시각아이디문제언어결과실행 시간메모리
963820marinalucaDetecting Molecules (IOI16_molecules)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "molecules.h" //#include <ext/pb_ds/assoc_container.hpp> #pragma GCC optimize ("O4") #pragma GCC optimize ("fast-math") #pragma GCC optimize ("unroll-loops") using namespace std; #define int long long #define ll long long #define XX first #define YY second #define pb push_back #define sz (x) int(x.size()) #define pf pop_front #define pob pop_back #define pff push_front /*_____________defines---------------*/ typedef dl double; typedef ldb long double; typedef vii vector <int>; typedef pid pair <double, double>; typedef pii pair <int, int>; typedef ull unsigned long long; /*____________typedefs---------------*/ vector <int> find_subset (const int l, const int u, vector <int> w){ vector < pair <int, int>> ans; vector <int> v; for (int i = 0; i < w.size(); ++ i){ ans.push_back({w[i], i}); } sort (ans.begin(), ans.end()); for (int i = 0, sum = 0, cnt = 0; i < w.size(); ++ i){ sum += ans[i].first; while (sum > u){ sum -= ans[i].first; ++ cnt; } if (sum >= l){ for (int idx = cnt; idx <= i; ++ idx){ v.push_back(ans[idx].second); } break; } } return v; } /** signed main(void){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); return 0 ^ 0; }

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

molecules.cpp:51:1: error: unterminated comment
   51 | /**
      | ^
molecules.cpp:21:9: error: 'dl' does not name a type; did you mean 'll'?
   21 | typedef dl double;
      |         ^~
      |         ll
molecules.cpp:22:9: error: 'ldb' does not name a type
   22 | typedef ldb long double;
      |         ^~~
molecules.cpp:23:9: error: 'vii' does not name a type
   23 | typedef vii vector <int>;
      |         ^~~
molecules.cpp:24:9: error: 'pid' does not name a type
   24 | typedef pid pair <double, double>;
      |         ^~~
molecules.cpp:25:9: error: 'pii' does not name a type
   25 | typedef pii pair <int, int>;
      |         ^~~
molecules.cpp:26:9: error: 'ull' does not name a type; did you mean 'll'?
   26 | typedef ull unsigned long long;
      |         ^~~
      |         ll
molecules.cpp: In function 'std::vector<long long int> find_subset(long long int, long long int, std::vector<long long int>)':
molecules.cpp:32:23: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |     for (int i = 0; i < w.size(); ++ i){
      |                     ~~^~~~~~~~~~
molecules.cpp:36:41: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |     for (int i = 0, sum = 0, cnt = 0; i < w.size(); ++ i){
      |                                       ~~^~~~~~~~~~