Submission #1692764
Source Code Expand
#include <iostream> #include <iomanip> #include <vector> #include <valarray> #include <map> #include <set> #include <list> #include <queue> #include <stack> #include <bitset> #include <utility> #include <numeric> #include <algorithm> #include <functional> #include <complex> #include <string> #include <sstream> #include <cstdio> #include <cstdlib> #include <cctype> #include <cstring> #include <cmath> using namespace std; #define all(c) c.begin(),c.end() #define repeat(i,n) for(int i=0;i<static_cast<int>(n);i++) #define debug(x) #x << "=" << (x) #define dump(x) cerr << debug(x) << " (L:" << __LINE__ << ")"<< endl typedef long long ll; typedef vector<int> vi; template<typename T> ostream& operator<<(ostream& os, const vector<T>& vec){ os << "["; for(int i = 0; i < vec.size(); i++){ os << vec[i] << ","; } os << "]"; return os; } template<typename T> T input(){ T t; cin >> t; return t; } template<typename T> vector<T> input(const int N){ vector<T> v(N); repeat(i,N) cin >> v[i]; return v; } long long gcd(long long a, long long b){ if(b == 0){ return a; } return gcd(b, a % b); } long long lcm(long long a, long long b){ return (a / gcd(a, b)) * b; } int main(){ int N; cin >> N; double salary = 0.0; for (int i = 1; i <= N; ++i) { salary += (i * 10000.0) / N; } cout << salary << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - AtCoder社の給料 |
User | xeonics |
Language | C++11 (GCC 4.8.1) |
Score | 100 |
Code Size | 1431 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 100 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
All | 00_sample_01.txt, 00_sample_02.txt, test_100.txt, test_14.txt, test_29.txt, test_4.txt, test_42.txt, test_48.txt, test_54.txt, test_59.txt, test_71.txt, test_72.txt, test_84.txt, test_96.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | AC | 1 ms | 256 KB |
00_sample_02.txt | AC | 1 ms | 256 KB |
test_100.txt | AC | 1 ms | 256 KB |
test_14.txt | AC | 1 ms | 256 KB |
test_29.txt | AC | 1 ms | 256 KB |
test_4.txt | AC | 1 ms | 256 KB |
test_42.txt | AC | 1 ms | 256 KB |
test_48.txt | AC | 1 ms | 256 KB |
test_54.txt | AC | 1 ms | 256 KB |
test_59.txt | AC | 1 ms | 256 KB |
test_71.txt | AC | 1 ms | 256 KB |
test_72.txt | AC | 1 ms | 256 KB |
test_84.txt | AC | 1 ms | 256 KB |
test_96.txt | AC | 1 ms | 256 KB |