Submission #932944

#TimeUsernameProblemLanguageResultExecution timeMemory
932944skyvn97Teams (IOI15_teams)C++14
0 / 100
30 ms13140 KiB
#ifndef SKY #include "teams.h" #endif // SKY #include<bits/stdc++.h> using namespace std; #define MAX 300300 int numPerson, minTeam[MAX], maxTeam[MAX]; void init(int n, int a[], int b[]) { numPerson = n; for (int i = 1; i <= n; i++) { minTeam[i] = a[i - 1]; maxTeam[i] = b[i - 1]; } } int can(int M, int K[]) { long long sum = 0; for (int i = 0; i < M; i++) sum += K[i]; return sum <= numPerson; } #ifdef SKY /** * Input format: - Dong 1: N Q - N dong tiep: A[i] B[i] - Q dong tiep: M K[0] K[1] K[2]... QUAN TRONG: Ham main khong tuong tac voi bat ky bien toan cuc nao **/ int main(void) { freopen("sample.in", "r", stdin); int n, q, a[111], b[111]; cin >> n >> q; for (int i = 0; i < n; i++) cin >> a[i] >> b[i]; init(n, a, b); for (int i = 1; i <= q; i++) { int m; cin >> m; int k[111]; for (int j = 0; j < m; j++) cin >> k[j]; cout << can(m, k) << endl; } return 0; } #endif // SKY
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...