Cod sursa(job #1486631)

Utilizator tudormaximTudor Maxim tudormaxim Data 15 septembrie 2015 11:46:55
Problema A+B Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 1.55 kb
/*#include <bits\stdc++.h>

using namespace std;
const int nmax = 100005;
vector <pair<int,int> > g[nmax];
int n, m, a, b, c, d[nmax];

class cmp
 {
    public:
        bool operator () (const int &x, const int &y)
        {
            return d[x] > d[y];
        }
 };

void dijkstra(int start, int v[nmax])
{
    priority_queue <int, vector<int>, cmp> h;
    int dad, son, cost, i;
    for(i=1; i<=n; i++)
        d[i]=(1<<29);
    d[start]=0;
    h.push(start);
    while(!h.empty())
    {
        dad=h.top();
        h.pop();
        for(i=0; i<g[dad].size(); i++)
        {
            son=g[dad][i].first;
            cost=g[dad][i].second;
            if(d[son] > d[dad]+cost)
            {
                d[son]=d[dad]+cost;
                h.push(son);
            }
        }
    }
    for(i=1; i<=n; i++) v[i]=d[i];
}
int main()
{
    freopen("trilant.in", "r", stdin);
    freopen("trilant.out", "w", stdout);
    int x, y, c, da[nmax], db[nmax], dc[nmax], i;
    scanf("%d %d %d %d %d", &n, &m, &a, &b, &c);
    while(m--)
    {
        scanf("%d %d %d", &x, &y, &c);
        g[x].push_back(make_pair(y, c));
        g[y].push_back(make_pair(x, c));
    }
    dijkstra(a, da);
    dijkstra(b, db);
    dijkstra(c, dc);

    fclose(stdin);
    fclose(stdout);
    return 0;
}*/
#include <fstream>

using namespace std;

int main()
{
    ifstream in("adunare.in");
    ofstream out("adunare.out");
    int a,b,s;
    in>>a>>b;
    s=a+b;
    out<<s;
    in.close();
    out.close();
    return 0;
}