Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- const int maxtan = 100;
- const int maxver = 100;
- const int maxpon = 50;
- int N = 0;
- int M = 0;
- cin >> N;
- cin >> M;
- int minp[maxpon];
- int resztv[maxver];
- int szam[maxver][maxtan];
- int pont[maxver][maxtan];
- bool siker[maxver][maxtan];
- for (int i = 0; i < M; i++)
- {
- cin >> minp[i];
- }
- for (int i = 0; i < M; i++)
- {
- cin >> resztv[i];
- for (int j = 0; j < resztv[i]; j++)
- {
- cin >> szam[i][j];
- cin >> pont[i][j];
- }
- }
- int resztv2[M];
- for (int i = 0; i < M; i++)
- {
- resztv2[i] = 0;
- for (int j = 0; j < resztv[i]; j++)
- {
- if ( pont[i][j] >= minp[i] )
- {
- resztv2[i] = resztv2[i] + 1;
- siker[i][j] = true;
- }
- else
- {
- siker[i][j] = false;
- }
- }
- }
- for (int i = 0; i < M; i++)
- {
- cout << resztv2[i];
- for (int j = 0; j < resztv[i]; j++)
- {
- if ( siker[i][j] == true)
- {
- cout << " " << szam[i][j];
- }
- }
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement