結果
問題 |
No.8100 始業式
|
ユーザー |
![]() |
提出日時 | 2023-03-31 21:39:50 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 758 bytes |
コンパイル時間 | 1,575 ms |
コンパイル使用メモリ | 190,372 KB |
最終ジャッジ日時 | 2025-02-11 20:06:12 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 1 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:30:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 30 | scanf("%d", &T); | ~~~~~^~~~~~~~~~ main.cpp:33:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 33 | scanf("%d", &N); | ~~~~~^~~~~~~~~~ main.cpp:38:12: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 38 | scanf("%d", &x); | ~~~~~^~~~~~~~~~
ソースコード
#include<bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using namespace std; template< int sz > struct FastInput { char buf[sz + 1]; char* o; FastInput() { init(); } void init() { o = buf; buf[fread(buf, sizeof(char), sizeof(char) * sz, stdin)] = '\0'; } int64_t read() { int64_t ret = 0, sign = 1; while(*o && *o <= 32) ++o; if(*o == '-') sign *= -1, ++o; while(*o >= '0' && *o <= '9') { ret *= 10; ret += *o++ - '0'; } return ret * sign; } }; int main() { int T; scanf("%d", &T); REP(_, T) { int N; scanf("%d", &N); int ans = 0; REP(i, N) { int x; scanf("%d", &x); ans += x; } cout << ans << "\n"; } }