Submission #1647745
Source Code Expand
//#define __USE_MINGW_ANSI_STDIO 0 #include <bits/stdc++.h> using namespace std; typedef long long ll; // #define int ll typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<ll> VL; typedef vector<VL> VVL; typedef pair<int, int> PII; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #define IN(a, b, x) (a<=x&&x<b) #define MP make_pair #define PB push_back #ifdef int const int INF = (1LL<<30); #else const ll INF = (1LL<<60); #endif const double PI = 3.14159265359; const double EPS = 1e-12; const int MOD = 1000000007; template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); } template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); } int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; signed main(void) { int n; cin >> n; int a = 1, b = 0, c = 0; REP(i, n) { c += b; b = a; a = c; // cout << a << " " << b << " " << c << endl; } cout << a+b+c << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 算盤の書 |
User | ferin_tech |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 1065 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_sample1, 00_sample2, 00_sample3, 10_testcase00, 10_testcase01, 10_testcase02, 10_testcase03, 10_testcase04, 10_testcase05, 10_testcase06, 10_testcase07, 10_testcase08, 10_testcase09, 10_testcase10, 10_testcase11, 10_testcase12, 10_testcase13, 10_testcase14, 10_testcase15, 10_testcase16, 10_testcase17, 10_testcase18, 10_testcase19, 10_testcase20, 10_testcase21, 10_testcase22, 10_testcase23, 10_testcase24, 10_testcase25, 10_testcase26, 10_testcase27, 10_testcase28, 10_testcase29, 10_testcase30, 10_testcase31, 10_testcase32, 10_testcase33, 10_testcase34, 10_testcase35, 10_testcase36, 10_testcase37, 10_testcase38, 10_testcase39, 10_testcase40, 10_testcase41, 10_testcase42 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample1 | AC | 1 ms | 256 KB |
00_sample2 | AC | 1 ms | 256 KB |
00_sample3 | AC | 1 ms | 256 KB |
10_testcase00 | AC | 1 ms | 256 KB |
10_testcase01 | AC | 1 ms | 256 KB |
10_testcase02 | AC | 1 ms | 256 KB |
10_testcase03 | AC | 1 ms | 256 KB |
10_testcase04 | AC | 1 ms | 256 KB |
10_testcase05 | AC | 1 ms | 256 KB |
10_testcase06 | AC | 1 ms | 256 KB |
10_testcase07 | AC | 1 ms | 256 KB |
10_testcase08 | AC | 1 ms | 256 KB |
10_testcase09 | AC | 1 ms | 256 KB |
10_testcase10 | AC | 1 ms | 256 KB |
10_testcase11 | AC | 1 ms | 256 KB |
10_testcase12 | AC | 1 ms | 256 KB |
10_testcase13 | AC | 1 ms | 256 KB |
10_testcase14 | AC | 1 ms | 256 KB |
10_testcase15 | AC | 1 ms | 256 KB |
10_testcase16 | AC | 1 ms | 256 KB |
10_testcase17 | AC | 1 ms | 256 KB |
10_testcase18 | AC | 1 ms | 256 KB |
10_testcase19 | AC | 1 ms | 256 KB |
10_testcase20 | AC | 1 ms | 256 KB |
10_testcase21 | AC | 1 ms | 256 KB |
10_testcase22 | AC | 1 ms | 256 KB |
10_testcase23 | AC | 1 ms | 256 KB |
10_testcase24 | AC | 1 ms | 256 KB |
10_testcase25 | AC | 1 ms | 256 KB |
10_testcase26 | AC | 1 ms | 256 KB |
10_testcase27 | AC | 1 ms | 256 KB |
10_testcase28 | AC | 1 ms | 256 KB |
10_testcase29 | AC | 1 ms | 256 KB |
10_testcase30 | AC | 1 ms | 256 KB |
10_testcase31 | AC | 1 ms | 256 KB |
10_testcase32 | AC | 1 ms | 256 KB |
10_testcase33 | AC | 1 ms | 256 KB |
10_testcase34 | AC | 1 ms | 256 KB |
10_testcase35 | AC | 1 ms | 256 KB |
10_testcase36 | AC | 1 ms | 256 KB |
10_testcase37 | AC | 1 ms | 256 KB |
10_testcase38 | AC | 1 ms | 256 KB |
10_testcase39 | AC | 1 ms | 256 KB |
10_testcase40 | AC | 1 ms | 256 KB |
10_testcase41 | AC | 1 ms | 256 KB |
10_testcase42 | AC | 1 ms | 256 KB |