Submission #996727
Source Code Expand
#include <cstdio> #include <algorithm> #include <cmath> #include <queue> #include <vector> #include <map> #include <set> using namespace std; typedef pair<int , int> P2; typedef pair<pair<int , int> , int> P3; typedef pair<pair<int , int> , pair<int , int> > P4; #define Fst first #define Snd second #define PB(a) push_back(a) #define MP(a , b) make_pair((a) , (b)) #define M3P(a , b , c) make_pair(make_pair((a) , (b)) , (c)) #define M4P(a , b , c , d) make_pair(make_pair((a) , (b)) , make_pair((c) , (d))) #define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i) #define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i) #define repv(t,it,v) for(vector<t>::iterator it = v.begin() ; it != v.end() ; ++it) int K; char S[100010]; int dp[2010][2010]; const int INF = 1e9 + 7; int main(){ scanf("%d" , &K); scanf(" %s" , S); int n = 0; while(S[n] != 0) ++n; if(n <= 2){ if(K == 0){ printf("%s\n" , s); } else if(K == 1){ printf("%s\n" , s[0] < s[1] ? s[0] : s[1]); } } else { printf("%s\n" , s); } return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Problem where Commas Separate Digits |
User | PIandS |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1090 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:36:20: error: ‘s’ was not declared in this scope printf("%s\n" , s); ^ ./Main.cpp:38:20: error: ‘s’ was not declared in this scope printf("%s\n" , s[0] < s[1] ? s[0] : s[1]); ^ ./Main.cpp:41:19: error: ‘s’ was not declared in this scope printf("%s\n" , s); ^ ./Main.cpp:30:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d" , &K); ^ ./Main.cpp:31:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf(" %s" , S); ^