답안 #1002554

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1002554 2024-06-19T16:08:41 Z Andrey The Collection Game (BOI21_swaps) C++14
50 / 100
302 ms 1632 KB
#include "swaps.h"
#include<bits/stdc++.h>
using namespace std;

void solve(int n, int v) {
    vector<int> haha(n);
    for(int i = 0; i < n; i++) {
        haha[i] = i+1;
    }
    for(int i = 0; i < v; i++) {
        vector<pair<int,int>> wut(0);
        for(int j = i%2; j+1 < n; j+=2) {
            wut.push_back({j,j+1});
            schedule(haha[j],haha[j+1]);
        }
        vector<int> wow = visit();
        for(int j = 0; j < wow.size(); j++) {
            if(wow[j] == 0) {
                swap(haha[wut[j].first],haha[wut[j].second]);
            }
        }
    }
    answer(haha);
}

Compilation message

swaps.cpp: In function 'void solve(int, int)':
swaps.cpp:17:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |         for(int j = 0; j < wow.size(); j++) {
      |                        ~~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 32 ms 344 KB Correct
2 Correct 68 ms 416 KB Correct
3 Correct 165 ms 344 KB Correct
4 Correct 271 ms 580 KB Correct
5 Correct 244 ms 612 KB Correct
6 Correct 263 ms 660 KB Correct
7 Correct 254 ms 788 KB Correct
8 Correct 258 ms 1384 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 35 ms 344 KB Correct
2 Correct 74 ms 408 KB Correct
3 Correct 151 ms 344 KB Correct
4 Correct 265 ms 1516 KB Correct
5 Correct 247 ms 1232 KB Correct
6 Correct 262 ms 1136 KB Correct
7 Correct 255 ms 1400 KB Correct
8 Correct 282 ms 1196 KB Correct
9 Correct 54 ms 440 KB Correct
10 Correct 48 ms 544 KB Correct
11 Correct 48 ms 440 KB Correct
12 Correct 50 ms 924 KB Correct
13 Correct 48 ms 444 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 32 ms 344 KB Correct
2 Correct 86 ms 412 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 32 ms 344 KB Correct
2 Correct 86 ms 412 KB Correct
3 Correct 34 ms 344 KB Correct
4 Correct 83 ms 412 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 30 ms 344 KB Correct
2 Correct 66 ms 412 KB Correct
3 Correct 159 ms 344 KB Correct
4 Correct 276 ms 768 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 30 ms 344 KB Correct
2 Correct 66 ms 412 KB Correct
3 Correct 159 ms 344 KB Correct
4 Correct 276 ms 768 KB Correct
5 Correct 29 ms 344 KB Correct
6 Correct 77 ms 416 KB Correct
7 Correct 142 ms 344 KB Correct
8 Correct 256 ms 1628 KB Correct
9 Correct 246 ms 1276 KB Correct
10 Correct 262 ms 1184 KB Correct
11 Correct 295 ms 1208 KB Correct
12 Correct 260 ms 1208 KB Correct
13 Correct 32 ms 344 KB Correct
14 Correct 77 ms 412 KB Correct
15 Correct 161 ms 344 KB Correct
16 Correct 281 ms 1292 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 344 KB Correct
2 Correct 70 ms 344 KB Correct
3 Correct 149 ms 344 KB Correct
4 Correct 285 ms 1276 KB Correct
5 Correct 23 ms 536 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 344 KB Correct
2 Correct 70 ms 344 KB Correct
3 Correct 149 ms 344 KB Correct
4 Correct 285 ms 1276 KB Correct
5 Correct 23 ms 536 KB Correct
6 Correct 38 ms 344 KB Correct
7 Correct 88 ms 416 KB Correct
8 Correct 173 ms 344 KB Correct
9 Correct 255 ms 1124 KB Correct
10 Correct 265 ms 908 KB Correct
11 Correct 260 ms 1184 KB Correct
12 Correct 265 ms 1528 KB Correct
13 Correct 275 ms 1096 KB Correct
14 Correct 57 ms 1332 KB Correct
15 Correct 66 ms 640 KB Correct
16 Correct 52 ms 440 KB Correct
17 Correct 52 ms 1416 KB Correct
18 Correct 68 ms 444 KB Correct
19 Correct 29 ms 344 KB Correct
20 Correct 81 ms 412 KB Correct
21 Correct 164 ms 344 KB Correct
22 Correct 302 ms 1100 KB Correct
23 Correct 25 ms 444 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 31 ms 344 KB Correct
2 Correct 69 ms 592 KB Correct
3 Correct 139 ms 344 KB Correct
4 Correct 245 ms 1140 KB Correct
5 Correct 26 ms 636 KB Correct
6 Incorrect 5 ms 444 KB Not correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 31 ms 344 KB Correct
2 Correct 69 ms 592 KB Correct
3 Correct 139 ms 344 KB Correct
4 Correct 245 ms 1140 KB Correct
5 Correct 26 ms 636 KB Correct
6 Incorrect 5 ms 444 KB Not correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 31 ms 344 KB Correct
2 Correct 95 ms 416 KB Correct
3 Correct 145 ms 344 KB Correct
4 Correct 288 ms 1632 KB Correct
5 Correct 21 ms 440 KB Correct
6 Incorrect 4 ms 424 KB Not correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 31 ms 344 KB Correct
2 Correct 95 ms 416 KB Correct
3 Correct 145 ms 344 KB Correct
4 Correct 288 ms 1632 KB Correct
5 Correct 21 ms 440 KB Correct
6 Incorrect 4 ms 424 KB Not correct
7 Halted 0 ms 0 KB -