結果
問題 | No.504 ゲーム大会(ランキング) |
ユーザー |
![]() |
提出日時 | 2017-04-21 22:23:49 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 24 ms / 2,000 ms |
コード長 | 253 bytes |
コンパイル時間 | 204 ms |
コンパイル使用メモリ | 22,528 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-20 05:17:38 |
合計ジャッジ時間 | 1,347 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:12:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%d", &a); | ~~~~~^~~~~~~~~~
ソースコード
#include<cstdio> int main(void) { int n, a, k, kn; while(scanf("%d", &n)==1) { for(int i=0;i<n;i++) { scanf("%d", &a); if(i==0) { k=a; kn=1; } else { if(a>k) kn++; } printf("%d\n", kn); } } return 0; }