結果
| 問題 |
No.3257 +|+
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-09-05 22:04:11 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 514 bytes |
| コンパイル時間 | 3,387 ms |
| コンパイル使用メモリ | 285,272 KB |
| 実行使用メモリ | 335,772 KB |
| 最終ジャッジ日時 | 2025-09-05 22:04:40 |
| 合計ジャッジ時間 | 25,702 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 TLE * 3 -- * 17 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll =long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll N;
cin>>N;
ll MX=2e5*2;
ll an=0;
vector<map<ll,ll>> M(MX+1);
for(ll i=1;i<=N;i++){
ll A;
cin>>A;
for(ll k=1;k*i<=MX;k++){
ll d=A-i*k;
// cout<<k<<" "<<d<<endl;
if(M[k].count(-d)){
an+=M[k][-d];
}
M[k][d]++;
}
}
cout<<an<<"\n";
}