Show all threads Hide all threads Show all messages Hide all messages |
How to copy value? | Zergatul | 2028. URCAPL, Episode 2 | 27 Jan 2021 07:01 | 2 |
I am stuck with this, it seems impossible to value from input to 2 registers. Ok, you can actually read n from input multiple times. And you can reduce value in current register to zero while increasing 2 (or more) other registers. This leads to copy operation. |
WA#9 | Zergatul | 2027. URCAPL, Episode 1 | 27 Jan 2021 06:11 | 2 |
WA#9 Zergatul 30 Nov 2020 03:04 My limit was 10^4, not 10^5 |
Limit for n <= 10^4 in russian version, and n <= 10^5 in english version | c_pp | 1906. The Lost Civilization | 27 Jan 2021 05:38 | 2 |
|
If WA 1 | Toshpulatov (MSU Tashkent) | 1732. Ministry of Truth | 26 Jan 2021 08:31 | 1 |
If WA 1 Toshpulatov (MSU Tashkent) 26 Jan 2021 08:31 |
WA18 | Ilya Konik | 1593. Square Country. Version 2 | 25 Jan 2021 17:40 | 1 |
WA18 Ilya Konik 25 Jan 2021 17:40 Wrong answer 18. Can anybody help me, please? |
Условия | Toshpulatov (MSU Tashkent) | 1487. Chinese Football | 25 Jan 2021 10:58 | 1 |
Условия Toshpulatov (MSU Tashkent) 25 Jan 2021 10:58 В задаче сказано, проверить существует ли такая команда 'x' что она обыграет и команду A и команду В, если существует то ответ No иначе YES в таком случае можно использовать bitset |
Memory limit for 41 test!!! | FullMetal | 1780. Gray Code | 23 Jan 2021 03:48 | 4 |
Who many test???????????????????? ??0??1 ?0000? the answer is: 000001 000001 I'm also hung in testcase 53,who can help me?both test data or thought is ok. |
My explanation | Vladimir Putin | 2018. The Debut Album | 22 Jan 2021 04:11 | 2 |
I defined three functions: C(i) - the number of ways to make the album if it consists of only i songs. A(i) - the number of ways ending in 1. B(i) - the number of ways ending in 2. C(i) = A(i) + B(i) A(i) = 1 if i <= 1 = C(i-1) if 1< i <=a = C(i-1) - B(i-a-1) i>a Notice that if i <= a there's no way to have more than a 1's, so we call C(i-1) and 'append' 1 at position i. The number of ways to do this reminds the same as C(i-1). If i>a you could have an invalid string of 1's. To counter this, we call B(i-a-1) to know exactly how many sequences would be invalid if we 'append' a 1 at position i. When i=a+1, there's only one invalid string resulting of appending 1 at a+1, the sequence consisting of only 1's. B is analogous to A (calls A instead of B and uses b instead of a). Edited by author 12.07.2019 04:31 But how do we eliminate duplicates ? |
Test Case for WA #8 | Deepesson | 1104. Don’t Ask Woman about Her Age | 20 Jan 2021 00:06 | 1 |
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ Answer: 36 |
The best solution! Only 0.015 sec and 78 Kb! | FANTOM | 1017. Staircases | 19 Jan 2021 19:22 | 9 |
My solution is fast! valery@uni.lg.ua Ha! My solution: only 0.001 sec and 70 Kb! And it's normal solution (no cheating). I sent it some minutes ago. PS: It's very good that your solution works fast but Always there is better one :) Ha-Ha! My solution works sometimes too 0.001, but how many iterations of your cycle on N=500? Ha-ha-ha! My solution is O(n^2) but I know O(sqrt(n)*n) one. sorry to bother u on such an old post...but can u help me on a better approach to this question Jokes on you! My solution is O(-∞) |
Подсказка | Nurs | 1709. Penguin-Avia | 19 Jan 2021 14:54 | 1 |
Подумайте о типе графа, дерево |
Wrong Answer... :( | Rafiqul Alam Chisty | 2012. About Grisha N. | 17 Jan 2021 23:36 | 3 |
#include <stdio.h> #include <math.h> int main() { int n; scanf("%d",&n); n=12-n; n>=7?printf("NO"):printf("YES"); return 0; } #include <stdio.h> int main(){ int n1,h,g; scanf ("%d",&n1); h=12-n1; g=h*45; if (g<=300){ printf ("YES");} else{ printf("NO");} return 0; }
/*In the name of Almighty Allah*/ #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<string> vs; typedef vector<ll> vl; typedef vector<vi> vvi; typedef vector<vl> vvl; typedef pair<int,int> pii; typedef pair<double, double> pdd; typedef pair<ll, ll> pll; typedef vector<pii> vii; typedef vector<pll> vll; typedef set<int> si; typedef map<string,int> msi; typedef double dl; typedef string st; #define PB push_back #define F first #define S second #define MP make_pair #define endl '\n' #define all(a) (a).begin(),(a).end() #define sz(x) (int)x.size() #define mid(l,r) ((r+l)/2) #define left(node) (node*2) #define right(node) (node*2+1) #define mx_int_prime 999999937 #define CY cout<<"YES"<<endl #define CN cout<<"NO"<<endl #define rn return 0 const double PI = acos(-1); const double eps = 1e-9;//10^-9 const int inf = 2000000000; const ll infLL = 9000000000000000000; #define MOD 1000000007 #define PI 2*acos(0.0) #define mem(a,b) memset(a, b, sizeof(a) ) #define gcd(a,b) __gcd(a,b) #define sqr(a) ((a) * (a)) #define sw(a,b) swap(a,b) #define sor(a) sort(a.begin(),a.end()) #define sorr(a) sort(a.begin(),a.end(),greater<int>()) #define uni(s) unique(s.begin(),s.end())-s.begin() #define mxdex(a) max_element(v.begin(),v.end())-v.begin() #define mindex(a) min_element(v.begin(),v.end())-v.begin() #define mxele(a) max_element(v.begin(),v.end()) #define minele(a) min_element(v.begin(),v.end()) #define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define fraction(a) cout.unsetf(ios::floatfield); cout.precision(a); cout.setf(ios::fixed,ios::floatfield); #define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout); typedef vector<int>::iterator vit; typedef set<int>::iterator sit; int dx[] = {0, 0, +1, -1}; int dy[] = {+1, -1, 0, 0}; //int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1}; //int dy[] = {0, +1, 0, -1, +1, -1, +1, -1}; //Debugger template < typename F, typename S > ostream& operator << ( ostream& os, const pair< F, S > & p ) { return os << "(" << p.first << ", " << p.second << ")"; } template < typename T > ostream &operator << ( ostream & os, const vector< T > &v ) { os << "{"; for(auto it = v.begin(); it != v.end(); ++it) { if( it != v.begin() ) os << ", "; os << *it; } return os << "}"; } template < typename T > ostream &operator << ( ostream & os, const set< T > &v ) { os << "["; for(auto it = v.begin(); it != v.end(); ++it) { if( it != v.begin() ) os << ", "; os << *it; } return os << "]"; } template < typename T > ostream &operator << ( ostream & os, const multiset< T > &v ) { os << "["; for(auto it = v.begin(); it != v.end(); ++it) { if( it != v.begin() ) os << ", "; os << *it; } return os << "]"; } template < typename F, typename S > ostream &operator << ( ostream & os, const map< F, S > &v ) { os << "["; for(auto it = v.begin(); it != v.end(); ++it) { if( it != v.begin() ) os << ", "; os << it -> first << " = " << it -> second ; } return os << "]"; } #define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0) void faltu () { cerr << endl; } template <typename T> void faltu( T a[], int n ) { for(int i = 0; i < n; ++i) cerr << a[i] << ' '; cerr << endl; } template <typename T, typename ... hello> void faltu( T arg, const hello &... rest) { cerr << arg << ' '; faltu(rest...); } int main() { optimize(); int f; cin>>f; int x=240/(12-f); if(x<45) CN; else CY; rn; } Edited by author 17.01.2021 23:37 |
hint | [MAI] do_v_5_strok | 1139. City Blocks | 17 Jan 2021 21:06 | 1 |
hint [MAI] do_v_5_strok 17 Jan 2021 21:06 check the values of y[i] by x[i] - x[i-1] in the straight line equation > > > > > > > > use ceil() and floor() |
Problem statement clarification | Orfest (Novosibirsk SU) | 2017. Best of a bad lot | 17 Jan 2021 16:10 | 1 |
I'm confused by this sentence in the problem statement: "the murderers have agreed that their testimonies will have no contradictions between them" Does that mean that tests like this are invalid? 3 A 1 2 B 1 3 C 1 1 In this test there are 3 people and each one conflicts with at least one another. If one person is declared a murderer, there is still a contradiction between the other two. No 2 people can be declared murderers because there is always a contradiction between any 2 of them. |
Solution (SPOILER) | Alikhan Zimanov | 2116. He is not a knight for you | 14 Jan 2021 16:50 | 1 |
Let's consider the case a = 0 and b = 0. Obviously, the answer will be n * n, because none of the knights will be able to move to any other cell of the table. Now let's assume that a != 0 or b != 0. By doing some casework, one can show that the answer for n will be the same as the answer for min(n, 10), so we can assume that n <= 10. Then, just find all possible night moves and get connected components of the corresponding graph. The answer will be the number of connected components. |
if WA3 | Programmer956 | 1131. Copying | 13 Jan 2021 09:49 | 2 |
if WA3 Programmer956 3 Apr 2020 21:49 if k > n my program worked with n < 0 you should to consider the case after cycle: if n < 0 then n = 0 Edited by author 03.04.2020 21:51 |
Who know how the 2nd test looks like?? | Last_Vikings | 1546. Japanese Sorting | 12 Jan 2021 22:29 | 18 |
We cannot imagine the test where our prog will give wrong answer! I wonder too, always wa on test 2 1w1 01w01a Edited by author 24.04.2007 19:29 No, its not 2nd test. My prog correctly process it, but stil WA2. sorted: 01w01 01w1 01w01a z000 z00 z00p z0p and one more 0 0p 01 1 1p Edited by author 25.04.2007 20:03 Try this test: z0p z00pp z0pp z00pp00 z000pp01 z00pp01 z0pp01 z001pp00 z01pp00 z1pp00000 z01pp01 z1pp001pp0 z1pp01pp000 I get WA#2 too. Huge thanks to Alexander Kouprin, after running his test and solving the problem I got accepted. Test from Alexander Georgiev also helped me a lot. By the way, my program gives other output for some test from this thread. Here they are: abc00125a abc0125a abc00125b abc0125b abc000000000000000000000125a abc00000000000000000000125a abc0012000000000000000000000000005b abc012000000000000000000000000005b These tests have almost broken my mind while I have been thinking why they are correct and I'm happy that I do not have to fix my program because of them. Zeroes matters only if strings are equal. Try this: abc0125a abc00125a abc00125b abc0125b Try this: abc0125a abc00125a abc00125b abc0125b I suppose the last test by Peter Huggy is the most similar to second test but after all this tests WA6 Try this: abc00000000000000000000125a abc000000000000000000000125a abc0012000000000000000000000000005b abc012000000000000000000000000005b I suppose the last test by Peter Huggy is the most similar to second test but after all this tests WA6 Got AC, thanks to Alias tests :) You can also try: 0000000 000 (Already sorted) Your program must return for these tests next results (alredy sorted): 1) 000 00 0 2) 00 0 000a 3) 00a000 00a0 I don't understand this. Why is 0000000 smaller than 000? What's the logic behind it? Edited by author 12.01.2021 22:30 |
Why I get WA1(the result of my code is 3 4) | Ilya | 1079. Maximum | 12 Jan 2021 20:50 | 2 |
#include <bits/stdc++.h> using namespace std; int main(){ int n; int a[100000]; a[0] = 0; a[1] = 1; int max = 1; while(cin >> n, n != 0){ if(n > max){ for(int i = max + 1; i <= n; ++i){ if(i % 2 == 0){ a[i] = a[i / 2]; } else{ a[i] = a[(i - 1) / 2] + a[(i - 1) / 2 + 1]; } max = n; } } cout << a[n - (n % 2 == 0)] << "\n"; } } Edited by author 10.01.2021 03:55 print the maximum value in the range 1 to n a13 is greater than a15 |
some tests | [MAI] do_v_5_strok | 2102. Michael and Cryptography | 12 Jan 2021 16:24 | 1 |
24303989349327424 = 2^6 * 11^14 (Yes) 79792266297612001 = 7^20 (Yes) 467851794974552912 = 7^1 * 2^4 * 11^15 (Yes) 566608619280937216 = 2^8 * 19^12 (Yes) 932195579567617600 = 5^2 * 2^6 * 17^12 (Yes) 999983616067108864 = 1953109^2 * 2^18 (Yes) 999197664639844352 = 19681^3 * 2^17 (Yes) 998848442311376896 = 15619^3 * 2^18 (No) 999999999987679232 = 1907348632789^1 * 2^19 (Yes) 798352691495399040 = 2^7 * 3^1 * 5^1 * 7^1 * 11^1 * 13^1 * 17^1 * 19^1 * 23^1 * 29^1 * 31^1 * 37^1 * 41^2 (Yes) |
Что не так (python)? | Roma | 1000. A+B Problem | 12 Jan 2021 09:33 | 2 |
a, b = int(input()), int(input()) print(a + b) Очевидно, что там один ввод, а ты два раза спрашиваешь отдельно для а и b. |