제출 #712979

#제출 시각아이디문제언어결과실행 시간메모리
712979mseebacher선물상자 (IOI15_boxes)C++17
0 / 100
1 ms212 KiB
//#include <bits/stdc++.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <functional>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

#define mp make_pair
#define f first
#define s second
#define pb push_back

typedef long long ll;
typedef long double lld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;

const lld pi = 3.14159265358979323846;


ll delivery(int n,int k,int l,int pos[]){
	ll ans = 0;
	for(int i = 0;i<n;i++){
		if(pos[i] == (l >> 1)) ans += l;
		else if(pos[i] < (l >> 1)) ans += (ll)pos[i]*2;
		else ans += (ll)(l-pos[i])*2;
	}
	
	return ans;
}

컴파일 시 표준 에러 (stderr) 메시지

boxes.cpp: In function 'll delivery(int, int, int, int*)':
boxes.cpp:39:23: warning: unused parameter 'k' [-Wunused-parameter]
   39 | ll delivery(int n,int k,int l,int pos[]){
      |                   ~~~~^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...