| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1360760 | avahw | Coins (IOI17_coins) | C++20 | 4 ms | 660 KiB |
#include "coins.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> coin_flips(std::vector<int> b, int c) {
vector<int> flips;
// encode row in row 0
int row = c / 8;
int col = c % 8;
// encode row in row 1
for(int i = 2; i >= 0; i--){
if(row >= pow(2, i)){
row -= pow(2, i);
if(b[i] != 1) flips.push_back(i);
}
else{
if(b[i] != 0) flips.push_back(i);
}
}
for(int i = 2; i >= 0; i--){
if(col >= pow(2, i)){
col -= pow(2, i);
if(b[i + 8] != 1){
flips.push_back(i + 8);
}
}
else{
if(b[i + 8] != 0){
flips.push_back(i + 8);
}
}
}
if(flips.size() == 0) flips.push_back(63);
return flips;
}
int find_coin(std::vector<int> b) {
int row = 0;
int col = 0;
// get row from row 0
for(int i = 0; i < 3; i++){
row += pow(2, i) * b[i];
}
// get col from row 1
for(int i = 0; i < 3; i++){
col += pow(2, i) * b[i + 8];
}
return (row * 8) + col;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
