Submission #61556130
Source Code Expand
Copy
#include <bits/stdc++.h>// #include <atcoder/all>#define rep(i, l, r) for (int i = (l); i < (r); i++)#define repd(i, l, r) for (int i = (l); i >= (r); i--)#define all(a) (a).begin(), (a).end()template<typename T> inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); }template<typename T> inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); }typedef long long ll;const ll LINF = 1e18;const int INF = 1e9;using namespace std;using P = pair<int, int>;int main(void){int N,D;cin >> N >> D;vector<P> snake(N);rep(i,0,N)
#include <bits/stdc++.h> // #include <atcoder/all> #define rep(i, l, r) for (int i = (l); i < (r); i++) #define repd(i, l, r) for (int i = (l); i >= (r); i--) #define all(a) (a).begin(), (a).end() template<typename T> inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); } template<typename T> inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); } typedef long long ll; const ll LINF = 1e18; const int INF = 1e9; using namespace std; using P = pair<int, int>; int main(void) { int N,D; cin >> N >> D; vector<P> snake(N); rep(i,0,N) cin >> snake[i].first >> snake[i].second; rep(k,1,D+1) { int ans = 0; rep(i,0,N) { int now = snake[i].first*(snake[i].second+k); chmax(ans,now); } cout << ans << endl; } return (0); }
Submission Info
Submission Time | |
---|---|
Task | B - Heavy Snake |
User | TheataPro |
Language | C++ 20 (gcc 12.2) |
Score | 200 |
Code Size | 824 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3652 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample00.txt, sample01.txt |
All | sample00.txt, sample01.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample00.txt | AC | 1 ms | 3488 KB |
sample01.txt | AC | 1 ms | 3456 KB |
testcase00.txt | AC | 1 ms | 3508 KB |
testcase01.txt | AC | 1 ms | 3436 KB |
testcase02.txt | AC | 1 ms | 3500 KB |
testcase03.txt | AC | 1 ms | 3436 KB |
testcase04.txt | AC | 1 ms | 3436 KB |
testcase05.txt | AC | 1 ms | 3632 KB |
testcase06.txt | AC | 1 ms | 3628 KB |
testcase07.txt | AC | 1 ms | 3552 KB |
testcase08.txt | AC | 1 ms | 3620 KB |
testcase09.txt | AC | 1 ms | 3552 KB |
testcase10.txt | AC | 1 ms | 3468 KB |
testcase11.txt | AC | 1 ms | 3652 KB |