Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) A. Arpa and a research in Mexican wave

题意:给出n,k,t

其实题意和怎么写都在这张图里

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 
 4 int main(){
 5     int n,k,t;
 6     cin>>n>>k>>t;
 7     if(t<=k){
 8         cout<<t<<endl;
 9     }
10     else if(t>=n){
11         cout<<max(0,k-(t-n))<<endl;
12     }
13     else cout<<k<<endl;
14 }

 

posted on 2017-09-05 10:04  hhhhx  阅读(75)  评论(0编辑  收藏  举报

导航