結果

問題 No.149 碁石の移動
ユーザー 👑tozangezan
提出日時 2015-02-22 16:26:32
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 215 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 33,608 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 02:53:23
合計ジャッジ時間 927 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
	int a,b,c,d,e,f;
	scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
	int ret=a;
	ret-=max(0,e-b);
	c+=max(0,e-b);
	ret+=min(f,c);
	printf("%d\n",ret);
}
0