Submission #98889

#TimeUsernameProblemLanguageResultExecution timeMemory
98889bashExhibition (JOI19_ho_t2)C++17
Compilation error
0 ms0 KiB
/** SXR0aXAkI0JwbXptI3FhI3Z3I293bCNqY2IjUG0jMCNicG0jVHFkcXZvLyNCcG0jQW10bjBhY2phcWFicXZvLyNNYm16dml0MSNWdyNhdGN1am16I2tpdiNhbXF9bSNQcXUjVnd6I0F0bW14MSNQcWEjaXptI2l0dCNicHF2b2EjUXYjYnBtI3BtaWRtdmEjaXZsI3d2I21pemJwMSNFcHcjcWEjYnBtem0ja2l2I3F2Ym16a21sbSNRdiNQcWEjeHptYW12a20jbXtrbXhiI0lhI3BtI3htenVxYmJtYnBHI1BtI3N2d2VtYnAjRXBpYiMraXh4bWl6bWJwI2J3I1BxYSNrem1pYmN6bWEjSWEsI0ptbnd6bSN3eiNJbmJteiN3eiNKbXBxdmwjYnBtdTEjVnd6I2FwaXR0I2JwbXwja3d1eGlhYSNJY29wYiN3biNwcWEjc3Z3ZXRtbG9tI017a214YiNpYSNQbSNlcXR0bWJwMSNQcWEjYnB6d3ZtI2x3YnAjbXtibXZsI1dkbXojYnBtI3BtaWRtdmEjSXZsI3d2I21pemJwLyNpdmwjUG0jbm1tdG1icCNWdyNuaWJxb2NtI3F2I29jaXpscXZvI0l2bCN4em1hbXpkcXZvI2JwbXUvI053eiNQbSNxYSNicG0jVXdhYiNQcW9wMSNCcG0jQWN4em11bSMrcXYjb3R3enwsMQ== */ #include <cstring> #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <queue> #include <cmath> #include <cstdlib> #include <ctime> #include <cassert> #define F first #define S second #define endl '\n' #define deb(x) cout<<#x<<' '<<x<<endl; #define pb push_back const long long MAXN = 1e6 + 1; using namespace std; typedef long long ll; typedef pair<int, int> pii; long long readInt() { bool minus1 = false; long long result = 0; char ch; ch = getchar(); while (true) { if (ch == '-') break; if (ch >= '0' && ch <= '9') break; ch = getchar(); } if (ch == '-') minus1 = true; else result = ch-'0'; while (true) { ch = getchar(); if (ch < '0' || ch > '9') break; result = result*10 + (ch - '0'); } if (minus1) return -result; else return result; } #define int __int64 int s[MAXN]; int v[MAXN]; int c[MAXN]; main() { #ifdef IZI_KATKA assert(freopen("input", "r", stdin)); assert(freopen("output", "w", stdout)); #endif int n = readInt(), m = readInt(); vector <pair <int, int> > vec; for (int i = 1; i <= n; i++) { s[i] = readInt(), v[i] = readInt(); vec.pb({v[i], s[i]}); } sort(vec.begin(), vec.end()); for (int i = 0; i < m; i++) { c[i] = readInt(); } sort(c, c + m); int ans = 0; for (int i = n - 1; i >= 0 && ans < m; i--) { if (c[m - ans - 1] >= vec[i].S) { ans ++; } } cout << ans; return 0; }

Compilation message (stderr)

joi2019_ho_t3.cpp:61:13: error: '__int64' does not name a type; did you mean '__int64_t'?
 #define int __int64
             ^
joi2019_ho_t3.cpp:63:1: note: in expansion of macro 'int'
 int s[MAXN];
 ^~~
joi2019_ho_t3.cpp:61:13: error: '__int64' does not name a type; did you mean '__int64_t'?
 #define int __int64
             ^
joi2019_ho_t3.cpp:64:1: note: in expansion of macro 'int'
 int v[MAXN];
 ^~~
joi2019_ho_t3.cpp:61:13: error: '__int64' does not name a type; did you mean '__int64_t'?
 #define int __int64
             ^
joi2019_ho_t3.cpp:65:1: note: in expansion of macro 'int'
 int c[MAXN];
 ^~~
