当前位置: 首页>>代码示例>>C++>>正文


C++ Crossroads类代码示例

本文整理汇总了C++中Crossroads的典型用法代码示例。如果您正苦于以下问题:C++ Crossroads类的具体用法?C++ Crossroads怎么用?C++ Crossroads使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Crossroads类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: test24

int test24() {
    vector<int> angles = {114, 102, 76, 169, 97, 104, 46, 72, 63};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {0, 1, 4, 7, 8};
    if(result == expected) {
        cout << "Test Case 24: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 24: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例2: test52

int test52() {
    vector<int> angles = {166, 133, 145, 117, 123, 49, 138, 12, 130, 154, 62, 8};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {0, 1, 3, 10, 11};
    if(result == expected) {
        cout << "Test Case 52: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 52: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例3: test54

int test54() {
    vector<int> angles = {52, 10, 178, 31, 13, 40, 54, 141, 117, 15, 48, 25, 39};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {8, 10, 12};
    if(result == expected) {
        cout << "Test Case 54: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 54: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例4: test47

int test47() {
    vector<int> angles = {15, 61, 51, 93};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {3};
    if(result == expected) {
        cout << "Test Case 47: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 47: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例5: test3

int test3() {
    vector<int> angles = {90, 123, 1, 23, 132, 11, 28, 179, 179, 77, 113, 91};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {0};
    if(result == expected) {
        cout << "Test Case 3: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 3: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例6: test43

int test43() {
    vector<int> angles = {161, 37, 169, 23, 153, 80, 40, 114, 101, 112, 76, 3, 155, 26, 48, 53, 123};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {0, 5, 10};
    if(result == expected) {
        cout << "Test Case 43: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 43: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例7: test45

int test45() {
    vector<int> angles = {113, 73, 69, 5, 52, 107, 159, 78, 167, 96, 2, 175, 155, 79, 126, 60, 108, 90, 101, 7, 68, 42, 168, 154, 173};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {0, 9, 17, 20, 21};
    if(result == expected) {
        cout << "Test Case 45: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 45: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例8: test31

int test31() {
    vector<int> angles = {34, 111, 48, 45, 132, 142, 31, 128, 87, 15, 145, 154, 23, 56, 103, 85, 137, 35, 131, 179, 3, 116, 124, 32, 13, 50, 122, 151, 100, 67, 140, 42};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {1, 8, 15, 29, 31};
    if(result == expected) {
        cout << "Test Case 31: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 31: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例9: test32

int test32() {
    vector<int> angles = {42, 37, 174, 51, 5, 138, 28, 9, 2, 63, 116, 62, 75, 17, 98, 126, 61, 118, 157, 96, 103, 10, 84, 47, 77, 155, 88, 16, 102, 128, 140, 153, 53};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {10, 14, 19, 26, 32};
    if(result == expected) {
        cout << "Test Case 32: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 32: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例10: test29

int test29() {
    vector<int> angles = {141, 39, 58, 87, 2, 79, 91, 109, 136, 72, 63, 151, 169, 112, 179, 10, 101};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {0, 6};
    if(result == expected) {
        cout << "Test Case 29: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 29: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例11: test30

int test30() {
    vector<int> angles = {70, 55, 51, 5, 110, 71, 4, 6, 82, 154, 168, 72, 131, 145, 157, 105, 107, 15, 143, 83, 106, 102, 147, 121, 62, 2, 48, 42, 139, 67, 156, 21, 130, 113, 161, 33, 96, 162, 140, 173, 36, 171, 152, 160};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {36, 40};
    if(result == expected) {
        cout << "Test Case 30: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 30: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例12: test28

int test28() {
    vector<int> angles = {13, 121, 130, 36, 125, 111, 118, 98, 18, 9, 175, 84, 174, 131, 96, 122, 67, 70, 145, 31, 11};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {1, 5, 7, 11, 17, 19, 20};
    if(result == expected) {
        cout << "Test Case 28: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 28: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例13: test27

int test27() {
    vector<int> angles = {9, 52, 47, 73, 161, 128, 131, 71, 72, 162, 56, 70, 103, 64, 132, 134, 133, 25, 36, 49, 122, 164, 66, 93, 20, 163, 37, 118, 79, 124, 17, 15, 14, 5, 125, 26};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {12, 23, 28, 35};
    if(result == expected) {
        cout << "Test Case 27: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 27: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例14: test26

int test26() {
    vector<int> angles = {106, 13, 36, 28, 116, 82, 109, 125, 80, 123, 72, 150, 107, 171, 157, 71, 177, 34, 161, 103, 113};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {0, 5, 8};
    if(result == expected) {
        cout << "Test Case 26: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 26: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例15: test41

int test41() {
    vector<int> angles = {146, 9, 43, 161, 46, 49, 38, 42, 152, 157, 159, 110, 8, 32, 33, 64, 81, 34, 112, 98};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {0, 11, 19};
    if(result == expected) {
        cout << "Test Case 41: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 41: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp


注:本文中的Crossroads类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。