結果

問題 No.1406 Test
ユーザー hongrock
提出日時 2021-03-01 13:28:58
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 273 bytes
コンパイル時間 1,653 ms
コンパイル使用メモリ 191,880 KB
最終ジャッジ日時 2025-01-19 08:55:48
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14 WA * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
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", &n);
      |         ~~~~~^~~~~~~~~~
main.cpp:9:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |                 scanf("%d", &a);
      |                 ~~~~~^~~~~~~~~~

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
	int n, a, s;
	scanf("%d", &n);
	s = 0;
	for(int i=1; i<n; ++i){
		scanf("%d", &a);
		s += a;
	}
	s = s % n;
	if(s == 0){
		printf("%d\n", 100 / n + 1);
	} else {
		printf("%d\n", (100 - s) / n + 1);
	}
	return 0;
}
0