結果
問題 |
No.112 ややこしい鶴亀算
|
ユーザー |
|
提出日時 | 2016-11-09 13:23:53 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 207 bytes |
コンパイル時間 | 368 ms |
コンパイル使用メモリ | 20,992 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-25 05:32:37 |
合計ジャッジ時間 | 1,210 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 23 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:4:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 4 | scanf("%d",&n); | ^~~~~~~~~~~~~~ main.c:6:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d",&a[i]); | ^~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> int main(){ int n,i,a[50],t=0,r=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); t+=a[i]; } t/=(n-1); for(i=0;i<n;i++){ if(t-a[i]==2)r++; } printf("%d %d\n\n",r,n-r); }