結果
| 問題 |
No.1389 Clumsy Calculation
|
| コンテスト | |
| ユーザー |
y61mpnl
|
| 提出日時 | 2021-02-20 20:32:44 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 34 ms / 2,000 ms |
| コード長 | 217 bytes |
| コンパイル時間 | 1,838 ms |
| コンパイル使用メモリ | 190,368 KB |
| 最終ジャッジ日時 | 2025-01-19 02:47:08 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
コンパイルメッセージ
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("%ld %ld", &n, &x);
| ~~~~~^~~~~~~~~~~~~~~~~~~
main.cpp:10:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%ld", &tmp);
| ~~~~~^~~~~~~~~~~~~
ソースコード
#include<bits/stdc++.h>
using ll = int_fast64_t;
int main(){
ll n, x, a = 0;
scanf("%ld %ld", &n, &x);
x *= n - 1;
while(n--){
ll tmp;
scanf("%ld", &tmp);
a += tmp;
}
printf("%ld\n", a - x);
return 0;
}
y61mpnl