提出 #3116078


ソースコード 拡げる

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <fstream>
#include <queue>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <sstream>

#define For(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  For(i,0,n)

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
#define SORT(c) sort((c).begin(),(c).end())
#define vi(m,a) vector<int> m(a)
#define vti(m,a,i) vector<vector<int>> m(a,vector<int>(i))
#define ALL(it,a) for(auto it = a.begin(); it!=a.end(); it++)
#define Fe(it,a) for(auto &it : a)
#define all(a) begin(a),end(a)

using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pll;
#define WARU 1000000007;

int dx[] = { 1,0,-1,0 };
int dy[] = { 0,1,0,-1 };
void printhoge(set<int> v) {
	ALL(it, v) {
		cout << *it << " ";
	}
	cout << endl;

}


int main() {
	int n,k;
	cin >> n >> k;
	ll result = 0;
	ll saidai = n / k;
	result = saidai * saidai * saidai;
	if (k % 2 == 0) {
		saidai = (n - k/2) / k + 1;
		if (n >= k/2) {
			result += saidai * saidai * saidai;
		}
	}
	cout << result << endl;

}

提出情報

提出日時
問題 C - Triangular Relationship
ユーザ admjgptw1357
言語 C++14 (Clang 3.8.0)
得点 300
コード長 1239 Byte
結果 AC
実行時間 6 ms
メモリ 888 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 4
AC × 18
セット名 テストケース
Sample s1.txt, s2.txt, s3.txt, s4.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, s1.txt, s2.txt, s3.txt, s4.txt
ケース名 結果 実行時間 メモリ
01.txt AC 6 ms 888 KiB
02.txt AC 2 ms 256 KiB
03.txt AC 2 ms 256 KiB
04.txt AC 1 ms 256 KiB
05.txt AC 1 ms 256 KiB
06.txt AC 1 ms 256 KiB
07.txt AC 1 ms 256 KiB
08.txt AC 1 ms 256 KiB
09.txt AC 1 ms 256 KiB
10.txt AC 1 ms 256 KiB
11.txt AC 2 ms 256 KiB
12.txt AC 2 ms 256 KiB
13.txt AC 2 ms 256 KiB
14.txt AC 1 ms 256 KiB
s1.txt AC 2 ms 256 KiB
s2.txt AC 1 ms 256 KiB
s3.txt AC 4 ms 256 KiB
s4.txt AC 2 ms 256 KiB