|
|
вернуться в форумWhy this code have WA on test13? Why this code have WA on test13? Please give me a test when this program fail. var N,K:longint; begin readln(N,K); if k>N then n:=k; N:=2*N; if N mod K = 0 then writeln(N div K) else writeln(N div K + 1); end. Re: Why this code have WA on test13? change 'readln' into 'read' and 'writeln' into 'write' and you'll get AC Good luck =D Edited by author 20.03.2011 10:37 Re: Why this code have WA on test13? Really, I just change readln to read and give AC. But in the text of problem: ENG: The only input line contains the integers n and k separated with a space RUS: В единственной строке через пробел записаны целые числа n и k Why readln is wrong in this input??? Re: Why this code have WA on test13? I don't know =D Re: Why this code have WA on test13? 1820. Уральские бифштексы Ограничение времени: 0.5 секунды Ограничение памяти: 64 МБ #include <iostream> using namespace std; void main() { int N,K,p; cin>>N>>K; if(K>N) N=K; N=2*N; if((N%K)==0) cout<<N/K; else cout<<(N/K)+1; } |
|
|