結果
| 問題 |
No.143 豆
|
| コンテスト | |
| ユーザー |
👑tozangezan
|
| 提出日時 | 2015-02-22 16:32:14 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 219 bytes |
| コンパイル時間 | 226 ms |
| コンパイル使用メモリ | 33,740 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-23 10:16:37 |
| 合計ジャッジ時間 | 863 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
コンパイルメッセージ
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",&a,&b,&c);
| ~~~~~^~~~~~~~~~~~~~~~~~~
main.cpp:9:28: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | int d;scanf("%d",&d);a-=d;
| ~~~~~^~~~~~~~~
ソースコード
#include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
a*=b;
for(int i=0;i<c;i++){
int d;scanf("%d",&d);a-=d;
}
if(a<0)printf("-1\n");else printf("%d\n",a);
}
👑tozangezan