結果

問題 No.1664 Unstable f(n)
ユーザー 杨娵隅
提出日時 2021-09-03 21:28:47
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 240 bytes
コンパイル時間 2,072 ms
コンパイル使用メモリ 193,228 KB
最終ジャッジ日時 2025-01-24 04:48:38
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23 WA * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |   ll n; scanf("%lld", &n);
      |         ~~~~~^~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>
typedef long long ll;
const int maxn = 1005;
int a[maxn], dp[maxn];
int main()
{
  ll n; scanf("%lld", &n);
  
  ll x = (ll)sqrt(n);
  
  ll y = x * x;
  n -= y;
  
  std::cout << 2 + x + n << "\n";
  
  return 0;
}
0