結果
問題 | No.413 +5,000,000pts |
ユーザー | kmjp |
提出日時 | 2016-08-12 23:23:39 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 45 ms / 5,000 ms |
コード長 | 1,231 bytes |
コンパイル時間 | 1,505 ms |
コンパイル使用メモリ | 165,760 KB |
実行使用メモリ | 8,320 KB |
最終ジャッジ日時 | 2024-11-07 15:49:50 |
合計ジャッジ時間 | 1,911 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) //------------------------------------------------------- set<ll> R; void test(ll d) { long long int calc = sqrt(static_cast<long double>(1 + 4*d)); long long int calc2 = sqrt(1 + 4*d); //if(calc!=calc2) cout<<calc<<" "<<calc2<<endl; ll a=(ll)((-1 + sqrt((double)(1 + 4*d))) / 2.0); if(a*a+a>d || (a+1)*(a+1)+(a+1)<=d) { R.insert(d); if(R.size()==100000) { FORR(r,R) _P("%lld\n",r); exit(0); } } } void solve() { int i,j,k,l,r,x,y; string s; ll a=1LL<<58; FOR(i,100) { FOR(j,1000000) { a=j+(1LL<<29); a=a*a; a+=-50+i; test((a-1)/4); } } cout<<R.size()<<endl; return; } int main(int argc,char** argv){ string s;int i; if(argc==1) ios::sync_with_stdio(false), cin.tie(0); FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin); solve(); return 0; }