結果
問題 | No.745 letinopia raoha |
ユーザー |
![]() |
提出日時 | 2018-10-22 10:47:26 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 570 bytes |
コンパイル時間 | 124 ms |
コンパイル使用メモリ | 22,528 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-19 03:39:28 |
合計ジャッジ時間 | 666 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 8 |
コンパイルメッセージ
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("%d %d %d %d", &a,&b,&c,&d); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main() { int a,b,c,d; scanf("%d %d %d %d", &a,&b,&c,&d); if (d>=10) { printf("Impossible\n"); return 0; } int score=0; int cnt=0; for (int i=1;;i*=2) { if (b>=100) { score+=50*i*100; b-=100; } else if (a!=0) { score+=50*i*b; cnt=(a>=100)?100-b:a-b; score+=100*i*cnt; b=0; a-=cnt; } else { break; } } printf("Possible\n%d\n", score); return 0; }