結果
問題 | No.742 にゃんにゃんにゃん 猫の挨拶 |
ユーザー |
|
提出日時 | 2018-10-11 17:24:22 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 344 ms / 2,500 ms |
コード長 | 380 bytes |
コンパイル時間 | 387 ms |
コンパイル使用メモリ | 22,784 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-12 17:38:09 |
合計ジャッジ時間 | 1,503 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:10:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%d",&n); | ~~~~~^~~~~~~~~ main.cpp:14:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 14 | scanf("%d",&m[i]); | ~~~~~^~~~~~~~~~~~
ソースコード
#include<stdio.h> #define BIGNUM 30000 int main(void) { int n,i,j; int m[BIGNUM]; int nyaCount=0; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&m[i]); } for(i=0;i<n-1;i++) { for(j=i+1;j<n;j++) { if(m[i]>=m[j]) nyaCount++; } } printf("%d",nyaCount); return 0; }