submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s552298002 | p03713 | C++ | #include<bits/stdc++.h>
using namespace std;long long a,b,c,d,e,w,h,ans=1e10;
int main(){
cin>>w>>h;
for(int i=0;i<=h/2;i++)
{
a=w*i,b=w/2*(h-i);
d=w*h-a-b;
ans=min(max(a,max(b,d))-min(a,min(b,d)),ans);
a=w*i,c=(h-i)/2*w;
e=w*h-a-c;
ans=min(max(a,max(c,e))-min(a,min(c,e)),ans... | a.cc: In function 'int main()':
a.cc:24:12: error: expected ';' at end of input
24 | cout<<ans
| ^
| ;
a.cc:24:12: error: expected '}' at end of input
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s369480915 | p03713 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
int main() {
int H[2], ans = (int)1e5;
cin >> H[0] >> H[1];
for (int i = 0; i < 2; i++) {
if (H[i] % 3 == 0) {
cout << 0 << endl;
return;
}
ans = min(ans, H[1 - i]);
int H1 = H[i] / 3;
int S_max = (H1 + 1) * H[1 - i];... | a.cc: In function 'int main()':
a.cc:13:25: error: return-statement with no value, in function returning 'int' [-fpermissive]
13 | return;
| ^~~~~~
|
s273515081 | p03713 | C++ | #include <iostream>
using namespace std;
int main(){
int H, W;
cin >> H >> W;
//川の字に割る
int ans;
int tmp = 999999;
if(W % 3 == 0){
ans = 0;
}else{
tmp = H;
}
//三の字に割る
if(H % == 0){
ans = 0;
}else{
tmp = min(W,tmp);
}
//Tの字に割る
for(int i = 1; i <= W-1; i++){
for(int j = 1... | a.cc: In function 'int main()':
a.cc:17:10: error: expected primary-expression before '==' token
17 | if(H % == 0){
| ^~
|
s530994490 | p03713 | C++ | #include <iostream>
using namespace std;
int main(){
int H, W;
cin >> H >> W;
//川の字に割る
int ans;
int tmp = 999999;
if(W % 3 == 0){
ans = 0;
}else(W % 3 != 0){
tmp = H;
}
//三の字に割る
if(H % == 0){
ans = 0;
}else{
int t = W;
tmp = min(t,tmp);
}
//Tの字に割る
for(int i = 1; i <= W... | a.cc: In function 'int main()':
a.cc:13:20: error: expected ';' before '{' token
13 | }else(W % 3 != 0){
| ^
| ;
a.cc:17:10: error: expected primary-expression before '==' token
17 | if(H % == 0){
| ^~
|
s378494639 | p03713 | C++ | #include <iostream>
using namespace std;
int main(){
int H, W;
cin >> H >> W;
//川の字に割る
int ans;
int tmp = 999999;
if(W % 3 == 0) ans = 0;
else(W % 3 != 0){
tmp = H;
}
//三の字に割る
if(H % == 0) ans = 0;
else{
int t = W;
tmp = min(t,tmp);
}
//Tの字に割る
for(int i = 1; i <= W-1; i++){
... | a.cc: In function 'int main()':
a.cc:12:19: error: expected ';' before '{' token
12 | else(W % 3 != 0){
| ^
| ;
a.cc:16:10: error: expected primary-expression before '==' token
16 | if(H % == 0) ans = 0;
| ^~
|
s419460722 | p03713 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long h, w;
cin >> h >> w;
if (h % 3 == 0 || w % 3 == 0) {
cout << 0 << endl;
return 0;
}
if (h > w) swap(h, w);
long w1 = (w + 1) / 3, s1 = h * w1;
w -= w1;
if (h > w) swap(h, w);
if (h % 2 == 0 || w % 2 == 0) {
long s = h * w / 2... | a.cc: In function 'int main()':
a.cc:21:14: error: no matching function for call to 'max(const long int&, int)'
21 | cout << max(max(abs(s1 - s2), abs(s1 - s3)), abs(s2 - s3)) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
... |
s000288024 | p03713 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long h, w;
cin >> h >> w;
if (h % 3 == 0 || w % 3 == 0) {
cout << 0 << endl;
return 0;
}
if (h > w) swap(h, w);
long w1 = (w + 1) / 3, s1 = h * w1;
w -= w1;
if (h > w) swap(h, w);
if (h % 2 == 0 || w % 2 == 0) {
long s = h * w / 2... | In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = long int; _Compare ... |
s450234703 | p03713 | C++ | #include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#in... | a.cc: In function 'void solve()':
a.cc:57:27: error: expected ')' before ';' token
57 | ans = min(ans, res;)
| ~ ^
| )
a.cc:57:28: error: expected primary-expression before ')' token
57 | ans = min(ans, res;)
| ... |
s067781411 | p03713 | C++ | using ll = long long ;
ll solve(ll h, ll w) {
ll mw = w/2;
ll ans = 1 << 30;
for(int hi = 1; hi <= h; ++hi) {
ll s1 = hi * w;
ll mh = (h - hi)/2;
ll s2, s3;
for(int f = 0; f<2; ++f) {
if(f==0) {
// vertical
s2 = (h - hi) * mw;... | a.cc: In function 'll solve(ll, ll)':
a.cc:26:30: error: 'max' is not a member of 'std'
26 | ll smax = std::max({s1, s2, s3});
| ^~~
a.cc:27:30: error: 'min' is not a member of 'std'
27 | ll smin = std::min({s1, s2, s3});
| ... |
s532119692 | p03713 | C++ | #include "bits/stdc++.h"
using namespace std;
long long main() {
long long H, W;
cin >> H >> W;
if (H % 3 == 0 || W % 3 == 0) cout << 0 << endl;
else {
long long ans = 1e9;
for (long long i = 1; i <= H / 2; i++) {
long long S1 = i * W;
long long S2 = (H - i) * (... | cc1plus: error: '::main' must return 'int'
|
s624836638 | p03713 | C++ | #include <bits/stdc++.h>
using namespace std;
//template
int H,W;
int ans=INF,a,b;
void f(int a,int b){
int c=H*W-a-b;if(a<=0||b<=0||c<=0)return;
ans=min(ans,max({a,b,c})-min({a,b,c}));
}
//main
signed main(){
cin>>H>>W;
for(int i=0;i<2;i++){
//横線2本
a=b=(H+1)/3*W;
f(a,b);
//縦1本->横1本
for(int ... | a.cc:5:9: error: 'INF' was not declared in this scope
5 | int ans=INF,a,b;
| ^~~
a.cc: In function 'int main()':
a.cc:15:5: error: 'a' was not declared in this scope
15 | a=b=(H+1)/3*W;
| ^
a.cc:15:7: error: 'b' was not declared in this scope
15 | a=b=(H+1)/3*W;
| ^... |
s298610791 | p03713 | C++ | #include<bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(),(a).end()
typedef long long ll;
ll mod=1000000007;
int main() {
ll h,w; cin >> h >> w;
if(h%3==0 || w%3==0){
cout << 0 << endl;
} else {
ll min_val = mod;
for(ll i=1;i<h;++i){
vector<ll> v1,v2;
ll s1a = i*w;
ll... | a.cc: In function 'int main()':
a.cc:25:19: error: expected primary-expression before ')' token
25 | ll s2b = ()(h-i)/2)*w;
| ^
|
s279512961 | p03713 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
long h,w,ans=0x7fffffffffffffff,a,b,c;
int main(){
cin>>h>>w;
if(h%3==0||w%3==0){cout<<0<<endl;return 0;}
for(long i=1;i<=h/2;i++){
a=w*i;
b=w/2*(h-i);
c=h*w-a-b;
ans=min(ans,max({a,b,c})-min({a,b,c}));
}
for(long i=1;i<=h/2;i++){
a=w*i;
b=(h-... | a.cc: In function 'int main()':
a.cc:33:15: error: expected primary-expression at end of input
33 | return
| ^
a.cc:33:15: error: expected ';' at end of input
33 | return
| ^
| ;
a.cc:33:15: error: expected '}' at end of input
a.cc:5:11: ... |
s827840628 | p03713 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
int main() {
const ll INF = 1000000000000;
ll H, W, hA, hB, hC, hBC, wA, wB, wC, wBC, SA, SB, SC, t;
ll ans... | a.cc: In function 'int main()':
a.cc:22:11: error: assigning to an array from an initializer list
22 | S = {SA, SB, SC};
| ~~^~~~~~~~~~~~~~
a.cc:33:11: error: assigning to an array from an initializer list
33 | S = {SA, SB, SC};
| ~~^~~~~~~~~~~~~~
a.cc:43:11: error: ass... |
s628084804 | p03713 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
int main() {
const ll INF = 1 << 50;
ll H, W, hA, hB, hC, hBC, wA, wB, wC, wBC, SA, SB, SC, t;
ll ans1 = IN... | a.cc: In function 'int main()':
a.cc:12:22: warning: left shift count >= width of type [-Wshift-count-overflow]
12 | const ll INF = 1 << 50;
| ~~^~~~~
a.cc:15:8: error: storage size of 'S' isn't known
15 | ll S[];
| ^
|
s668850535 | p03713 | C++ | #include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <functional>
using namespace std;
int main(){
long long ans = 999999999999999;
for(int i = 1; i < n; i++){
a = i * m;
b = m/2;
c = t - a - b;
if(c > 0 && b > 0){
ans =... | a.cc: In function 'int main()':
a.cc:15:22: error: 'n' was not declared in this scope
15 | for(int i = 1; i < n; i++){
| ^
a.cc:16:5: error: 'a' was not declared in this scope
16 | a = i * m;
| ^
a.cc:16:13: error: 'm' was not declared in this scope
16 | a = i * m... |
s478666148 | p03713 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll h,w; cin>>h >>w;
int ans=INT_MAX;
for(int i=1;i<h;i++){
ll sa=i*w;
ll s=h*w-sa;
ans=min(ans,max(sa,s/2)-min(sa,s/2));
}
for(int i=1;i<w;i++){
ll sa=i*h;
ll s=h*w-sa;
ans=min(ans,max(sa,s/2)-min(sa,s/2));
... | a.cc: In function 'int main()':
a.cc:10:12: error: no matching function for call to 'min(int&, long long int)'
10 | ans=min(ans,max(sa,s/2)-min(sa,s/2));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c+... |
s819792468 | p03713 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin >> H >> W;
long long ans;
int hei,wid;
long long S1,S2,mini;
if(H%3==0||W%3==0){
ans=0;
}else if(H%2==0){
hei=H/2;
wid=W/3;
mini = hei*(W-3*wid);
wid++;
S1=hei*wid*2;
S2=hei*(W-wid);
while(abs(S2-S1)<mini){
mini=abs... | a.cc: In function 'int main()':
a.cc:47:26: error: no matching function for call to 'min(long long int, int&)'
47 | while(min(abs(S2-S1),wid)<mini){
| ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linu... |
s728185363 | p03713 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ll h,w;
cin >> h >> w;//h>=Wとしてよい
if(w>h){
swap(h,w);
}//hが長辺
if((h*w)%3 == 0){
cout << 0 << endl;
}else{
ll ans1=10000000002,ans2=10000000002,ans3=10000000002;
for(ll i=h/3;... | a.cc: In function 'int main()':
a.cc:17:36: error: 'one' was not declared in this scope
17 | for(ll j=max((2*h/3)-1,one);j <= (2*h+3)/3;j++){
| ^~~
a.cc:23:34: error: 'one' was not declared in this scope
23 | for(ll j=max((w/2)-1,one);j <= (2+w)/2 ;... |
s024589672 | p03713 | Java |
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.stream.IntStream;
public class Main {
public static void main(String[] args) throws IOException {
new Main().solve();
}
p... | Main.java:212: error: incompatible types: possible lossy conversion from long to int
wkH = numH;
^
Main.java:213: error: incompatible types: possible lossy conversion from long to int
wkW = numW;
^
Main.java:215: error: incompatible types: possible lossy conversion from long to int
wkH =... |
s567808942 | p03713 | Java |
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.stream.IntStream;
public class Main {
public static void main(String[] args) throws IOException {
new Main().solve();
}
p... | Main.java:212: error: incompatible types: possible lossy conversion from long to int
wkH = numH;
^
Main.java:213: error: incompatible types: possible lossy conversion from long to int
wkW = numW;
^
Main.java:215: error: incompatible types: possible lossy conversion from long to int
wkH =... |
s571680376 | p03713 | C++ | #include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#d... | a.cc: In function 'int main()':
a.cc:47:35: error: 'cnt' was not declared in this scope; did you mean 'int'?
47 | ans = min(cnt, ans);
| ^~~
| int
|
s009237711 | p03713 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll H,W;
cin>>H>>W;
if(H%3==0||W%3==0){
cout<<0<<endl;
return 0;
}
if(H<W)swap(H,W);
ll case1,case2;
case1=case2=1e12;
for(int i=0;i<2;i++){
if(i)swap(H,W);
... | a.cc: In function 'int main()':
a.cc:27:46: error: 'c2' was not declared in this scope; did you mean 'c1'?
27 | ll s1=max({abs(a1-b1),abs(c1-b1),abs(c2-a2)});
| ^~
| c1
a.cc:27:49: error: 'a2' was not declar... |
s827121519 | p03713 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
int ans = 1e9*1e9;
//
for (int h=1; h<H-1; h++) {
int a = h*W;
// b and c divided by tate
int w = W/2;
int b = (H-h)*w;
int c = (H-h)*(W-w);
int s_max = max(max(a, b), c);
int s_min = min(min... | a.cc: In function 'int main()':
a.cc:8:16: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
8 | int ans = 1e9*1e9;
| ~~~^~~~
a.cc:24:20: error: expected '}' at end of input
24 | c = (H-h-h2)*W;
| ^
a.... |
s108326614 | p03713 | C++ | using namespace std;
#include<bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0)
#define END return EXIT_SUCCESS
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR(I,0,N)
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
... | a.cc: In function 'void solve()':
a.cc:39:13: error: 'WW' was not declared in this scope; did you mean 'ww'?
39 | b=(H-h)*WW;
| ^~
| ww
|
s591818961 | p03713 | C++ | using namespace std;
#include<bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0)
#define END return EXIT_SUCCESS
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR(I,0,N)
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
... | a.cc: In function 'void solve()':
a.cc:36:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
36 | chmin(ans,max(a,max(b,c))-min(a,min(b,c)));
| ^~~
| abs
a.cc:38:13: error: 'WW' was not declared in this scope; did you mean 'ww'?
38 | b=(H-h)*WW;
| ... |
s996376035 | p03713 | C++ | using namespace std;
#include<bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0)
#define END return EXIT_SUCCESS
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR(I,0,N)
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
... | a.cc: In function 'void solve()':
a.cc:31:6: error: 'h' was not declared in this scope
31 | UP(h,2,H){
| ^
a.cc:7:24: note: in definition of macro 'UP'
7 | #define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
| ^
a.cc:32:5: error: 'a' was not declared in this scope
32 | ... |
s055404109 | p03713 | C++ | using namespace std;
#include<bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0)
#define END return EXIT_SUCCESS
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR(I,0,N)
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
... | a.cc: In function 'void solve()':
a.cc:40:8: error: 'odd' was not declared in this scope
40 | c=(odd(H,W)-a)*(even(H,W)/2);
| ^~~
|
s204488998 | p03713 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
int a_size;
int b_size;
int a, b, c;
//case 1
if (h % 3 == 0) {
a_size = h / 3;
}
else if (h % 3 == 1) {
a_size = (h - 1) / 3;
}
else {
a_size = (h - 2) / 3;
}
a = a_size * w;
//縦向き
if ((h - a_size) %... | In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/includ... |
s063200233 | p03713 | C++ | include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <algorithm>
#include <array>
#include <complex>
#include <string>
#include <utility>
#include <map>
#include <queue>
#include <list>
#include <functional>
#include <numeric>
#include <stack>
#include <tuple>
using namespace... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/vector:62,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu... |
s851153435 | p03713 | Java | import java.util.Scanner;
public class atcoder {
public static void main(String[] args) {
Scanner stdIn=new Scanner(System.in);
long H=stdIn.nextLong();
long W=stdIn.nextLong();
long min=2147482704;
long z=1;
if(H%3==0||W%3==0)
System.out.println(0);
else{
while(H-1>z){
if(W/2*z<(H-z)*W){
... | Main.java:2: error: class atcoder is public, should be declared in a file named atcoder.java
public class atcoder {
^
1 error
|
s015378435 | p03713 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int h,w,ans=-1;
cin>>h>>w;
if(h%3==0 || w%3==0)ans=0;
else if(h%2==0 || h==w)ans=h/2;
else if(h%2==1 || h==w)ans=h-1;
if(ans==-1){
if(h>w)swap(h,w);
if(h%2==0){
if(w%2==1 && w<h/2)ans=w;
... | a.cc: In function 'int main()':
a.cc:22:2: error: expected '}' at end of input
22 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s649573915 | p03713 | C++ | }
long long w = H * W / 3 / H;
long long ans2 = abs( w * H - (W - w) * (H / 2) );
rest = H * W - w * H - (W - w) * (H / 2);
ans2 = max( ans2, max( abs( w * H - rest ), abs( abs( (W - w) * (H / 2) - rest ) ) ) );
while( 1 ) {
w++;
long long nextans = abs( w * H - (W - w) * (H / 2) );
rest = H * W - ... | a.cc:1:17: error: expected declaration before '}' token
1 | }
| ^
a.cc:2:31: error: 'H' was not declared in this scope
2 | long long w = H * W / 3 / H;
| ^
a.cc:2:35: error: 'W' was not declared in this scope
2 | ... |
s249087164 | p03713 | C++ | h = H / 3;
long long ans3 = abs( h * W - (h + 1) * W );
| a.cc:1:17: error: 'h' does not name a type
1 | h = H / 3;
| ^
a.cc:2:39: error: 'h' was not declared in this scope
2 | long long ans3 = abs( h * W - (h + 1) * W );
| ^
a.cc:2:43: error: 'W' was not declared in this... |
s870827873 | p03713 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define ll long long
int main () {
ll n, m;
cin >> n >> m;
if (n % 3 == 0 || m % 3 == 0 ) {
cout << 0 << endl;
}
else {
vector<ll> sub(3);
// まずはどの程度やるか決める
ll min = -1;
ll l = n / 3;
ll v[5] = {0, -1,... | a.cc: In function 'int main()':
a.cc:17:38: error: too many initializers for 'long long int [5]'
17 | ll v[5] = {0, -1, 1, -2, 2, 3, -3};
| ^
|
s837011938 | p03713 | C++ | H, W = map(int, input().split())
if H % 3 == 0 or W % 3 == 0:
print(0)
else:
S_list = []
for i in range(1, H-1):
w = W//2
S_A = i*W
S_B = (H-i)*w
S_C = (H-i)*(W-w)
S_list.append(max(S_A,S_B,S_C) -min(S_A,S_B,S_C))
for i in range(1, W-1):
h = H//2
... | a.cc:1:1: error: 'H' does not name a type
1 | H, W = map(int, input().split())
| ^
|
s871883680 | p03713 | C++ | H, W = map(int, input().split())
if H % 3 == 0 or W % 3 == 0:
print(0)
else:
S_list = []
for i in range(1, H-1):
w = W//2
S_A = i*W
S_B = (H-i)*w
S_C = (H-i)*(W-w)
S_list.append(max(S_A,S_B,S_C) -min(S_A,S_B,S_C))
for i in range(1, W-1):
h = H//2
... | a.cc:1:1: error: 'H' does not name a type
1 | H, W = map(int, input().split())
| ^
|
s504903706 | p03713 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
int main(){
int H,W;
cin >> H >> W;
if(H % 3 == 0 || W % 3 ... | a.cc: In function 'int main()':
a.cc:19:5: error: 'Smax' was not declared in this scope; did you mean 'fmax'?
19 | Smax = (H/2 + 1)* W;
| ^~~~
| fmax
a.cc:21:5: error: 'Smin' was not declared in this scope; did you mean 'fmin'?
21 | Smin = W/2 * H;
| ^~~~
| fmin
a.c... |
s284573694 | p03713 | C++ | include<iostream>
#include<algorithm>
using ll = long long;
using namespace std;
int main() {
int H, W;
cin >> H >> W;
ll ans1=1e10, ans2=1e10, ans3=1e10, ans4=1e10;
if (H % 3 == 0 || W % 3 == 0)
cout << 0 << endl;
else {
for (int i = 1; i < H; ++i) {
int j = W / 2;
ll a1 = W * i;
ll b1 = (H - i)*j;
... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __g... |
s821328054 | p03713 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <deque>
#include <algorithm>
#include <climits>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(int i=0; i<n; i++)
int main(){
int H,W;
cin >> H >> W;
if(H%3 == 0 || W%3 == 0){
cou... | a.cc: In function 'int main()':
a.cc:36:27: error: call of overloaded 'abs(ull)' is ambiguous
36 | diff = abs(S1 - S2);
| ~~~^~~~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/ext/string_conversions.h:43,
... |
s380990457 | p03713 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long h,w,ans=1e18,yoko,tate;
cin>>h>>w;
yoko=w/2;
tate=h/2;
if(h==3||w==3){
cout<<0<<endl;
return 0;
}
for(int i=1;i<h-1;i++){
long long tate1=(h-i)/2;
ans=min(ans,max({i*w,tate1*w,(h-tate1-i)*w}),min({i*w,tate1*w,(h-tate1-i)*... | In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Com... |
s563813191 | p03713 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long h,w,ans=1e18,yoko,tate;
cin>>h>>w;
yoko=w/2;
tate=h/2;
if(h==3||w==3){
cout<<0<<endl;
return 0;
}
for(int i=1;i<h-1;i++){
ans=min(ans,max({i*w,((h-i)/2)*w,(h-((h-i)/2)-i)*w}),min({i*w,((h-i)/2)*w,(h-((h-i)/2)-i)*w}));
}
f... | In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Com... |
s666384867 | p03713 | C++ | from strutils import split, parseInt, parseFloat
from sequtils import map
import macros
macro unpack*(input: seq; count: static[int]): untyped =
result = quote do: ()
when NimMinor <= 13: # 本当にここが区切りかどうかは知らない
for i in 0..<count: result[0].add quote do: `input`[`i`]
else:
for i in 0..<count: result.add qu... | a.cc:7:24: error: stray '#' in program
7 | when NimMinor <= 13: # 本当にここが区切りかどうかは知らない
| ^
a.cc:8:14: error: too many decimal points in number
8 | for i in 0..<count: result[0].add quote do: `input`[`i`]
| ^~~
a.cc:8:49: error: stray '`' in program
8 | ... |
s139905432 | p03713 | C++ | #include<algorithm>
#include<math.h>
using namespace std;
typedef long long ll;
//hが奇数でwを動かすとき
int odd(int h, int w, int x,int m) {
if (h*x >= (h + 1)*(w - x) / 2)return min(m, h*x - (h - 1)*(w - x) / 2);
if (h*x >= (h - 1)*(w - x) / 2)return min(m, w - x);
if (h*x < (h - 1)*(w - x) / 2)return min(m, -h*x + (h + 1)... | a.cc: In function 'int main()':
a.cc:15:9: error: 'cin' was not declared in this scope
15 | cin >> h >> w;
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include<math.h>
+++ |+#include <iostream>
3 | us... |
s037154537 | p03713 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
using ll = long long;
int main() {
ll h, w;
cin >> h >> w;
ll ans = 1e9;
if (w*h % 3 == 0) {
cout << 0 << endl;
return 0;
}
for (int i = 1;i < h;i++) {
ll s1 = i * w, s2 = w / 2 * (h - i), s3 = h * w - s1 - s2;
ll a = max(s1, max(s2, s3));
ll ... | a.cc: In function 'int main()':
a.cc:33:20: error: redeclaration of 'll a'
33 | ll a = max(t1, max(t2, t3));
| ^
a.cc:28:20: note: 'll a' previously declared here
28 | ll a = max(s1, max(s2, s3));
| ^
a.cc:34:20: error: redeclaratio... |
s084472527 | p03713 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
using ll = long long;
int main() {
ll h, w;
cin >> h >> w;
ll ans = 1e9;
if (w*h % 3 == 0) {
cout << 0 << endl;
return 0;
}
for (int i = 1;i < h;i++) {
ll s1 = i * w, s2 = w / 2 * (h - i), s3 = h * w - s1 - s2;
ll a = max(s1, max(s2, s3));
ll ... | a.cc: In function 'int main()':
a.cc:20:54: error: redeclaration of 'll s3'
20 | ll t1 = i * w, t2 = (h - i) / 2 * w, s3 = h * w - s1 - s2;
| ^~
a.cc:15:54: note: 'll s3' previously declared here
15 | ll s1 = i * w, s2 = w ... |
s897652426 | p03713 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int h,w;
int cand1=1e9,cand2=1e9;
cin>> h >> w;
for (int i=1; i<h; i++){
long long a[3];
long long b[3];
a[0]=i*w;
b[0]=i*w;
a[1]=(h-i)*(w/2);
b[1]=((h-i)/2)*w;
a[2]=h*w-a[0]... | a.cc: In function 'int main()':
a.cc:19:18: error: no matching function for call to 'min(int&, long long int)'
19 | cand1=min(cand1,a[2]-a[0]);
| ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s900361895 | p03713 | C++ | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7f7f7f7f;
int dp[150][150];
int num[150];
bool cmp(int a,int b)
{
return a<b;
}
int gcd(int a,int b)
{
if(b==0)
{
return a;
}
else
return gcd(b,a%b);
}
int main()
{
int h,w;
cin>>h>>w;
if(... | a.cc: In function 'int main()':
a.cc:29:21: error: 'n' was not declared in this scope
29 | int ans=max(n,m);
| ^
a.cc:29:23: error: 'm' was not declared in this scope
29 | int ans=max(n,m);
| ^
|
s138012501 | p03713 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<set>
#include<cmath>
#include<iomanip>
#include<functional>
using namespace std;
int INF = 1e9 + 7;
typedef long long ll;
typedef pair<int, int> P;
int ans = INF;
int choco(int H, int W) {
int h, w, sa... | In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/includ... |
s811750316 | p03713 | C++ | #include <bits/stdc++.h>
#include <numeric>
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
#define LL long long
... | a.cc: In function 'long long int find(long long int, long long int)':
a.cc:17:5: error: 'LLint' was not declared in this scope
17 | LLint ans = INT_MAX;
| ^~~~~
a.cc:28:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
28 | ans = min(ans, a[2] - a[0]);
| ^~~
... |
s937951287 | p03713 | C++ | #include <bits/stdc++.h>
#include <numeric>
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
#define LL long long
... | a.cc: In function 'int find(int, int)':
a.cc:28:18: error: no matching function for call to 'min(int&, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
28 | ans = min(ans, a[2] - a[0]);
| ~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/... |
s496476734 | p03713 | C++ | #include <bits/stdc++.h>
#include <numeric>
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
#define LL long long
... | a.cc: In function 'int main()':
a.cc:32:22: error: expected ')' before ';' token
32 | cin >> h >> w;
| ^
| )
a.cc:31:8: note: to match this '('
31 | if (int h, w;
| ^
a.cc:33:26: error: 'h' was not declared in this scope
33 | ... |
s679646679 | p03713 | C++ | #include <bits/stdc++.h>
#include <numeric>
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
#define LL long long
... | a.cc: In function 'int find(int, int)':
a.cc:24:12: error: cannot resolve overloaded function 'min' based on conversion to type 'int'
24 | return min;
| ^~~
|
s032749614 | p03713 | C++ | #! /usr/bin/env python3
def main():
H, W = map(int, input().split())
# if (H > 2 and H % 3 == 0) or (W > 2 and W % 3 == 0):
# print(0)
# else:
ans = H * W
left = 0
up = 1
while 1:
a = W * up
b = (H - up) * (left)
c = (H - up) * (W - left)
ans = min(an... | a.cc:1:2: error: invalid preprocessing directive #!
1 | #! /usr/bin/env python3
| ^
a.cc:5:58: error: ':' without preceding '?'
5 | # if (H > 2 and H % 3 == 0) or (W > 2 and W % 3 == 0):
| ^
a.cc:7:11: warning: extra tokens at end of #el... |
s037695056 | p03713 | C++ | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1e9 + 7, MOD = 1e9 + 7;
const long long LINF = 1e18;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
signed main() {
int h, w;
cin >> h >> w;
int ans = INF;
if (h % 3 == 0 || w % 3 == 0) {
cout << 0 << endl;
return 0;
}... | a.cc: In function 'int main()':
a.cc:23:21: error: redeclaration of 'long long int Max'
23 | int Max = max({S1, S2, S3}), Min = min({S1, S2, S3});
| ^~~
a.cc:19:21: note: 'long long int Max' previously declared here
19 | int Max = max({S1, S2, S3}), Min = ... |
s160401568 | p03713 | C++ |
#include <bits/stdc++.h>
#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(conditi... | a.cc: In function 'int main()':
a.cc:141:11: error: cannot resolve overloaded function 'max' based on conversion to type 'long long int'
141 | pos=max{cnt,cntt,cnttt};
| ^~~
a.cc:142:12: error: cannot resolve overloaded function 'min' based on conversion to type 'll' {aka 'long long int'}
142 ... |
s509909417 | p03713 | C++ |
/*---------------------------------------------------------------
long long int kaizyo(long long int hh){
cmp=1;
while(hh>1){
cmp=(cmp*hh)%MOD;
hh--;
}
return cmp;
}
long long int ruizyo(long long int aa, long long int bb){
if(aa==0){
return 1;
}
else if(aa%2==0){
... | a.cc:197:1: error: 'string' does not name a type
197 | string alph("abcdefghijklmnopqrstuvwxyz"),s;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:204:8: error: 'cin' was not declared in this scope
204 | cin.tie(0);
| ^~~
a.cc:205:5: error: 'ios' has not been declared
205 | ios::sync_... |
s375435550 | p03713 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition... | a.cc: In function 'int main()':
a.cc:139:17: error: cannot resolve overloaded function 'max' based on conversion to type 'long long int'
139 | pos=max{cnt,cntt,cnttt};
| ^~~
a.cc:265:15: error: a function-definition is not allowed here before '{' token
265 | int main(void){
|... |
s448436495 | p03713 | C++ | #include <iostream>
#include <utility>
#include <cstdlib>
#include <cmath>
using namespace std;
int main() {
int h, w, ans = 2147483647;
cin >> h >> w;
if(w >= 3) ans = min(ans, (w % 3 ? 1 : 0) * h); // ||
if(h >= 3) ans = min(ans, (h % 3 ? 1 : 0) * w); // =
long long half = floor(w / 2), a, b, c; // T
for... | a.cc: In function 'int main()':
a.cc:20:26: error: no matching function for call to 'min(int&, long long int)'
20 | ans = min(ans, max(a, max(b, c)) - min(a, min(b, c)));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,... |
s380600556 | p03713 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <tuple>
using ll = long long;
using namespace std;
#define modmod 1000000007
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,k,n) for(int i=k;i<n;i++)
int main(){
int H,W;
cin >> ... | a.cc: In function 'int main()':
a.cc:37:21: error: no matching function for call to 'min(ll&, int&)'
37 | result = min(result,H);
| ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
fr... |
s187390302 | p03713 | C++ | #include <bits/stdc++.h>
//---------------------------
using namespace std;
//---------------------------
#define REP(i,n) for(int i = 0; i < (n); i++)
#define P(x) cout << (x) << "\n"
#define MOD 1000000007 // 1e9+7
#define PI acos(-1.0)
#define ll long long int // 10^18
#define INF 1000000001 // 1e9+1
int dx[4]={1,... | a.cc: In function 'int main()':
a.cc:39:2: error: expected '}' at end of input
39 | }
| ^
a.cc:17:11: note: to match this '{'
17 | int main(){
| ^
|
s142304778 | p03713 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <set>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
using namespace std;
typedef long long int lli;
const int MAX=1e5;
lli f(lli a,lli b,lli c){
... | a.cc: In function 'int main()':
a.cc:27:9: error: 'x' was not declared in this scope
27 | cout<<x<<endl;
| ^
|
s614028658 | p03713 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <set>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
using namespace std;
typedef long long int lli;
const int MAX=1e5;
lli f(lli a,lli b,lli c){
... | a.cc: In function 'int main()':
a.cc:27:9: error: 'x' was not declared in this scope
27 | cout<<x<<endl;
| ^
|
s139094174 | p03713 | C++ | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<ll, P> E;
#define cost first
#define from second.first
#define to second.second
#define MOD (1000000007ll)
#define l_ength size
void mul_mod(ll& a, ll b){
a *= b;
a %... | a.cc: In function 'int main()':
a.cc:26:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
26 | ans = min(h,w);
| ^~~
| abs
|
s881124618 | p03713 | C++ | #include <iostream>
#include <climits>
#include <string>
#include <stdlib.h>
#include <algorithm>
using namespace std;
int ascSort(const void* v1, const void* v2) {
const int _v1 = *((const int*)v1);
const int _v2 = *((const int*)v2);
if ( _v1 < _v2 ) {
return 1;
} else if ( _v1 > _v2 ) {
... | a.cc: In function 'int main()':
a.cc:30:2: error: expected '}' at end of input
30 | }
| ^
a.cc:21:12: note: to match this '{'
21 | int main() {
| ^
|
s579834753 | p03713 | Java | import java.util.Scanner;
/**
* https://abc062.contest.atcoder.jp/tasks/arc074_a
*/
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long H = sc.nextLong();
long W = sc.nextLong();
sc.close();
long ans = Math.min((H%3==0 ? 0:1)*W,(W%3==0 ? 0:1)*H);
... | Main.java:35: error: reached end of file while parsing
}
^
1 error
|
s771715357 | p03713 | C++ | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <... | a.cc:5:19: warning: extra tokens at end of #include directive
5 | #include <sstream>#include <cstdio>
| ^
a.cc:116:14: error: redefinition of 'const double pi'
116 | const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
| ... |
s239997101 | p03713 | C++ | #include <iostream>
using namespace std;
int main(void) {
int h, w;
cin >> h >> w;
if (h % 3 == 0 || w % 3 == 0) {
cout << 0 << endl;
return 0;
}
//yoko*3
int mi = w;
//yoko*2=>tate*2
int area[3];
int h1 = h / 3;
int w1 = w / 2;
area[0] = w * h1;
area[1] = w1 * (h - h1);
area[2] = (w -... | a.cc: In function 'int main()':
a.cc:19:3: error: 'sort' was not declared in this scope; did you mean 'short'?
19 | sort(area, area + 3);
| ^~~~
| short
|
s805188745 | p03713 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(void){
ll H, W;
cin >> H >> W;
ll ans = H*W;
for(ll i=1;i<=H;i++){
ll a = i*W;
ll b = (H-i)/2*W;
ans = min(ans, max(a, max(b, H*W-a-b))-min(a, min(b, H*W-a-b)));
}
for(ll i=1;i<=W;i++){
... | a.cc: In function 'int main()':
a.cc:21:21: error: expected ';' before 'll'
21 | ll a = W*i;1
| ^
| ;
22 | ll b = W/2*(H-i);
| ~~
a.cc:23:35: error: 'b' was not declared in this scope
23 | ans = min(ans, max(a,... |
s918693789 | p03713 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
ll main(void){
ll H, W;
cin >> H >> W;
ll ans = H*W;
for(ll i=1;i<=H;i++){
ll a = i*W;
ll b = (H-i)/2*W;
ans = min(ans, max(a, max(b, H*W-a-b))-min(a, min(b, H*W-a-b)));
}
for(ll i=1;i<=W;i++){
... | a.cc:6:1: error: '::main' must return 'int'
6 | ll main(void){
| ^~
a.cc: In function 'int main()':
a.cc:21:21: error: expected ';' before 'll'
21 | ll a = W*i;1
| ^
| ;
22 | ll b = W/2*(H-i);
| ~~
a.cc:23:35: e... |
s949490975 | p03713 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H,W,max,min,ans;
cin >> H >> W;
if(N*W%3==0)ans=0;
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:5: error: 'N' was not declared in this scope
8 | if(N*W%3==0)ans=0;
| ^
|
s355079348 | p03713 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H,W,max,min,ans;
cin >> N >> W;
if(N*W%3==0)ans=0;
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:9: error: 'N' was not declared in this scope
6 | cin >> N >> W;
| ^
|
s437320402 | p03713 | C | #include <stdio.h>
long judge(long, long);
int main(void){
long W, H;
scanf("%ld %ld", &H, &W);
if(W%3==0 || H%3==0){
printf("0");
return 0;
}
printf("%d", judge(H,W)>judge(W,H)?judge(W,H):judge(H,W));
return 0;
}
long judge(long H, long W){
int used, i;
long S, target, Max, Mid, Min, tmp;
S = H*W;
target = S/3... | main.c: In function 'judge':
main.c:66:15: error: expected ';' before '}' token
66 | return Max-Min
| ^
| ;
67 |
68 | }
| ~
|
s092215653 | p03713 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long int
signed main(void)
{
int H, W;
cin >> H >> W;
if( W > H ){
W += H;
H = W - H;
W -= H;
}
int a, b, c;
int H_mod_3 = H % 3;
int W_mod_3 = W % 3;
int max = 0;
int min = 10000000000000;
int... | a.cc: In function 'int main()':
a.cc:40:16: error: 'min' cannot be used as a function
40 | cout << min(ans,W);
| ~~~^~~~~~~
|
s190715881 | p03713 | C++ | #include <iostream>
using namespace std;
int max(int a, int b, int c) {
if (a > b&&a > c)return a;
else if (b > a&&b > c)return b;
else return c;
}
int min(int a, int b, int c) {
if (a < b&&a < c)return a;
else if (b < a&&b < c)return b;
else return c;
}
int mmd(int a, int b, int c) {
return max(a, b, c) -... | a.cc: In function 'int main()':
a.cc:25:34: error: 'INT_MAX' was not declared in this scope
25 | int H, W, a, b, c, tmp = INT_MAX;
| ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
1 | #incl... |
s138862029 | p03713 | C++ | #include <bits/stdc++.h>
using namespace std;
int m(int a1, int a2, int a3) {
if (a1 > a2) {
swap(a1, a2);
}
if (a2 > a3) {
swap(a2, a3);
}
if (a1 > a2) {
swap(a1, a2);
}
return a3-a1;
}
int f(int H, int W) {
int r = 10000000;
int k = H / 3;
if (k != 0) {
r = min(r, m(k * W, (H - k)*(W / 2), (H - k)*(... | a.cc: In function 'int main()':
a.cc:38:12: error: expected '}' at end of input
38 | return 0;
| ^
a.cc:24:11: note: to match this '{'
24 | int main(){
| ^
|
s710860843 | p03713 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int h,w;
cin>>h>>w;
for(int i=0; i<h; i++){
s[0]
}
}
| a.cc: In function 'int main()':
a.cc:8:17: error: 's' was not declared in this scope
8 | s[0]
| ^
|
s316434248 | p03713 | C | #define L long long
L n(L a,L b){return a<b?a:b;}
L x(L a,L b){return a>b?a:b;}
L l(L a){return a>0?a:-a;}
#define E(p,q) x(l(b*i-p),l(b*i-q))
L s(int a,int b){
L i=0,p=1<<30;
for(;i++<a;p=n(p,n(E((a-i)/2*b,b*(a-i-(a-i)/2)),E(b/2*(a-i),(a-i)*(b-b/2)))));
}
int main(void){
L h,w;
scanf("%d%d",&h,&w);
... | main.c: In function 'main':
main.c:13:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
13 | scanf("%d%d",&h,&w);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | #define L long long
main.c:13:5: warn... |
s354061703 | p03713 | C | #define L long long
L n(L a,L b){return a<b?a:b;}
L x(L a,L b){return a>b?a:b;}
L l(L a){return a>0?a:-a}
#define E(p,q) x(l(b*i-p),l(b*i-q))
L s(int a,int b){
L i=0,p=1<<30;
for(;i++<a;p=n(p,n(E((a-i)/2*b,b*(a-i-(a-i)/2)),E(b/2*(a-i),(a-i)*(b-b/2)))));
}
int main(void){
L h,w;
scanf("%d%d",&h,&w);
p... | main.c: In function 'l':
main.c:4:25: error: expected ';' before '}' token
4 | L l(L a){return a>0?a:-a}
| ^
| ;
main.c: In function 'main':
main.c:13:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
13 | scanf("%... |
s507089860 | p03713 | C | #define L long long
L n(L a,L b){return a<b?a:b;}
L x(L a,L b){return a>b?a:b;}
L l(L a){return a>0?a:-a}
#define E(p,q) x(l(b*i-p),l(b*i-q));
L s(int a,int b){
L i=0,p=1<<30;
for(;i++<a;p=n(p,n(E((a-i)/2*b,b*(a-i-(a-i)/2)),E(b/2*(a-i),(a-i)*(b-b/2)))));
}
int main(void){
L h,w;
scanf("%d%d",&h,&w);
... | main.c: In function 'l':
main.c:4:25: error: expected ';' before '}' token
4 | L l(L a){return a>0?a:-a}
| ^
| ;
main.c: In function 's':
main.c:5:36: error: expected ')' before ';' token
5 | #define E(p,q) x(l(b*i-p),l(b*i-q));
| ... |
s290406159 | p03713 | C | #define L long long
L n(L a,L b){return a<b?a:b;}
L x(L a,L b){return a>b?a:b;}
#define E(p,q) x(llabs(b*i-p),llabs(b*i-q));
L s(int a,int b){
L i=0,p=1<<30;
for(;i++<a;p=n(p,n(E((a-i)/2*b,b*(a-i-(a-i)/2)),E(b/2*(a-i),(a-i)*(b-b/2)))));
}
int main(void){
L h,w;
scanf("%d%d",&h,&w);
printf("%d",n(s(h,... | main.c: In function 's':
main.c:4:18: error: implicit declaration of function 'llabs' [-Wimplicit-function-declaration]
4 | #define E(p,q) x(llabs(b*i-p),llabs(b*i-q));
| ^~~~~
main.c:7:24: note: in expansion of macro 'E'
7 | for(;i++<a;p=n(p,n(E((a-i)/2*b,b*(a-i-(a-i)/2)),E(b/2*(a-i)... |
s071435453 | p03713 | C | #define L long long
L n(L a,L b){return a<b?a:b;}
L x(L a,L b){return a>b?a:b;}
#define E(p,q) x(llabs(b*i-p),llabs(b*i-q));
L s(int a,int b){
L i=0,p=1<<30;
for(;i++<a;p=n(p,n(E((a-i)/2*b,b*(a-i-(a-i)/2)),E(b/2*(a-i),(a-i)*(b-b/2)))));
}
int main(void){
L h,w;
scanf("%d%d",&h,&w);
printf("%d",n(s(h,... | main.c: In function 's':
main.c:4:18: error: implicit declaration of function 'llabs' [-Wimplicit-function-declaration]
4 | #define E(p,q) x(llabs(b*i-p),llabs(b*i-q));
| ^~~~~
main.c:7:24: note: in expansion of macro 'E'
7 | for(;i++<a;p=n(p,n(E((a-i)/2*b,b*(a-i-(a-i)/2)),E(b/2*(a-i)... |
s960113622 | p03713 | C++ | #include <iostream>
#include <vector>
using namespace std;
#define int long long
auto main() -> signed {
int H, W;
cin >> H >> W;
if(H%3==0||W%3==0) {
cout << 0 << endl;
return 0;
}
int ans = 1e+9;
for(int h=1; h<H; ++h) {
int a = h*W;
int bw = W/2;
int ... | a.cc: In function 'int main()':
a.cc:24:9: error: 'sort' was not declared in this scope; did you mean 'short'?
24 | sort(v.begin(), v.end());
| ^~~~
| short
a.cc:49:9: error: 'sort' was not declared in this scope; did you mean 'short'?
49 | sort(v.begin(), v.end());
... |
s340443033 | p03713 | C++ | #include <iostream>
using namespace std;
#define int long long
int main()
{
int h, w, i, y;
int x1, x2, x3;
int _min, _max;
long long answer = 1e11;
cin >> h >> w;
if(h % 3 == 0 || w % 3 == 0)
{
cout << "0";
}
else
{
//1
for(i=0; i<=h; i++)
{
x1 = i * w;
x2 = (h - i) *... | cc1plus: error: '::main' must return 'int'
|
s796453767 | p03713 | C | #include <stdio.h>
int main()
{
int h, w, h1, h2;
int answer = 0;
int x1, x3;
int m, n;
scanf("%d %d", &m, &n);
if(m >= n)
{
h = m;
w = n;
}
else
{
h = n;
w = m;
}
if(h % 3 == 0 || w % 3 == 0)
{
answer = 0;
}
else
{
//1
h1 = h / 3;
if(h % 3 == 2) h1++;
... | main.c: In function 'main':
main.c:43:13: error: expected expression before '<' token
43 | if(w =< h2)
| ^
|
s041519355 | p03713 | C | //
x2 = (h - i) / 2 * w;
x3 = h * w - x1 - x2;
if(x1 <= x2)
{
min = x1;
max = x3;
}
else if(x2 < x1 && x1 < x3)
{
min = x2;
max = x3;
}
else
{
min = x2;
max = x1;
}
if(answer1 > max - min)
{
... | main.c:2:7: warning: data definition has no type or storage class
2 | x2 = (h - i) / 2 * w;
| ^~
main.c:2:7: error: type defaults to 'int' in declaration of 'x2' [-Wimplicit-int]
main.c:2:13: error: 'h' undeclared here (not in a function)
2 | x2 = (h - i) / 2 * w;
| ^
m... |
s809567362 | p03713 | C++ |
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner scan = new Scanner(System.in);
long h = scan.nextLong();
long w = scan.nextLong();
long answer;
if(h%3==0... | a.cc:2:1: error: 'import' does not name a type
2 | import java.io.IOException;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.util.ArrayList;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodu... |
s682348638 | p03713 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define FORr(i, j, k) for(int i = j; i >= k; --i)
#define repr(i, j) FOR(i, j, 0)
#define INF (1 << 30)
#define MOD 1e9 + 7
typedef long long ll;
typedef unsigned long long ull;
typedef p... | a.cc: In function 'int main()':
a.cc:38:13: error: expected primary-expression before 'i'
38 | (ll i = 1; i < W; ++i) {
| ^
a.cc:38:12: error: expected ')' before 'i'
38 | (ll i = 1; i < W; ++i) {
| ~ ^~
| )
a.cc:38:20: error: 'i' was not declared ... |
s591568234 | p03713 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define FORr(i, j, k) for(int i = j; i >= k; --i)
#define repr(i, j) FOR(i, j, 0)
#define INF (1 << 30)
#define MOD 1e9 + 7
typedef long long ll;
typedef unsigned long long ull;
typedef pair... | a.cc: In function 'int main()':
a.cc:38:13: error: expected primary-expression before 'i'
38 | (ll i = 1; i < W; ++i) {
| ^
a.cc:38:12: error: expected ')' before 'i'
38 | (ll i = 1; i < W; ++i) {
| ~ ^~
| )
a.cc:38:20: error: 'i' was not declared ... |
s009858216 | p03713 | C++ | #include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <deque>
#include <cmath>
#define WMAX 100005
#define HMAX 100005
#define INF (long long)1e18
//コメントアウトするとdebu... | /tmp/ccDeATlg.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x4be): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/ccDeATlg.o
a.cc:(.text+0x4d7): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss... |
s137645191 | p03713 | C++ | #include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <deque>
#include <cmath>
#define WMAX 100005
#define HMAX 100005
#define INF (long long)1e18
//コメントアウトするとdebu... | /tmp/cc6qXqGF.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x4be): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/cc6qXqGF.o
a.cc:(.text+0x4d7): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss... |
s470187607 | p03713 | C++ | #include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <deque>
#include <cmath>
#define WMAX 100005
#define HMAX 100005
#define INF (long long)1e18
//コメントアウトするとdebu... | /tmp/cc3Q5ff7.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x4be): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/cc3Q5ff7.o
a.cc:(.text+0x4d7): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss... |
s390126974 | p03713 | C++ | #include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <deque>
#include <cmath>
#define WMAX 100005
#define HMAX 100005
#define INF (long long)1e18
//コメントアウトするとdebu... | /tmp/ccGtG2ve.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x4be): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/ccGtG2ve.o
a.cc:(.text+0x4d7): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss... |
s530541385 | p03713 | C++ | #include <bits/stdc++.h>
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define SORTR(v,n) sort(v, v+n, greater<int>());
#define int long long // %d=>%lld
#define pb push_back
#define INF 1000000000
using namespace std;
typedef long long... | a.cc: In function 'int main()':
a.cc:36:9: error: 'b' was not declared in this scope
36 | b=(h-i)*(w/2);
| ^
a.cc:37:9: error: 'c' was not declared in this scope
37 | c=h*w-a-b;
| ^
a.cc:46:9: error: 'b' was not declared in this scope
46 | b=(h-i)*(w/2);
... |
s679210521 | p03713 | C++ | #include <iostream>
#include <algorithm>
int main(){
int height,width;
int h2,w2;
int h3,w3;
int widthvar;
int S1,S2,S3;
std::cin >> height >> width;
int defmin = 2000000000;
for(int w1 = 1; w1 < width; w1++){//横に2分割 左の面積=S1
S1 = w1*height;
widthvar =width- w1;
//右側を横に分割
w2 = widthvar / 2;
S2 = w2*h... | In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/includ... |
s242277784 | p03713 | C++ | #include <algorithm>
#include <iostream>
using namespace std;
int main(void) {
int H, W, Hc, S1, S2, S3, minC, diff;
cin >> H >> W;
minC = INT_MAX;
if (H > W)
swap(H, W);
if ((H * W) % 3 == 0) {
cout << 0 << endl;
return 0;
}
Hc = H / 2;
for (int i = 1; i < W; i++) {
S1 = Hc * i;
S... | a.cc: In function 'int main()':
a.cc:9:10: error: 'INT_MAX' was not declared in this scope
9 | minC = INT_MAX;
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <iostream>
+++ |+#include <climits>
3 |... |
s303855415 | p03713 | C++ | #include <iostream>
#include <vector>
using namespace std;
int diff(vector<int> a) {
return *max_element(a.begin(), a.end()) - *min_element(a.begin(), a.end());
}
int main() {
int H, W;
vector<vector<int>> div(4, vector<int>(3)); // 4通り考えれば十分
cin >> H >> W;
if (H % 3 == 0 or W % 3 == 0) {
cout << 0 << endl;
... | a.cc: In function 'int diff(std::vector<int>)':
a.cc:6:17: error: 'max_element' was not declared in this scope
6 | return *max_element(a.begin(), a.end()) - *min_element(a.begin(), a.end());
| ^~~~~~~~~~~
a.cc:6:52: error: 'min_element' was not declared in this scope
6 | re... |
s628725312 | p03713 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int cutT(float h, float w){
int p,q,s1,s2,s3;
p = static_cast<int>(h/3+0.5f);
q = static_cast<int>(w/2+0.5f);
s1 = p * w;
s2 = (h-p) * q;
s3 = (h-p) * (w-q);
return (max(max(s1,s2),s3) - min(min(s1,s2),s3));
}
int main(int argc, char const *argv[]... | a.cc: In function 'int main(int, const char**)':
a.cc:34:28: error: expected ';' before 'std'
34 | temp = min(temp, w)
| ^
| ;
35 | std::cout << temp << '\n';
| ~~~
|
s195399638 | p03713 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
long long Diff(long H, long W)
{
long long Smax, Smin, Diff =0;
for (long i = 1; i < W - 2; i++){
for (long j = i + 1; j < W - 1; j++){
Smax = H*max(i, max(j - i, W - j));
Smin = H*min(i, min(j - i, W - j));
if (c==0)Diff = ... | a.cc: In function 'long long int Diff(long int, long int)':
a.cc:14:29: error: 'c' was not declared in this scope
14 | if (c==0)Diff = Smax - Smin;
| ^
a.cc:16:25: error: 'c' was not declared in this scope
16 | c++;
| ... |
s721951328 | p03713 | C++ | using namespace std;
long Diff(int H, int W)
{
long Smax, Smin, Diff =0;
int c = 0;
for (int i = 1; i < W - 2; i++){
for (int j = i + 1; j < W - 1; j++){
Smax = H*max(i, max(j - i, W - j));
Smin = H*min(i, min(j - i, W - j));
if (c==0)Diff = Smax - Smin;
else (Diff ? Diff : Smax - Smin) ;
c++;
... | a.cc: In function 'long int Diff(int, int)':
a.cc:9:41: error: 'max' was not declared in this scope; did you mean 'Smax'?
9 | Smax = H*max(i, max(j - i, W - j));
| ^~~
| Smax
a.cc:9:34: error: 'max' w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.