結果
| 問題 |
No.3257 +|+
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-09-05 22:08:30 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 567 bytes |
| コンパイル時間 | 4,272 ms |
| コンパイル使用メモリ | 320,228 KB |
| 実行使用メモリ | 414,600 KB |
| 最終ジャッジ日時 | 2025-09-05 22:09:13 |
| 合計ジャッジ時間 | 40,390 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 TLE * 2 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll =long long;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll N;
cin>>N;
ll MX=2e5*2;
ll an=0;
vector<__gnu_pbds::gp_hash_table<int, int>> 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;
an+=M[k][-d];
M[k][d]++;
}
}
cout<<an<<"\n";
}