Submission #73886295
Source Code Expand
#include<bits/stdc++.h>
//入力系
#define cinll(...) ll __VA_ARGS__; input(__VA_ARGS__);
#define cinint(...) int __VA_ARGS__; input(__VA_ARGS__);
#define cinstr(...) string __VA_ARGS__; input(__VA_ARGS__);
#define cinchar(...) char __VA_ARGS__; input(__VA_ARGS__);
#define cindouble(...) double __VA_ARGS__; input(__VA_ARGS__);
#define cinvll(a,n) vll a(n); rep(i,n) cin>>a[i];
#define cinvvll(a,n,m) vvll a(n,vll(m)); rep(i,n) rep(j,m) cin>>a[i][j];
#define cinvs(a,n) vs a(n); rep(i,n) cin>>a[i];
#define cinvpll(a,n) vpll a(n); rep(i,n) cin>>a[i].fst>>a[i].snd;
//繰り返し系
#define rep1(n) for(ll i=0;i<n;i++)
#define rep2(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,n) for(ll i=a;i<n;i++)
#define rep4(i,a,n,b) for(ll i=a;i<n;i+=b)
#define overload4(a,b,c,d,e,...) e
#define rep(...) overload4(__VA_ARGS__,rep4,rep3,rep2,rep1)(__VA_ARGS__)
#define mrep1(n) for(ll i=n;i>=0;i--)
#define mrep2(i,n) for(ll i=n;i>=0;i--)
#define mrep3(i,n,a) for(ll i=n;i>=a;i--)
#define mrep4(i,n,a,b) for(ll i=n;i>=a;i-=b)
#define mrep(...) overload4(__VA_ARGS__,mrep4,mrep3,mrep2,mrep1)(__VA_ARGS__)
//iterator系
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
//vector系
#define pb push_back
//書くのが長いやつ
#define fst first
#define snd second
#define cvvll1(name,a,b) vvll name(a, vll(b))
#define cvvll2(name,a,b,c) vvll name(a, vll(b,c))
#define cvvlloverload2(name,a,b,c,d,...) d
#define make_vvll(...) cvvlloverload2(__VA_ARGS__,cvvll2,cvvll1)(__VA_ARGS__)
using namespace std;
//型系
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vd = vector<double>;
using vvd = vector<vd>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using pll = pair<long long,long long>;
using pi = pair<int,int>;
using pd = pair<double,double>;
using sll = set<long long>;
using vsll = vector<sll>;
using vpll = vector<pll>;
using vpi = vector<pi>;
using vpd = vector<pd>;
using vvpll = vector<vpll>;
#define vmll vector<mll>
#define vvmll vector<vector<mll>>
const ll mod = 998244353LL;
// const ll mod = 1000000007LL;
const ll inf = 1300100100100100100LL;
const double PI=3.1415926535897932384626433832795028841971;
//表示
#define overload1(a,b,NAME,...) NAME
#define coutYesReturn() do {coutYes(); return 0; } while(0)
#define coutYesReturnIf(a) do { if(a){ coutYesReturn(); }} while(0)
#define coutNoReturn() do {coutNo(); return 0;} while(0)
#define coutNoReturnIf(a) do {if(a){ coutNoReturn(); }} while(0)
#define coutReturnIf(a,s) do{if(a){cout<<s<<endl; return 0;}}while(0)
template<typename... T>
void coutll(T... a){ ((cout << a <<" "),...) << endl; }
void coutvll(vll &a){ rep(i,a.size()) cout<<a[i]<<" "; cout<<endl; }
void coutvll(string name, vll &a){ cout<<name<<":"; coutvll(a); }
void coutvlln(vll &a){ rep(i,a.size()) cout<<a[i]<<endl; }
void coutYes(){ cout<<"Yes"<<endl; }
void coutNo(){ cout<<"No"<<endl; }
void coutYesNo(bool a){ cout<<(a?"Yes":"No")<<endl; }
void coutIf(bool a, string s, string t){ cout<<(a?s:t)<<endl; }
//入力
template<class... T>
void input(T&... a){
(cin >> ... >> a);
}
//複数ソート
template<class... T>
void sorts(vector<T>&... a){
(sort(all(a)),...);
}
//便利関数
template<typename T> bool chmax(T &a, T b){ if(a < b) {a = b; return true;} return false; }
template<typename T> bool chmin(T &a, T b){ if(a > b) {a = b; return true;} return false; }
//配列表示用
template <typename T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
rep(i,vec.size()) os << vec[i] << (i==(ll)vec.size()-1?"":" ");
return os;
}
int main(){
cinll(n, m);
cinvll(c, m);
ll total = 0;
rep(i, n){
cinll(a, b);
a--;
ll d = min(b, c[a]);
total += d;
c[a] -= d;
}
cout << total << endl;
return 0;
}
Submission Info
| Submission Time |
|
| Task |
B - Pepper Addiction |
| User |
hoppii |
| Language |
C++23 (GCC 15.2.0) |
| Score |
200 |
| Code Size |
4036 Byte |
| Status |
AC |
| Exec Time |
1 ms |
| Memory |
3712 KiB |
Compile Error
./Main.cpp: In function 'void coutvll(vll&)':
./Main.cpp:14:31: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
14 | #define rep2(i,n) for(ll i=0;i<n;i++)
| ^
./Main.cpp:17:34: note: in expansion of macro 'rep2'
17 | #define overload4(a,b,c,d,e,...) e
| ^
./Main.cpp:18:18: note: in expansion of macro 'overload4'
18 | #define rep(...) overload4(__VA_ARGS__,rep4,rep3,rep2,rep1)(__VA_ARGS__)
| ^~~~~~~~~
./Main.cpp:76:23: note: in expansion of macro 'rep'
76 | void coutvll(vll &a){ rep(i,a.size()) cout<<a[i]<<" "; cout<<endl; }
| ^~~
./Main.cpp: In function 'void coutvlln(vll&)':
./Main.cpp:14:31: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
14 | #define rep2(i,n) for(ll i=0;i<n;i++)
| ^
./Main.cpp:17:34: note: in expansion of macro 'rep2'
17 | #define overload4(a,b,c,d,e,...) e
| ^
./Main.cpp:18:18: note: in expansion of macro 'overload4'
18 | #define rep(...) overload4(__VA_ARGS__,rep4,rep3,rep2,rep1)(__VA_ARGS__)
| ^~~~~~~~~
./Main.cpp:78:24: note: in expansion of macro 'rep'
78 | void coutvlln(vll &a){ rep(i,a.size()) cout<<a[i]<<endl; }
| ^~~
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
200 / 200 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
sample_01.txt, sample_02.txt, sample_03.txt |
| All |
sample_01.txt, sample_02.txt, sample_03.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt |
| Case Name |
Status |
Exec Time |
Memory |
| sample_01.txt |
AC |
1 ms |
3712 KiB |
| sample_02.txt |
AC |
1 ms |
3504 KiB |
| sample_03.txt |
AC |
1 ms |
3564 KiB |
| test_01.txt |
AC |
1 ms |
3620 KiB |
| test_02.txt |
AC |
1 ms |
3580 KiB |
| test_03.txt |
AC |
1 ms |
3476 KiB |
| test_04.txt |
AC |
1 ms |
3524 KiB |
| test_05.txt |
AC |
1 ms |
3604 KiB |
| test_06.txt |
AC |
1 ms |
3580 KiB |
| test_07.txt |
AC |
1 ms |
3484 KiB |
| test_08.txt |
AC |
1 ms |
3524 KiB |
| test_09.txt |
AC |
1 ms |
3492 KiB |
| test_10.txt |
AC |
1 ms |
3484 KiB |
| test_11.txt |
AC |
1 ms |
3604 KiB |
| test_12.txt |
AC |
1 ms |
3556 KiB |
| test_13.txt |
AC |
1 ms |
3560 KiB |
| test_14.txt |
AC |
1 ms |
3556 KiB |
| test_15.txt |
AC |
1 ms |
3484 KiB |
| test_16.txt |
AC |
1 ms |
3492 KiB |
| test_17.txt |
AC |
1 ms |
3512 KiB |