結果

問題 No.477 MVP
ユーザー sasa
提出日時 2025-03-10 13:13:26
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 202 bytes
コンパイル時間 428 ms
コンパイル使用メモリ 27,520 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2025-03-10 13:13:27
合計ジャッジ時間 918 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:13:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
   13 |         printf("%d",ans );
      |                 ~^  ~~~
      |                  |  |
      |                  |  long long int
      |                  int
      |                 %lld
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%lld",&HP);
      |         ~~~~~^~~~~~~~~~~~
main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         scanf("%d",&num);
      |         ~~~~~^~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(){
	// 総HP
	long long HP = 0;
	scanf("%lld",&HP);
	// MVPの人数
	int num = 0;
	scanf("%d",&num);
	
	long long ans = HP / (num + 1);
	
	printf("%d",ans );
	
	return 0;
}
0