ceil((double)x/n); x <= 10^12 and n <10^6; can anyone provide a test case or something I got hacked many times but was unable to find a mistake
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
ceil((double)x/n); x <= 10^12 and n <10^6; can anyone provide a test case or something I got hacked many times but was unable to find a mistake
// #pragma GCC optimize("Ofast,unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,mmx,avx,avx2")
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define lld long double
#define w(x) ll x;cin>>x;while(x--)
#define all(x) x.begin(), x.end()
#define lb lower_bound
#define ub upper_bound
#define iceil(n, x) (((n) + (x) - 1) / (x))
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) __detail::__lcm(a,b)
#define goog(tno) cout << "Case #" << tno <<": "
#define PRESS_F_TO_PAY_RESPECT ios_base::sync_with_stdio(false), cin.tie(nullptr)
using namespace std;
ll dx[]= {-1,-1,-1,0,0,1,1,1};
ll dy[]= {-1,0,1,-1,1,-1,0,1};
const lld pi=3.1415926535897932384626433832795;
const ll INF=1e18;
const ll mod=1000000007;
const ll maxn=1e5+5;
// a^2=2*b+1;
// c=b+1;
int main(){
PRESS_F_TO_PAY_RESPECT;
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
w(T){
ll n; cin>>n;
ll ans=0;
for(ll a=2;a*a<=2*n+1;a++){
ll b=((a*a)-1)/2;
ll c=b+1;
if(a*a+b*b!=c*c) continue;
if(c!=a*a-b) continue;
if(a>=1&&a<=n&&b>=1&&b<=n&&c>=1&&c<=n){
ans++;
}
}
cout<<ans<<'\n';
}
return 0;
}
Hey there, can anyone tell me why first code got accepted using C++17(64) but not with C++17 ?
/* ヽ`、ヽ``、ヽ`ヽ`、、ヽ `ヽ 、ヽ``ヽヽ`ヽ、ヽ` ヽ`、ヽ``、ヽ 、``、 `、ヽ` 、` ヽ`ヽ、ヽ `、ヽ``、 ヽ、``、`、ヽ``、 、ヽヽ`、`、、ヽヽ、``、 、 ヽ`、 ヽ``、 ヽ`ヽ`、、ヽ `ヽ 、 ヽ````ヽヽヽ`、、ヽ`、、ヽ*/ code with this comment(similar) doesn't run on custom invocation so does it really helps in prevention from hacking when i removed this comment it runs on custom invocation like adding some emoji or something in comments?
Name |
---|