제출 #301342

#제출 시각아이디문제언어결과실행 시간메모리
301342infinite_iqCoins (IOI17_coins)C++14
0 / 100
3 ms1280 KiB
#include <bits/stdc++.h> using namespace std ; #define pb push_back typedef vector < int > vi ; #include "coins.h" vi coin_flips ( vi b , int c ) { int row = -1 , column = -1 ; for ( int i = 0 ; i < 8 ; i ++ ) { for ( int j = 0 ; j < 8 ; j ++ ) { if ( i * 8 + j == c ) { row = i ; column = j ; break ; } } } vi flips ; for ( int i = 0 ; i < 3 ; i ++ ) { int on = ( ( row & ( 1 << i ) ) > 0 ) ; if ( b [i] != on ) { flips .pb ( i ) ; } } for ( int i = 3 ; i < 6 ; i ++ ) { int on = ( ( column & ( 1 << ( i - 3 ) ) ) > 0 ) ; if ( b [i] != on ) { flips .pb ( i ) ; } } return flips ; } int find_coin ( vi b ) { int row = 0 , column = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { if ( b [i] == 1 ) { row |= ( 1 << i ) ; } } for ( int i = 3 ; i < 6 ; i ++ ) { if ( b [i] == 1 ) { column |= ( 1 << ( i - 3 ) ) ; } } return row * 8 + column ; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...