200702025-12-31 14:27:40szabelrBeszerzéscpp17Wrong answer 19/5028ms2208 KiB
// Beszerzés.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, m, k;
    cin >> n >> m >> k;
    vector<vector<pair<int,int>>> etelek(n + 1);
    vector<int> alapanyagok(k + 1, 0);
    for (int i = 1; i <= n; i++) {
        int x;
        cin >> x;
        for (int y = 0; y < x; y++)
        {
            int q, z;
            cin >> q >> z;
            etelek[i].push_back({ q,z });
        }
    }
    vector<int>db(n + 1, 0);
    for (int i = 1; i <= m; i++)
    {
        int x;
        cin >> x;
        for (int y = 0; y < x; y++)
        {
            int z, q;
            cin >> z >> q;
            db[z] = db[z]+ q;
        }
    }
    for (int i = 1; i <= n; i++)
    {
        if(db[i]!=0)
        {
            for (auto a : etelek[i])
            {
                alapanyagok[a.first] += a.second * db[i];
            }
        }
        
    }
    for (int i = 1; i <= k; i++)
        cout << alapanyagok[i] << " ";
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms316 KiB
subtask27/7
2Accepted20ms1708 KiB
3Accepted20ms1712 KiB
4Accepted20ms1712 KiB
5Accepted20ms1712 KiB
6Accepted20ms1912 KiB
subtask312/12
7Accepted1ms512 KiB
8Accepted1ms316 KiB
9Accepted1ms316 KiB
10Accepted1ms316 KiB
11Accepted2ms316 KiB
12Accepted2ms316 KiB
13Accepted1ms316 KiB
14Accepted1ms316 KiB
15Accepted1ms500 KiB
16Accepted1ms528 KiB
17Accepted1ms316 KiB
subtask40/13
18Accepted20ms1708 KiB
19Accepted20ms1712 KiB
20Accepted20ms1712 KiB
21Accepted20ms1712 KiB
22Accepted20ms1912 KiB
23Accepted19ms1592 KiB
24Accepted20ms1640 KiB
25Accepted20ms1684 KiB
26Accepted20ms1708 KiB
27Accepted21ms1644 KiB
28Accepted24ms1712 KiB
29Accepted21ms1896 KiB
30Accepted21ms1756 KiB
31Accepted23ms1712 KiB
32Accepted24ms1812 KiB
33Wrong answer25ms1968 KiB
34Accepted23ms1988 KiB
35Accepted19ms1712 KiB
36Accepted23ms1716 KiB
subtask50/18
37Accepted1ms512 KiB
38Accepted20ms1708 KiB
39Accepted20ms1712 KiB
40Accepted20ms1712 KiB
41Accepted20ms1712 KiB
42Accepted20ms1912 KiB
43Accepted1ms316 KiB
44Accepted1ms316 KiB
45Accepted1ms316 KiB
46Accepted2ms316 KiB
47Accepted2ms316 KiB
48Accepted1ms316 KiB
49Accepted1ms316 KiB
50Accepted1ms500 KiB
51Accepted1ms528 KiB
52Accepted1ms316 KiB
53Accepted19ms1592 KiB
54Accepted20ms1640 KiB
55Accepted20ms1684 KiB
56Accepted20ms1708 KiB
57Accepted21ms1644 KiB
58Accepted24ms1712 KiB
59Accepted21ms1896 KiB
60Accepted21ms1756 KiB
61Accepted23ms1712 KiB
62Accepted24ms1812 KiB
63Wrong answer25ms1968 KiB
64Accepted23ms1988 KiB
65Accepted19ms1712 KiB
66Accepted23ms1716 KiB
67Wrong answer27ms1616 KiB
68Wrong answer27ms1636 KiB
69Wrong answer26ms1664 KiB
70Wrong answer25ms1600 KiB
71Accepted21ms1624 KiB
72Accepted28ms1800 KiB
73Accepted28ms1588 KiB
74Accepted28ms1884 KiB
75Accepted26ms1844 KiB
76Accepted26ms1812 KiB
77Accepted28ms2208 KiB
78Accepted23ms1812 KiB