답안 #172338

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
172338 2020-01-01T10:04:18 Z mohammad Detecting Molecules (IOI16_molecules) C++14
컴파일 오류
0 ms 0 KB
/*
░░░░██████████████████
░░▄███████▀▀▀▀▀▀███████▄
░▐████▀▒mohammad▒▀██████▄
░███▀▒▒▒▒alaa▒▒▒▒▒▒▀█████
░▐██▒▒▒alwrawrah▒▒▒▒▒████▌
░▐█▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌
░░█▒▄▀▀▀▀▀▄▒▒▄▀▀▀▀▀▄▒▐███▌
░░░▐░░░▄▄░░▌▐░░░▄▄░░▌▐███▌
░▄▀▌░░░▀▀░░▌▐░░░▀▀░░▌▒▀▒█▌
░▌▒▀▄░░░░▄▀▒▒▀▄░░░▄▀▒▒▄▀▒▌
░▀▄▐▒▀▀▀▀▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒█
░░░▀▌▒▄██▄▄▄▄████▄▒▒▒▒█▀
░░░░▄██████████████▒▒▐▌
░░░▀███▀▀████▀█████▀▒▌
░░░░░▌▒▒▒▄▒▒▒▄▒▒▒▒▒▒▐
░░░░░▌▒▒▒▒▀▀▀▒▒▒▒▒▒▒▐
*/
 
#include<bits/stdc++.h>
#include "molecules.h"
using namespace std;
 
typedef long long ll ;
const ll oo = 1e13 ;
const double PI = acos(-1) ;
const ll M = 1e9 + 7  ;

vector<pair<int,int>> v;
ll sum = 0 ;
vector<int> ans;

vector<int> find_subset(int l, int u, vector<int> w) {
	int idx = 0;
	for(int i = 0 ; i < w.size() ; ++i) v.push_back({w[i] , i});
	so	rt(v.begin(), v.end());
	for(int i = 0 ; i < w.size() ; ++i){
		sum += u ;
		while(sum > u) sum -= v[idx++].first;
		if(sum >= l){
			for(int j = idx ; j <= i ; ++j) ans.push_back(j);
			break;
		}
	}
	return ans;
}

Compilation message

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:35:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 0 ; i < w.size() ; ++i) v.push_back({w[i] , i});
                  ~~^~~~~~~~~~
molecules.cpp:36:2: error: 'so' was not declared in this scope
  so rt(v.begin(), v.end());
  ^~
molecules.cpp:36:2: note: suggested alternative: 'oo'
  so rt(v.begin(), v.end());
  ^~
  oo
molecules.cpp:37:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 0 ; i < w.size() ; ++i){
                  ~~^~~~~~~~~~