Codeforce Round #228 Div2 D
→ Practice
You are registered for practice. You can solve problems unofficially. Results can be found in the contest status and in the bottom of standings.
→ Submit?
→ Last submissions
| Submission | Time | Verdict |
|---|---|---|
| 5978428 | 02/14/2014 05:38PM | Accepted |
| 5975258 | 02/14/2014 05:18AM | Wrong answer on test 8 |
| 5975254 | 02/14/2014 05:16AM | Wrong answer on test 3 |
| 5975240 | 02/14/2014 05:12AM | Wrong answer on test 3 |
→ Problem tags
No tag edit access
1 #pragma comment(linker,"/STACK:102400000,102400000") 2 #include <cstdio> 3 #include <vector> 4 #include <cmath> 5 #include <stack> 6 #include <queue> 7 #include <cstring> 8 #include <iostream> 9 #include <algorithm> 10 using namespace std; 11 #define INF 0x7fffffff 12 #define maxn 200005 13 typedef pair<int, int> pii; 14 int n, m, t, b, y, k, x, s, ans; 15 int a[maxn]; 16 pii p[maxn]; 17 int main(){ 18 cin >> n >> m >> k; 19 for (s = 2; x < k; s++) 20 for (int i = max(1, s - m); x<k&&i <= min(s-1,n); i++){ 21 p[x++] = pii(i, s-i); 22 y += s-1; 23 } 24 cout << y << endl; 25 for (int i = k-1; i >= 0; i--){ 26 for (int j = 1; j <= p[i].first;j++) 27 cout << '(' << j << ',' << '1' << ')' << ' '; 28 for (int j = 2; j <= p[i].second;j++) 29 cout << '(' << p[i].first << ',' << j << ')' << ' '; 30 cout << endl; 31 } 32 return 0; 33 }




浙公网安备 33010602011771号