QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#787741 | #9521. Giving Directions in Harbin | CSQ# | WA | 0ms | 3776kb | C++17 | 689b | 2024-11-27 14:20:35 | 2024-11-27 14:20:35 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define sz(a) (int)(a.size())
typedef long long int ll;
int main()
{
int t;
cin>>t;
while(t--){
int n;
cin>>n;
vector<int>d;
for(int i=1;i*i<=n;i++){
if(n%i == 0){
d.push_back(i);
d.push_back(n/i);
}
}
sort(d.begin(),d.end());
ll ans = 0;
d.push_back(n);
for(int i=0;i+1<sz(d);i++){
ll dist = d[i+1] - d[i];
//cout<<dist<<" "<<d[i]<<'\n';
ans += dist * (n/d[i]);
}
ans++;
cout<<ans<<'\n';
}
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3776kb
input:
1 2 S 2 E 1
output:
3
result:
wrong output format Unexpected end of file - token expected (test case 1)