/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 3ms 536.0 KiB

Code

#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b)		for(int i=(a),_b=(b);i<(_b);++i)
#define FORD(i,a,b)		for(int i=(a),_b=(b);i>(_b);--i)
#define pb			push_back
#define mp			make_pair
#define	all(c)			(c).begin(),(c).end()
#define	present(c,x)		((c).find(x) != (c).end())
#define	cpresent(c,x)		(find(all(c),x) != (c).end())
#define	endl			'\n'

typedef long long		ll;
typedef unsigned long long	ull;
typedef unsigned char	 	byte;
typedef vector<int>		vi;
typedef pair<int, int>		pii;
typedef pair<ll, ll>		pll;
typedef vector<pii>		vpii;

const int MX = 25;

int main(int argc, char *argv[])
{
#ifndef HTRINH_UNIT_TEST
	freopen(argv[1],"r",stdin);
#endif
#ifndef HTRINH_UNIT_TEST
	ifstream cin(argv[1]);
#endif
#if 0
	ofstream cout(argv[2]);
#endif
	ios :: sync_with_stdio(false);
	cin.tie(NULL);

	int n;
	cin >> n;
    int ans = 0;
    FOR(i,1,n) {
        ull x = (ull)i*(ull)i;
        if (x <= n) ++ans;
        x = (ull)(i+1)*(ull)i;
        if (x >= 1 && x <= n) ++ans;
    }

	cout << ans << endl;
	return 0;
}

Information

Submit By
Type
Pretest
Problem
P1191 A. Balanced Product
Language
C++17 (G++ 13.2.0)
Submit At
2025-06-14 04:29:50
Judged At
2025-06-14 04:29:50
Judged By
Score
0
Total Time
3ms
Peak Memory
536.0 KiB