joi2019_ho_t3.cpp:67:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main() {
      ^
joi2019_ho_t3.cpp: In function 'int main()':
joi2019_ho_t3.cpp:61:13: error: '__int64' was not declared in this scope
 #define int __int64
             ^
joi2019_ho_t3.cpp:72:5: note: in expansion of macro 'int'
     int n = readInt(), m = readInt();
     ^~~
joi2019_ho_t3.cpp:61:13: note: suggested alternative: '__int64_t'
 #define int __int64
             ^
joi2019_ho_t3.cpp:72:5: note: in expansion of macro 'int'
     int n = readInt(), m = readInt();
     ^~~
joi2019_ho_t3.cpp:73:27: error: type/value mismatch at argument 1 in template parameter list for 'template<class _T1, class _T2> struct std::pair'
     vector <pair <int, int> > vec;
                           ^
joi2019_ho_t3.cpp:73:27: note:   expected a type, got '__int64'
joi2019_ho_t3.cpp:73:27: error: type/value mismatch at argument 2 in template parameter list for 'template<class _T1, class _T2> struct std::pair'
joi2019_ho_t3.cpp:73:27: note:   expected a type, got '__int64'
joi2019_ho_t3.cpp:73:29: error: template argument 1 is invalid
     vector <pair <int, int> > vec;
                             ^
joi2019_ho_t3.cpp:73:29: error: template argument 2 is invalid
joi2019_ho_t3.cpp:74:14: error: expected ';' before 'i'
     for (int i = 1; i <= n; i++) {
              ^
joi2019_ho_t3.cpp:74:21: error: 'i' was not declared in this scope
     for (int i = 1; i <= n; i++) {
                     ^
joi2019_ho_t3.cpp:74:26: error: 'n' was not declared in this scope
     for (int i = 1; i <= n; i++) {
                          ^
joi2019_ho_t3.cpp:74:26: note: suggested alternative: 'yn'
     for (int i = 1; i <= n; i++) {
                          ^
                          yn
joi2019_ho_t3.cpp:75:9: error: 's' was not declared in this scope
         s[i] = readInt(), v[i] = readInt();
         ^
joi2019_ho_t3.cpp:75:27: error: 'v' was not declared in this scope
         s[i] = readInt(), v[i] = readInt();
                           ^
joi2019_ho_t3.cpp:30:12: error: request for member 'push_back' in 'vec', which is of non-class type 'int'
 #define pb push_back
            ^
joi2019_ho_t3.cpp:76:13: note: in expansion of macro 'pb'
         vec.pb({v[i], s[i]});
             ^~
joi2019_ho_t3.cpp:78:14: error: request for member 'begin' in 'vec', which is of non-class type 'int'
     sort(vec.begin(), vec.end());
              ^~~~~
joi2019_ho_t3.cpp:78:27: error: request for member 'end' in 'vec', which is of non-class type 'int'
     sort(vec.begin(), vec.end());
                           ^~~
joi2019_ho_t3.cpp:79:14: error: expected ';' before 'i'
     for (int i = 0; i < m; i++) {
              ^
joi2019_ho_t3.cpp:79:21: error: 'i' was not declared in this scope
     for (int i = 0; i < m; i++) {
                     ^
joi2019_ho_t3.cpp:79:25: error: 'm' was not declared in this scope
     for (int i = 0; i < m; i++) {
                         ^
joi2019_ho_t3.cpp:79:25: note: suggested alternative: 'tm'
     for (int i = 0; i < m; i++) {
                         ^
                         tm
joi2019_ho_t3.cpp:80:9: error: 'c' was not declared in this scope
         c[i] = readInt();
         ^
joi2019_ho_t3.cpp:82:10: error: 'c' was not declared in this scope
     sort(c, c + m);
          ^
joi2019_ho_t3.cpp:82:17: error: 'm' was not declared in this scope
     sort(c, c + m);
                 ^
joi2019_ho_t3.cpp:82:17: note: suggested alternative: 'tm'
     sort(c, c + m);
                 ^
                 tm
joi2019_ho_t3.cpp:83:9: error: expected ';' before 'ans'
     int ans = 0;
         ^~~
joi2019_ho_t3.cpp:84:14: error: expected ';' before 'i'
     for (int i = n - 1; i >= 0 && ans < m; i--) {
              ^
joi2019_ho_t3.cpp:84:25: error: 'i' was not declared in this scope
     for (int i = n - 1; i >= 0 && ans < m; i--) {
                         ^
joi2019_ho_t3.cpp:84:35: error: 'ans' was not declared in this scope
     for (int i = n - 1; i >= 0 && ans < m; i--) {
                                   ^~~
joi2019_ho_t3.cpp:84:35: note: suggested alternative: 'abs'
     for (int i = n - 1; i >= 0 && ans < m; i--) {
                                   ^~~
                                   abs
joi2019_ho_t3.cpp:89:13: error: 'ans' was not declared in this scope
     cout << ans;
             ^~~
joi2019_ho_t3.cpp:89:13: note: suggested alternative: 'abs'
     cout << ans;
             ^~~
             abs