Submission #3975643
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) int n; double ans = 0; int main(){ cin.tie(0); ios::sync_with_stdio(false); cin >> n; vector<int> v(n); for(auto &x : v){ cin >> x; } REP(i,n){ int temp = 0; REP(j,n){ if (i == j) continue; temp += v[i] % v[j] == 0; } if (temp % 2){ ans += 0.5; }else{ ans += (temp + 2.0) / (2 * temp + 2); } } cout << fixed << setprecision(12) ans << endl; }
Submission Info
Submission Time | |
---|---|
Task | C - コイン |
User | tomo_f01 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 557 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:31:36: error: expected ‘;’ before ‘ans’ cout << fixed << setprecision(12) ans << endl; ^