結果
問題 | No.112 ややこしい鶴亀算 |
ユーザー | Ysmr_Ry |
提出日時 | 2014-12-23 23:33:54 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 266 bytes |
コンパイル時間 | 154 ms |
コンパイル使用メモリ | 22,528 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-12 04:22:32 |
合計ジャッジ時間 | 1,046 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf( "%d", &N ); | ~~~~~^~~~~~~~~~~~ main.cpp:11:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf( "%d", a+i ), S += a[i]; | ~~~~~^~~~~~~~~~~~~
ソースコード
#include<cstdio> #define rep(i,a) for(int i=0;i<(a);++i) int N, a[50], S; int cnt[2]; int main() { scanf( "%d", &N ); rep( i, N ) scanf( "%d", a+i ), S += a[i]; S /= (N-1); rep( i, N ) ++cnt[S-a[i]!=2]; printf( "%d %d\n", cnt[0], cnt[1] ); return 0; }