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