제출 #821028

#제출 시각아이디문제언어결과실행 시간메모리
821028tolbi팀들 (IOI15_teams)C++17
컴파일 에러
0 ms0 KiB
#pragma optimize("Bismillahirrahmanirrahim"); //█▀█─█──█──█▀█─█─█ //█▄█─█──█──█▄█─█■█ //█─█─█▄─█▄─█─█─█─█ //Allahuekber //ahmet23 orz... //FatihSultanMehmedHan //YavuzSultanSelimHan //AbdulhamidHan //Sani buyuk Osman Pasa Plevneden cikmam diyor #define author tolbi #include <bits/stdc++.h> using namespace std; template<typename T> istream& operator>>(istream& is, vector<T> &v){for (auto &it : v) is>>it;return is;} template<typename T, size_t Y> istream& operator>>(istream& is, array<T,Y> &v){for (auto &it : v) is>>it;return is;} template<typename T> ostream& operator<<(ostream& os, vector<T> &v){for (auto &it : v) os<<it<<" ";return os;} template<typename T, size_t Y> ostream& operator<<(ostream& os, array<T,Y> &v){for (auto &it : v) os<<it<<" ";return os;} template<typename X, typename Y> istream& operator>>(istream& is, pair<X,Y> &pr){return is<<pr.first<<" "<<pr.second;} template<typename X, typename Y> ostream& operator<<(ostream& os, pair<X,Y> &pr){return os>>pr.first>>pr.second;} #define deci(x) int x;cin>>x; #define decstr(x) string x;cin>>x; #define vint(x) vector<int> x #define cinarr(x) for (auto &it : x) cin>>it; #define coutarr(x) for (auto &it : x) cout<<it<<" ";cout<<endl; #define sortarr(x) sort(x.begin(), x.end()) #define sortrarr(x) sort(x.rbegin(), x.rend()) #define rev(x) reverse(x.begin(), x.end()) #define endl '\n' #define tol(bi) (1LL<<((int)(bi))) typedef long long ll; const int MOD = 1e9+7; mt19937 ayahya(chrono::high_resolution_clock().now().time_since_epoch().count()); #include "teams.h" vector<pair<int,int>> arr; int query(int x){ int top = 0; for (int i = 0; i < arr.size(); i++){ if (arr[i].first<=x && arr[i].second>=x) top++; } return top; } int query(int l, int r){ int top = 0; for (int i = 0; i < arr.size(); i++){ if (arr[i].first<=l && arr[i].second>=r) top++; } return top; } void init(int N, int A[], int B[]) { arr.resize(N); for (int i = 0; i < N; i++){ arr.push_back({A[i],B[i]}); } sortarr(arr); } int can(int m, int k[]) { sort(k, k+m); priority_queue<int,vector<int>,greater<int>> pq; int lel = 0; for (int i = 0; i < m; i++){ int top = query(k[i]); int gec = 0; if (i<m-1) gec = query(k[i],k[i+1]); top-=gec; int kal = lel+k[i]; kal-=top; if (kal<=0){ lel=0; continue; } if (kal>gec) return 0; lel=kal; } return 1; } int main(){ }

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

teams.cpp:1: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
    1 | #pragma optimize("Bismillahirrahmanirrahim");
      | 
teams.cpp: In function 'int query(int)':
teams.cpp:37:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   37 |  for (int i = 0; i < arr.size(); i++){
      |                  ~~^~~~~~~~~~~~
teams.cpp: In function 'int query(int, int)':
teams.cpp:44:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   44 |  for (int i = 0; i < arr.size(); i++){
      |                  ~~^~~~~~~~~~~~
/usr/bin/ld: /tmp/ccJLqF3U.o: in function `main':
grader.c:(.text.startup+0x0): multiple definition of `main'; /tmp/ccCPqdSU.o:teams.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status