Submission #1293924

#TimeUsernameProblemLanguageResultExecution timeMemory
1293924eldaees131313Paprike (COI18_paprike)C++20
Compilation error
0 ms0 KiB
////////////////////////////// Author:eldaee, coder_viper!!!!!!!!!!!!!!!!!!!!!!!!11
#pragma GCC optimize ("Ofast")
#include <bits/stdc++.h>
#define int long long
#define str string
#define vec vector
#define dou double
#define ld long double
#define pb push_back
#define ppb pop_back
#define eb emplace_back
#define YES cout << "YES" << '\n'
#define Yes cout << "Yes" << '\n'
#define NO cout << "NO" << '\n'
#define No cout << "No" << '\n'
#define gcd __gcd
#define all(x) x.begin(),x.end()
#define eldaee ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
/*


*/
void solve() {
    
    int n, k;
    cin >> n >> k;
    int h[100005];
    for (int i = 0; i < n; i++) {
        cin >> h[i];
    }
    int x = 0;
    int sm = 0;
    for (int i = 0; i < n; i++) {
        sm += h[i];
        if (sm > k) {
            x++;
            sm = h[i];
        }
    }
    cout << x << "\n";
}

signed main()
{
    eldaee

    solve();
}

Compilation message (stderr)

paprike.cpp: In function 'void solve()':
paprike.cpp:26:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   26 |     cin >> n >> k;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:146,
                 from paprike.cpp:3:
/usr/include/c++/13/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
paprike.cpp:40:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   40 |     cout << x << "\n";
      |     ^~~~
      |     std::cout
/usr/include/c++/13/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
paprike.cpp: In function 'int main()':
paprike.cpp:18:16: error: 'ios_base' has not been declared
   18 | #define eldaee ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                ^~~~~~~~
paprike.cpp:45:5: note: in expansion of macro 'eldaee'
   45 |     eldaee
      |     ^~~~~~
paprike.cpp:18:46: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   18 | #define eldaee ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                              ^~~
paprike.cpp:45:5: note: in expansion of macro 'eldaee'
   45 |     eldaee
      |     ^~~~~~
/usr/include/c++/13/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
paprike.cpp:18:58: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 | #define eldaee ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                                          ^~~~
paprike.cpp:45:5: note: in expansion of macro 'eldaee'
   45 |     eldaee
      |     ^~~~~~
/usr/include/c++/13/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~