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


C++ Crossroads::getOut方法代码示例

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


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

示例1: test22

int test22() {
    vector<int> angles = {108, 141, 104, 26, 40, 69, 1, 75, 15, 119, 154, 12, 146, 124, 144, 95, 123, 131, 140, 6, 156, 116, 127, 16, 99, 170, 11, 50, 176, 112, 53, 166, 66, 125, 28, 44, 94, 162, 20, 80, 31, 175, 139, 38, 82, 135, 21, 73};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {0, 2, 15, 36, 44, 47};
    if(result == expected) {
        cout << "Test Case 22: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 22: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例2: test23

int test23() {
    vector<int> angles = {178, 7, 46, 34, 45, 28, 112, 159, 169, 36, 140, 116, 118, 163, 82, 165, 119};
    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, 14};
    if(result == expected) {
        cout << "Test Case 23: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 23: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例3: 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

示例4: test7

int test7() {
    vector<int> angles = {38, 140, 152, 179, 110, 71, 48, 54, 151, 5, 68, 17, 122, 11, 2, 165, 50, 49, 106, 124, 150, 131, 87, 37, 134, 84, 83, 170, 20, 108, 69, 132, 103, 65, 28, 41, 77, 144, 93, 178, 135, 62, 31, 118};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {1, 4, 18, 22, 41};
    if(result == expected) {
        cout << "Test Case 7: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 7: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例5: 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

示例6: 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

示例7: test13

int test13() {
    vector<int> angles = {44, 34, 109, 126, 105, 63, 89, 15, 133, 110, 112, 124, 145, 27, 104, 156, 164, 111, 131, 8, 120, 175, 57, 102, 55, 32, 20, 153, 134, 28, 59, 14, 115, 147, 98, 81, 74, 54, 84, 90, 58, 149, 172, 157, 130, 170};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {2, 4, 39, 40};
    if(result == expected) {
        cout << "Test Case 13: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 13: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例8: 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

示例9: test11

int test11() {
    vector<int> angles = {108, 134, 46, 26, 1, 11, 145, 153, 38, 21, 100, 3, 82, 135, 123, 98, 14, 79, 37, 125, 52, 42, 104, 96, 113, 29, 91, 173, 166, 35, 61, 32, 179, 18, 112, 17};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {0, 10, 23, 26, 35};
    if(result == expected) {
        cout << "Test Case 11: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 11: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例10: test12

int test12() {
    vector<int> angles = {167, 9, 161, 52, 41, 138, 74, 37, 113, 109, 81, 84, 108, 114, 154, 149, 112, 130, 102, 68, 33, 133, 100};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {0, 2, 11};
    if(result == expected) {
        cout << "Test Case 12: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 12: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例11: test10

int test10() {
    vector<int> angles = {151, 23, 20, 134, 57, 169, 52, 61, 26, 132, 150};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {0, 3, 7};
    if(result == expected) {
        cout << "Test Case 10: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 10: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例12: test9

int test9() {
    vector<int> angles = {86, 23, 66, 150, 7, 93, 119, 77, 19, 170, 165, 99, 62, 85, 68, 152, 57, 82, 49, 177, 54, 133, 102, 36, 137, 151, 72, 90, 160, 5, 179, 103, 10, 96, 35, 113, 118};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {5, 27};
    if(result == expected) {
        cout << "Test Case 9: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 9: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例13: test8

int test8() {
    vector<int> angles = {12, 126, 91, 27, 171, 26, 163, 125, 55, 77, 13, 174, 123, 28, 158, 148, 105, 35, 32, 147, 86, 132, 73, 51, 102, 136};
    Crossroads* pObj = new Crossroads();
    clock_t start = clock();
    vector<int> result = pObj->getOut(angles);
    clock_t end = clock();
    delete pObj;
    vector<int> expected = {1, 2, 20};
    if(result == expected) {
        cout << "Test Case 8: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 8: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp

示例14: 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

示例15: test15

int test15() {
    vector<int> angles = {19, 91, 41, 52, 165, 99, 119, 21, 89, 68, 143, 92, 69, 124, 96, 109, 71};
    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, 16};
    if(result == expected) {
        cout << "Test Case 15: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 0;
    } else {
        cout << "Test Case 15: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
        return 1;
    }
}
开发者ID:rick-qiu,项目名称:topcoder,代码行数:16,代码来源:srm217_crossroads.cpp


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