Submission #744135

# Submission time Handle Problem Language Result Execution time Memory
744135 2023-05-18T08:30:57 Z salmon Izvanzemaljci (COI21_izvanzemaljci) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
vector<pair<int,int>> v;
vector<pair<int,int>> o;
int N,K;
int a,b;
int st[400100];

int main(){
    scanf(" %d",&N);
    scanf(" %d",&K);

    int smalla,smallb;
    int biga,bigb;

    for(int i = 0; i < N; i++){
        v.push_back(make_pair(a,b));
        o.push_back(make_pair(b,a));
    }

    sort(v.begin(),v.end());
    sort(o.begin(),o.end())

    int l = max(1,max(v[v.size() - 1].first - v[0].first, o[o.size() - 1].first - o[0].second));

    printf("%d %d %d",smalla,smallb,l);

}

Compilation message

izvanzemaljci.cpp: In function 'int main()':
izvanzemaljci.cpp:22:28: error: expected ';' before 'int'
   22 |     sort(o.begin(),o.end())
      |                            ^
      |                            ;
   23 | 
   24 |     int l = max(1,max(v[v.size() - 1].first - v[0].first, o[o.size() - 1].first - o[0].second));
      |     ~~~                     
izvanzemaljci.cpp:26:37: error: 'l' was not declared in this scope
   26 |     printf("%d %d %d",smalla,smallb,l);
      |                                     ^
izvanzemaljci.cpp:14:9: warning: unused variable 'biga' [-Wunused-variable]
   14 |     int biga,bigb;
      |         ^~~~
izvanzemaljci.cpp:14:14: warning: unused variable 'bigb' [-Wunused-variable]
   14 |     int biga,bigb;
      |              ^~~~
izvanzemaljci.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     scanf(" %d",&N);
      |     ~~~~~^~~~~~~~~~
izvanzemaljci.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     scanf(" %d",&K);
      |     ~~~~~^~~~~~~~~~