結果
| 問題 |
No.1869 Doubling?
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-11 22:39:30 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 220 bytes |
| コンパイル時間 | 445 ms |
| コンパイル使用メモリ | 27,264 KB |
| 最終ジャッジ日時 | 2025-01-28 08:52:51 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 WA * 9 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%u %u", &N, &M);
| ~~~~~^~~~~~~~~~~~~~~~~
ソースコード
#include<cstdio>
int main(){
unsigned N, M;
scanf("%u %u", &N, &M);
unsigned answer = 0;
while(N && M > 1){
answer += M;
M = (M+1)>>1;
N--;
}
printf("%u\n", answer + N);
}