Submission #00029
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | #include<bits/stdc++.h> using namespace std; #define ll long long #define vi vector<int> #define all(v) v.begin(),v.end() #define fi first #define se second #define P pair<int,int> #define mp(a,b) make_pair(a,b) #define pb(a) push_back(a) int main(){ cin.tie(nullptr); ios_base::sync_with_stdio( false ); int q; cin>>q; for ( int i=0;i<q;i++){ int c,a,n; cin>>c>>a>>n; int ans=0,f; f=min({c,a,n}); ans+=f; c-=f; a-=f; n-=f; f=min(c/2,a); ans+=f; c-=f*2; a-=f; ans+=c/3; cout<<ans<< "\n" ; } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0005 - 陣形 |
ユーザー名 | 捻正 |
投稿日時 | 2021-09-09 17:48:18 |
言語 | C++17 |
状態 | Accepted |
得点 | 6 |
ソースコード長 | 677 Byte |
最大実行時間 | 32 ms |
最大メモリ使用量 | 648 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 6 / 6 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
input001.txt | AC | 19 ms | 476 KB |
1
|
input002.txt | AC | 24 ms | 436 KB |
1
|
input003.txt | AC | 20 ms | 520 KB |
1
|
input004.txt | AC | 22 ms | 608 KB |
1
|
input005.txt | AC | 19 ms | 560 KB |
1
|
input006.txt | AC | 20 ms | 520 KB |
1
|
input007.txt | AC | 16 ms | 604 KB |
1
|
input008.txt | AC | 17 ms | 556 KB |
1
|
input009.txt | AC | 32 ms | 648 KB |
1
|
input010.txt | AC | 27 ms | 604 KB |
1
|