Submission #1324973

#TimeUsernameProblemLanguageResultExecution timeMemory
1324973uranhishigTopical (NOI23_topical)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(a) (a).begin(),(a).end()
#define rep(i, n) for(int i = 0; i < (n); i++)
const int mod = 1000000007;
#define ff first
#define ss second
#define pii pair<int, int>


signed main(){
    int n, k;
    cin >> n >> k;
    int r[n][k];
    int u[n][k];
    rep (i, n) {
        rep (j, k) {
            cin>>r[i][j];
        }
    }
    rep (i, n) {
        rep (j, k) {
            cin>>u[i][j];
        }
    }
    vector<pii> v(n);
    for (int i = 0; i < n; i++) {
        v[i].ff = r[i][0];
        v[i].ss = u[i][0];
    }
    sort(v.begin(), v.end());
    int ans = 0;
    int x = 0;
    for (int i = 0; i < n; i++) {
        if (v[i].ff > x) break;
        ans++;
        x += s[i].ss;
    }
    cout << ans;
}

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:38:14: error: 's' was not declared in this scope
   38 |         x += s[i].ss;
      |              ^