提出 #1644142
ソースコード 拡げる
#include <bits/stdc++.h>
#define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i))
#define RFOR(i,k,n) for (int (i)=(n)-1; (i)>=(k); --(i))
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define debug(x) cerr << #x <<": "<<x<<endl
#define debug2(x,y) cerr << #x <<": "<< (x) <<", "<< #y <<": "<< (y) << endl
#define answer(x) cout << (x) <<endl
#define answer_fixed(x, p) cout << fixed << setprecision(p) << (x) << endl
using namespace std;
int main() {
int N, S, T;
cin >> N >> S >> T;
int ans = 0;
while(S <= T) {
if(S == T) { break; }
T /= 2;
ans++;
}
if(S != T) { ans = -1; }
answer(ans);
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Camphor Tree |
| ユーザ | kn1cht |
| 言語 | C++14 (GCC 5.4.1) |
| 得点 | 100 |
| コード長 | 820 Byte |
| 結果 | AC |
| 実行時間 | 1 ms |
| メモリ | 256 KiB |
ジャッジ結果
| セット名 | All | ||
|---|---|---|---|
| 得点 / 配点 | 100 / 100 | ||
| 結果 |
|
| セット名 | テストケース |
|---|---|
| All | 00_sample, 01_sample, 02_sample, max_01, max_02, max_03, max_04, max_05, max_06, max_07, max_08, max_09, min_00 |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample | AC | 1 ms | 256 KiB |
| 01_sample | AC | 1 ms | 256 KiB |
| 02_sample | AC | 1 ms | 256 KiB |
| max_01 | AC | 1 ms | 256 KiB |
| max_02 | AC | 1 ms | 256 KiB |
| max_03 | AC | 1 ms | 256 KiB |
| max_04 | AC | 1 ms | 256 KiB |
| max_05 | AC | 1 ms | 256 KiB |
| max_06 | AC | 1 ms | 256 KiB |
| max_07 | AC | 1 ms | 256 KiB |
| max_08 | AC | 1 ms | 256 KiB |
| max_09 | AC | 1 ms | 256 KiB |
| min_00 | AC | 1 ms | 256 KiB |