Rezultati

Up. imeNalogaJezikRezultatČas oddaje
Aquasonic-2018 Plezalne smeri C++ 100/100OK 13. okt '18 @ 10:56

Test Točke Porabljen spomin Porabljen čas Status
#1 50/50 3,066 MiB 0,000 s OK
#2 50/50 3,066 MiB 0,000 s OK

Ocenjevani program (main.cpp):
#include <bits/stdc++.h>

#define f first
#define s second
#define pb push_back
#define mp make_pair

#define INF (1 << 30)

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;

const int maxn = 2e5 + 17;

int N, K;
int in[maxn];

int main()
{
    int n;
    cin>>n;
    vector<pair<int, string> > v;
    map<string,int> m;
    m["I"]=1;
    m["II"]=2;
    m["III"]=3;
    m["IV"]=4;
    m["V"]=5;
    m["VI"]=6;
    m["VII"]=7;
    m["VIII"]=8;
    m["IX"]=9;
    m["X"]=10;
    m["XI"]=11;
    m["XII"]=12;
    for(int i=0;i<n;i++)
    {
        string a,b;
        cin>>a>>b;
        string broj="";
        string znak="";
        for(int j=0;j<b.size();j++)
        {
            if(b[j]=='+'||b[j]=='-')
                znak+=b[j];
            else
                broj+=b[j];
        }
        int bro=m[broj]*3-2;
        if(znak.size()==1){
        if(znak[0]=='-') bro--;
        else if(znak[0]=='+') bro++;
        }
        v.push_back(make_pair(bro,a));
    }
    sort(v.begin(),v.end());
    for(int i=0;i<v.size();i++)
    {
    cout<<v[i].second<<endl;
    }

    return 0;
}