Submission #244416
Source Code Expand
#include <iostream> #include <iomanip> #include <sstream> #include <vector> #include <string> #include <set> #include <map> #include <stack> #include <queue> #include <algorithm> #include <functional> #include <iterator> #include <limits> #include <numeric> #include <utility> #include <cmath> using namespace std; using namespace placeholders; using LL = long long; using ULL = unsigned long long; using VI = vector<int>; using VVI = vector<VI>; using VS = vector<string>; using SS = stringstream; using PII = pair<int,int>; using VPII = vector< pair<int,int> >; template < typename T = int > using VT = vector<T>; template < typename T = int > using VVT = VT< VT<T> >; template < typename T = int > using LIM = numeric_limits<T>; template < typename T > inline void input_n( VT< T > &out ) { copy_n( istream_iterator< T >( cin ), out.size(), out.begin() ); }; template < typename T > inline T fromString( const string &s ) { T res; istringstream iss( s ); iss >> res; return res; }; template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); }; #define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i ) #define FOR( e, c ) for ( auto &e : c ) #define ALL( c ) (c).begin(), (c).end() #define AALL( a, t ) (t*)a, (t*)a + sizeof( a ) / sizeof( t ) #define DRANGE( c, p ) (c).begin(), (c).begin() + p, (c).end() #define PB( n ) push_back( n ) #define EM( n ) emplace( n ) #define EB( n ) emplace_back( n ) #define MP( a, b ) make_pair( ( a ), ( b ) ) #define EXIST( c, e ) ( (c).find( e ) != (c).end() ) #define fst first #define snd second #define DUMP( x ) cerr << #x << " = " << ( x ) << endl int main() { cin.tie( 0 ); ios::sync_with_stdio( false ); LL n; cin >> n; LL res = -( n / 2 ) * 2; res += ( n / 2 + n % 2 ) * 3; cout << res << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - 3歩進んで2歩下がる |
User | torus711 |
Language | C++11 (GCC 4.8.1) |
Score | 100 |
Code Size | 1904 Byte |
Status | AC |
Exec Time | 25 ms |
Memory | 932 KB |
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 100 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
All | test_1.txt, test_1000000000000000.txt, test_111723.txt, test_130146966901509.txt, test_161925824289921.txt, test_35454587585157.txt, test_5.txt, test_5540.txt, test_6021.txt, test_805.txt, test_845717671383532.txt, test_865385763670868.txt, sample_01.txt, sample_02.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 25 ms | 740 KB |
sample_02.txt | AC | 23 ms | 804 KB |
test_1.txt | AC | 24 ms | 932 KB |
test_1000000000000000.txt | AC | 24 ms | 804 KB |
test_111723.txt | AC | 24 ms | 928 KB |
test_130146966901509.txt | AC | 24 ms | 800 KB |
test_161925824289921.txt | AC | 25 ms | 808 KB |
test_35454587585157.txt | AC | 25 ms | 932 KB |
test_5.txt | AC | 25 ms | 924 KB |
test_5540.txt | AC | 24 ms | 808 KB |
test_6021.txt | AC | 24 ms | 804 KB |
test_805.txt | AC | 25 ms | 924 KB |
test_845717671383532.txt | AC | 24 ms | 800 KB |
test_865385763670868.txt | AC | 24 ms | 804 KB |