답안 #1104061

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1104061 2024-10-22T16:02:16 Z asdfghjk Detecting Molecules (IOI16_molecules) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define all(x) x.begin(), x.end()
#define F first
#define ld long double
#define S second
using namespace std;
const ll N = 4e5 + 5;
const ll NN = 4e5 + 5;
const ll INF = 1e18;
const ll inf = 1e9;
const ll MOD = 1e9 + 7;
vector <int> find_subset(int l,int r,vector <int> a){
    vector <int> ans;
    ans.clear();
    bool sub1 = 1;
    for(int i = 1;i < a.size();i++){
        if(a[i] != a[i- 1]){
            sub1 = 0;
            break;
        }
    }
    if(sub1 == 1 && n <= 100 && max(l,r) <= 100){
        l = (l / a[0]) + (l % a[0] != 0);
        r = (r / a[0]);
        if(l <= r){
            for(int i = 1;i <= l;i++){
                ans.pb(a[0]);
            }
        }
    }
    return ans;
}
void solve(){

}
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
//    fflush(stdout);
    ll abd =1;
//    cin >>abd;
    for(ll i = 1;i <= abd;i++){
        solve();
    }
}

Compilation message

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:18:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |     for(int i = 1;i < a.size();i++){
      |                   ~~^~~~~~~~~~
molecules.cpp:24:21: error: 'n' was not declared in this scope
   24 |     if(sub1 == 1 && n <= 100 && max(l,r) <= 100){
      |                     ^
molecules.cpp: At global scope:
molecules.cpp:38:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   38 | main(){
      | ^~~~