Submission #4185
Source Code Expand
#include <string> #include <algorithm> #include <cmath> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <utility> #include <vector> #include <fstream> #include <cassert> #include <numeric> #include <iomanip> using namespace std; const bool OJ = #ifdef ONLINE_JUDGE true #else false #endif ; #define int ll #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define pb push_back #define eb emplace_back #define SZ(a) ((int)((a).size())) #define rep(i,n) for(int i = 0; i < (n); i++) #define tag(i,v) rep(i,SZ(v)) #define _tr(x) #x<<" = "<<(x) #define trace(x) {if(!OJ)cerr<<_tr(x)<<endl;} #define trace2(x,y) {if(!OJ)cerr<<_tr(x)<<" "<<_tr(y)<<endl;} #define trace3(x,y,z) {if(!OJ)cerr<<_tr(x)<<" "<<_tr(y)<<""<<_tr(z)<<endl;} #define fst get<0> #define snd get<1> #define thd get<2> #define divup(x,y) ((x)/(y)+(0<((x)%(y)))) #define mp make_tuple #define range(x,a,b) ((x) >= (a) && (x) <= (b)) typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<string> vs; typedef tuple<int,int> int2; const int INF = 1LL << 60; template<class T> ostream& operator<<(ostream& os, const vector<T> &v) { tag(i,v) os << v[i] << " "; return os; } template<class T> istream& operator>>(istream& is, vector<T> &v){ tag(i,v) is >> v[i]; return is; } template<class A, class B> istream& operator>>(istream& is, tuple<A,B> &p){ is >> fst(p) >> snd(p); return is; } int solve(int n){ if(n < 0) return solve(-n); if(n == 0) return 0; if(n >= 8) return 1+solve(n-10); if(n >= 3) return 1+solve(n-5); return 1+solve(n-1); } void run() { /* entry point */ int a,b; cin >> a >> b; cout << solve(a-b) << endl; } #undef int int main(int argc, char *argv[]) { #if 0 if(OJ){ freopen("input.txt", "rt", stdin); freopen("output.txt", "wt", stdout); } #endif run(); return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - リモコン |
User | wisterik |
Language | C++ (GCC 4.4.7) |
Score | 0 |
Code Size | 2083 Byte |
Status | CE |
Compile Error
./Main.cpp:52: error: expected initializer before ‘<’ token ./Main.cpp:64: error: ‘tuple’ has not been declared ./Main.cpp:64: error: expected ‘,’ or ‘...’ before ‘<’ token ./Main.cpp: In function ‘std::istream& operator>>(std::istream&, int)’: ./Main.cpp:65: error: ‘get’ was not declared in this scope ./Main.cpp:65: error: ‘p’ was not declared in this scope