Rezultati

Up. imeNalogaJezikRezultatČas oddaje
Deathmask Prehitevanje C++ 0/100Prekoračen čas (TLE) 04. okt '18 @ 20:04

Test Točke Porabljen spomin Porabljen čas Status
#1 16/16 3,129 MiB 0,004 s OK
#2 16/16 3,043 MiB 0,010 s OK
#3 17/17 3,047 MiB 0,004 s OK
#4 0/17 3,484 MiB 4,556 s Prekoračen čas
#5 0/17 11,039 MiB 4,484 s Prekoračen čas
#6 17/17 3,039 MiB 0,000 s OK

Ocenjevani program (main.cpp):
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{

    vector <string> str;
    int n,p;
    cin>>n;
    for (int i=0;i<n;i++){
        string a;
        cin>>a;
        str.push_back(a);
    }
    cin>>p;
    for (int i=0;i<p;i++){
        string a,b;
        cin>>a>>b;
        for (int j=0;j<n;j++){
                if (str.at(j)==a){
                    str.erase(str.begin()+j);
                    break;
                }
        }

           for (int j=0;j<n;j++){
                if (str.at(j)==b){
                    str.insert(str.begin()+j,a);
                    break;
                }
        }


    }

    for (int i=0;i<n;i++){
        cout<<str.at(i)<<endl;

    }


/**
int pred;
cin>>pred;
for (int i=0;i<pred;i++){
    int x1,y1,x2,y2,xk,yk,r;
    cin>>x1>>y1>>x2>>y2>>xk>>yk>>r;
    int m, n , p, q;
    m = xk - r;
    n = xk + r;
    p = yk - r;
    q = yk + r;
    int x[4]={m,n,xk,xk};
    if((yk <= y2 && yk >= y1) && (m <= x2 && m >= x1))
        cout<<m<<" "<<yk<<endl;
    else if ((yk <= y2 && yk >= y1) && (n >= x1 && n <= x2))
        cout<<n<<" "<<yk<<endl;
    else if((xk >= x1 && xk <= x2) && (p <= y2 && p >= y1))
        cout<<xk<<" "<<p<<endl;
    else if ((xk >= x1 && xk <= x2) && (q >= y1 && q <= y2))
        cout<<xk<<" "<<q<<endl;
    else if(m < x1 &&n > x2 && p < y1 && q > y2)
        cout<<x1<<" "<<y1<<endl;
    else
        cout<<"Presek je prazen"<<endl;
        }
    return 0;
    **/
}