結果
| 問題 |
No.2221 Set X
|
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-02-11 16:20:50 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,696 bytes |
| コンパイル時間 | 7,671 ms |
| コンパイル使用メモリ | 255,396 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2025-02-11 16:21:10 |
| 合計ジャッジ時間 | 16,917 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 40 |
ソースコード
#include<bits/stdc++.h>
#define int ll
#define ll long long
#define i128 __int128
#define mem(a,b) memset((a),(b),sizeof(a))
#define m0(a) memset((a),0,sizeof(a))
#define m1(a) memset(a,-1,sizeof(a))
#define lb(x) ((x)&-(x))
#define lc(x) ((x)<<1)
#define rc(x) (((x)<<1)|1)
#define pb(G,x) (G).push_back((x))
#define For(a,b,c) for(int a=(b);a<=(c);a++)
#define Rep(a,b,c) for(int a=(b);a>=(c);a--)
#define in1(a) a=read()
#define in2(a,b) a=read(), b=read()
#define in3(a,b,c) a=read(), b=read(), c=read()
#define fst first
#define scd second
#define dbg puts("IAKIOI")
using namespace std;
int read() {
int x=0,f=1; char c=getchar();
for(;c<'0'||c>'9';c=getchar()) f=(c=='-'?-1:1);
for(;c<='9'&&c>='0';c=getchar()) x=(x<<1)+(x<<3)+(c^48);
return x*f;
}
void write(int x) { if(x>=10) write(x/10); putchar('0'+x%10); }
const int mod = 998244353;
int qpo(int a,int b) {int res=1; for(;b;b>>=1,a=(a*a)%mod) if(b&1) res=res*a%mod; return res; }
int inv(int a) {return qpo(a,mod-2); }
#define maxn 200050
int n,a[maxn];
int timer=0;
void work() {
in1(n);
For(i,1,n) in1(a[i]);
pair<int,int> ans={n+n,1};
For(i,2,min(n+n-1,a[n]+1)) {
timer++;
int sum=1,j=1;
while(1) {
timer++;
j=lower_bound(a+1,a+n+1,(a[j]/i+1)*i)-a;
if(j<=n) sum++;
else break;
}
ans=min(ans,{(i+1)*sum,i});
if(timer>=1e7) break;
}
cout<<ans.second<<' '<<ans.first<<'\n';
}
signed main() {
// freopen("data.in","r",stdin);
// freopen("myans.out","w",stdout);
// ios::sync_with_stdio(false);
// cin.tie(0); cout.tie(0);
double stt=clock();
int _=1;
// _=read();
// cin>>_;
For(i,1,_) {
work();
}
cerr<<"Total Time is:"<<(clock()-stt)*1.0/1000<<" second(s)."<<'\n';
return 0;
}
vjudge1