Code Formula 2014 本選

Submission #1367997

Source codeソースコード

#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
#define pb(a) push_back(a)
#define pr(a) cout<<(a)<<endl
#define PR(a,b) cout<<(a)<<" "<<(b)<<endl
#define F first
#define S second
#define ll long long
bool check(int n,int m,int x,int y){return (x<0||x>=n||y<0||y>=m)?false:true;}
const ll MAX=1000000007,MAXL=1LL<<60,dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
typedef pair<int,int> P;
 
int main() {
  ll n;
  cin >> n;
  ll ans=(n/2+n%2)*3;
  ans-=n/2*2;
  pr(ans);
  return 0;
}

Submission

Task問題 B - 3歩進んで2歩下がる
User nameユーザ名 kzyKT
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 AC
Score得点 100
Source lengthソースコード長 782 Byte
File nameファイル名
Exec time実行時間 1 ms
Memory usageメモリ使用量 256 KB

Test case

Set

Set name Score得点 / Max score Cases
All 100 / 100 sample_01.txt,sample_02.txt,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

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
sample_01.txt AC 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
test_1.txt AC 1 ms 256 KB
test_1000000000000000.txt AC 1 ms 256 KB
test_111723.txt AC 1 ms 256 KB
test_130146966901509.txt AC 1 ms 256 KB
test_161925824289921.txt AC 1 ms 256 KB
test_35454587585157.txt AC 1 ms 256 KB
test_5.txt AC 1 ms 256 KB
test_5540.txt AC 1 ms 256 KB
test_6021.txt AC 1 ms 256 KB
test_805.txt AC 1 ms 256 KB
test_845717671383532.txt AC 1 ms 256 KB
test_865385763670868.txt AC 1 ms 256 KB