submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s705999893 | p01193 | Java | while line = gets do
ans = eval(line.chomp.chop)
puts (ans<0||ans>9999) ? "E" : ans
end | Main.java:1: error: class, interface, enum, or record expected
while line = gets do
^
1 error
|
s889240559 | p01193 | Java | while line = gets do
ans = eval(line.chomp.chop)
puts (ans<0||ans>9999) ? "E" : ans
end | Main.java:1: error: class, interface, enum, or record expected
while line = gets do
^
1 error
|
s334151525 | p01193 | Java | while line = gets
ans = eval(line.chomp.chop)
puts (ans<0||ans>9999) ? "E" : ans
end | Main.java:1: error: class, interface, enum, or record expected
while line = gets
^
1 error
|
s378550744 | p01193 | C++ | import java.util.Scanner;
import java.math.BigDecimal;
public class Main{
BigDecimal mx = new BigDecimal(9999);
BigDecimal mn = new BigDecimal(1);
int l;
Main(){
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
String str = sc.next(), s1, s2;
char[] ch = str.toCharArray();
l ... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.math.BigDecimal;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodul... |
s688419096 | p01193 | C++ | string s;
bool f;
int r1, r2;
char r3;
int toInt(string s){return atoi(s.c_str());}
bool check(int a){
if(a < 0 || a > 9999){
f = true;
return true;
}
return false;
}
int main(){
while(getline(cin,s)){
s = s.substr(0,s.size()-1);
r1 = r2 = 0;
r3 = '?';
int pos = 0;
f = f... | a.cc:1:1: error: 'string' does not name a type
1 | string s;
| ^~~~~~
a.cc:6:11: error: 'string' was not declared in this scope
6 | int toInt(string s){return atoi(s.c_str());}
| ^~~~~~
a.cc: In function 'int main()':
a.cc:17:17: error: 'cin' was not declared in this scope
17 | while(... |
s739825901 | p01199 | C++ | #include<iostream>
#include<vector>
#include<cstdio>
#include<algorithm>
#define MAX_V 1000
#define INF 999999
using namespace std;
typedef struct edge{
int to,cap,rev;
}edge;
vector<edge> G[2*MAX_V+2];
int d[MAX_V][MAX_V];
bool used[MAX_V];
int n,m,cost;
void floyed(int n){
for(int i=0;i<n;i++)d[i][i]=0;
for(... | a.cc: In function 'bool makeG()':
a.cc:37:3: error: 'memset' was not declared in this scope
37 | memset(G,0,sizeof(G));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include<algorithm>
+++ |+#include <cstring>
5 | ... |
s636879721 | p01199 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <map>
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
#define debug(x) cout << #x << " is " << x << endl;
using namespace std;
typedef pair<int, int> P;
const int INF = 1 << 29;
struct edge{
int to, cap, rev;
edg... | a.cc: In function 'int ford_fulkerson(int, int)':
a.cc:49:17: error: 'memset' was not declared in this scope
49 | memset(visit, 0, sizeof(visit));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | ... |
s220232764 | p01202 | C | char c[1<<17],n;main(f,i){for(gets(c);gets(c);puts(f?"Yes":"No"))for(f=i=1;c[++i];)c[i]==c[i-1]&&f=0;} | main.c:1:17: error: return type defaults to 'int' [-Wimplicit-int]
1 | char c[1<<17],n;main(f,i){for(gets(c);gets(c);puts(f?"Yes":"No"))for(f=i=1;c[++i];)c[i]==c[i-1]&&f=0;}
| ^~~~
main.c: In function 'main':
main.c:1:17: error: type of 'f' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error... |
s218194837 | p01202 | C++ | #include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
main(){
int n;
cin>>n;
while(n--){
string s;
cin>>s;
int f=0;
r(i,s.size()-1)if(s[i]==s[i+1])f++;
cout<<f?"No":"Yes"<<endl;
}
} | a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:12:35: error: invalid operands of types 'const char [4]' and '<unresolved overloaded function type>' to binary 'operator<<'
12 | cout<<f?"No":"Yes"<<... |
s851076043 | p01205 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
while(cin >> N >> M && (N || M)) {
vector<int> L(N);
rep(i, N) cin >> L[i];
bool ok = 0;
rep(m, 1<<M) {
if(__builtin_popcount(m) != L[0]) continue;
string temp;
int count = L[0];
rep(k, M)
temp.pus... | a.cc: In function 'int main()':
a.cc:9:9: error: 'i' was not declared in this scope
9 | rep(i, N) cin >> L[i];
| ^
a.cc:9:5: error: 'rep' was not declared in this scope
9 | rep(i, N) cin >> L[i];
| ^~~
a.cc:11:9: error: 'm' was not declared in this scope
11 | rep(m, 1<<M) ... |
s517556006 | p01206 | C++ | #include<iostream>
#include<vector>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define ALL(C) (C).begin(),(C).end()
#define pb push_back
const int W = 20,H = 20;
int vol;
bool vis[H][W];
bool liv[H][W];
int h[H][W];
int dx[]={0,0,1,-1};
int dy[]={1,-1,0,0}... | a.cc: In function 'bool solve(int, int, int)':
a.cc:59:7: error: 'sort' was not declared in this scope; did you mean 'short'?
59 | sort(ALL(val));
| ^~~~
| short
a.cc:60:17: error: 'unique' was not declared in this scope
60 | val.erase(unique(ALL(val)),val.end());
| ... |
s473717683 | p01206 | C++ | Black Force | a.cc:1:1: error: 'Black' does not name a type
1 | Black Force
| ^~~~~
|
s700923762 | p01208 | C | #include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <map>
#include <queue>
using namespace std;
typedef pair<int,int> pii;
const int INF=1000000000;
int n,m;
map<string,int> indice;
vector<pii> points;
vector<int> G[1001];
// node,どちらから来たか
int d[1001][4];
int src,dst;
const int dy... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s020981382 | p01208 | C++ | /*
02:08 - 04:05
*/
#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<unordered_map>
#include<queue>
#include<climits>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define IINF (INT_MAX)
#define MAX 2000
#define pow2(a) ((a)*(a))
#define EPS 1e-7
#define equals(a... | a.cc: In function 'int main()':
a.cc:110:5: error: 'assert' was not declared in this scope
110 | assert(getIndex.size() == ps.size());
| ^~~~~~
a.cc:12:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
11 | #include<climits>
+++ |+#include <... |
s826415211 | p01209 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
int main(){
ll n;
string m;
while(cin>>n>>m,n){
ll s=0;
for(int i=0;i<(int)m.size();i++){
if('0'<=m[[i]&&m[i]<='9' )s*=n,s+=m[i]-'0';
if('A'<=m[i]&&m[i]<='Z')s*=n,s+=m[i]-'A'+10;
}
ll ans=0;
for(long doub... | a.cc: In function 'int main()':
a.cc:12:16: error: two consecutive '[' shall only introduce an attribute before '[' token
12 | if('0'<=m[[i]&&m[i]<='9' )s*=n,s+=m[i]-'0';
| ^
a.cc:12:16: error: expected ')' before '[' token
12 | if('0'<=m[[i]&&m[i]<='9' )s*=n,s+=m[i]-'0';
| ... |
s464968642 | p01209 | C++ | #include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
using namespace std;
#define FOR(i,k,n) for(int i=(k); i<(int)n; +... | a.cc: In function 'int main()':
a.cc:53:26: error: 'LLONG_MAX' was not declared in this scope
53 | ll ans = LLONG_MAX;
| ^~~~~~~~~
a.cc:15:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
14 | #include <ca... |
s851198782 | p01210 | C++ | #include<iostream>
#include<stack>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
typedef long long ll;
const ll inf =(1LL)<<50;
enum{IDLE=-1,PUTR=0,PUTL=1,DRAW=2,BACK=3};
bool isend(int *a){
... | a.cc: In function 'bool solve(std::stack<int>*)':
a.cc:105:22: warning: ignoring return value of 'std::stack<_Tp, _Sequence>::reference std::stack<_Tp, _Sequence>::top() [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; reference = int&]', declared with attribute 'nodiscard' [-Wunused-result]
105 | ... |
s271801731 | p01212 | C++ | #include<queue>
#include<cstdio>
#include<cstring>
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
const int INF=1<<29;
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
struct Node{
int x,y,mask;
Node(int X,int Y,int MA):x(X),y(Y),mask(MA){}
bool operator<(const Node &i)const{ retu... | a.cc: In function 'int main()':
a.cc:29:28: error: 'islower' was not declared in this scope
29 | if(islower(grid[i][j]) && key[grid[i][j]]==-1){
| ^~~~~~~
a.cc:31:37: error: 'toupper' was not declared in this scope
31 | key[t... |
s247785763 | p01213 | Java | mport java.util.Scanner;
public class Main {
Scanner sc = new Scanner(System.in);
void run() {
for (;;) {
String in = sc.next();
if (in.equals("#END")) {
return;
}
String ans = "";
for (int i = 1; i < in.length(); i++) {
String lcs = lcs(in.substring(0, i), in.substring(i, in.length()));
... | Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
|
s461971723 | p01213 | Java | import java.util.Scanner;
public Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
String str = "";
while(true){
str = scan.next();
if(str.equals("#END")){
break;
}else{
System.out.println(rs(str));
}
}
}
public static String rs(St... | Main.java:3: error: class, interface, enum, or record expected
public Main{
^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args){
^
(use --enable-preview to enable unnamed classes)
Main.java:42: error: <identifier>... |
s824479397 | p01213 | Java | import java.util.Scanner;
public Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
String str = "";
while(true){
str = scan.next();
if(str.equals("#END")){
break;
}else{
System.out.println(rs(str));
}
}
}
public static String rs(St... | Main.java:3: error: class, interface, enum, or record expected
public Main{
^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args){
^
(use --enable-preview to enable unnamed classes)
Main.java:59: error: class, inter... |
s027287566 | p01213 | Java | import java.util.Scanner;
public class copy{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
String str = "";
while(true){
str = scan.next();
if(str.equals("#END")){
break;
}else{
System.out.println(rs(str));
}
}
}
public static String... | Main.java:3: error: class copy is public, should be declared in a file named copy.java
public class copy{
^
1 error
|
s190724374 | p01213 | Java | import java.util.Scanner;
public class copy{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
String str = "";
while(true){
str = scan.next();
if(str.equals("#END")){
break;
}else{
System.out.println(rs(str));
}
}
}
public static String... | Main.java:3: error: class copy is public, should be declared in a file named copy.java
public class copy{
^
1 error
|
s707439858 | p01213 | Java | import java.util.Scanner;
public class RepeatedSubsequences{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
String str = "";
while(true){
str = scan.next();
if(str.equals("#END")){
return;
}else{
str = rs(str);
System.out.println(str);
}
}
}
... | Main.java:2: error: class RepeatedSubsequences is public, should be declared in a file named RepeatedSubsequences.java
public class RepeatedSubsequences{
^
1 error
|
s826783464 | p01213 | Java | import java.util.Scanner;
public class RepeatedSubsequences{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
String str = "";
while(true){
str = scan.next();
if(str.equals("#END")){
return;
}else{
str = rs(str);
System.out.println(str);
}
}
}
... | Main.java:2: error: class RepeatedSubsequences is public, should be declared in a file named RepeatedSubsequences.java
public class RepeatedSubsequences{
^
1 error
|
s272113602 | p01213 | Java | import java.util.Scanner;
public class RepeatedSubsequences{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
String str = "";
while(true){
str = scan.next();
if(str.equals("#END")){
return;
}else{
System.out.println(rs(str));
}
}
}
public stat... | Main.java:2: error: class RepeatedSubsequences is public, should be declared in a file named RepeatedSubsequences.java
public class RepeatedSubsequences{
^
1 error
|
s454694941 | p01213 | Java | import java.util.Scanner;
//Repeated Subsequences
public class Main {
String lcs(String a, String b){
int na = a.length(), nb = b.length();
int dp[][] = new int[na+1][nb+1];
for(int i=1;i<=na;i++)for(int j=1;j<=nb;j++){
if(a.charAt(i-1)==b.charAt(j-1))dp[i][j] = dp[i-1][j-1] + 1;
else dp[i][j] = Math.max... | Main.java:41: error: cannot find symbol
new Main.run();
^
symbol: class run
location: class Main
1 error
|
s643038912 | p01213 | C++ | import java.util.Arrays;
import java.util.Scanner;
public class Main {
MyScanner sc = new MyScanner();
Scanner sc2 = new Scanner(System.in);
final int MOD = 1000000007;
int[] dx = { 1, -1, 1, -1 };
int[] dy = { 1, 1, -1, -1 };
void run() {
for (;;) {
String in = sc.next();
if (in.equals("#END")) {
r... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Arrays;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.Scanner;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-t... |
s951530812 | p01213 | C++ | #include <string>
#include <vector>
#include <iostream>
using namespace std;
string dp[301];
inline string LCS(string S, string T)
{
for (int i = 0; i <= 300; i++)
{
dp[0][i] = "";
dp[i][0] = "";
}
for (int i = 1; i <= T.size(); i++)
{
for (int j = 1; j <= S.size(); j++)
{
if (S[j - 1] == T[i - 1])
... | a.cc: In function 'std::string LCS(std::string, std::string)':
a.cc:13:28: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
13 | dp[0][i] = "";
| ^~
| ... |
s621747996 | p01213 | C++ | #include <string>
#include <cstring>
#include <iostream>
using namespace std;
string dp[301][301];
inline string LCS(const char S[], const char T[])
{
for (int i = 0; i <= 300; i++)
{
dp[0][i] = "";
dp[i][0] = "";
}
int SS = strlen(S);
int TS = strlen(T);
for (int i = 1; i <= TS; i++)
{
for (int j = 1... | a.cc: In function 'int main()':
a.cc:56:23: error: 'TMP' was not declared in this scope
56 | STR = TMP;
| ^~~
|
s528817754 | p01213 | C++ | #include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <time.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#define FOR(i, a) for(i = 0; i < (a); i++)
#define FORM(i, a) for(i = (a) i >= 0; i--)
using namespace std;
int dp[301][301];
string ans[301][301];
char final[300];
int... | a.cc: In function 'int main()':
a.cc:24:9: error: 'memset' was not declared in this scope
24 | memset((char*)final, 0, 301);
| ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
7 | #include <algorithm>
+++ |+#include ... |
s427836528 | p01213 | C++ | def lcs(x, y):
rec = []
idx = []
for c in y:
s = 0
for i, k in enumerate(idx):
t = x.find(c, s) + 1
if t < 1:
break
if t < k:
idx[i] = t
s = k
else:
t = x.find(c, s) + 1
if t:
... | a.cc:20:15: error: empty character constant
20 | lcs = ''
| ^~
a.cc:31:16: error: empty character constant
31 | return ''
| ^~
a.cc:39:17: warning: multi-character character constant [-Wmultichar]
39 | if s == '#END':
| ^~~~... |
s343448148 | p01213 | C++ | #include<string>
#include<iostream>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
string LCS(const string &s,const string &t){
const int LMAX=___;
int m=s.length(),n=t.length();
static int dp[LMAX+1][LMAX+1],from[LMAX+1][LMAX+1];
rep(i,m+1) dp[i][0]=0, from[i][0]=-1;
rep(j,n+1) dp[0][j]=0, from[... | a.cc: In function 'std::string LCS(const std::string&, const std::string&)':
a.cc:9:24: error: '___' was not declared in this scope
9 | const int LMAX=___;
| ^~~
a.cc:11:35: error: size of array 'dp' is not an integral constant-expression
11 | static int dp[LMAX+1][LM... |
s891534287 | p01213 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <memory.h>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <map>
#include <cmath>
using namespace std;
#define rep(i, n) for(int i = 0; i< n; i++)
typedef long long ll;
typedef pair<int, int> P;
int dp[310][310];
P pa... | a.cc: In function 'int main()':
a.cc:28:13: error: no matching function for call to 'max(bool)'
28 | if(max(a.size() < b.size()) <= res.size()) continue;
| ~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.... |
s575820611 | p01214 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int N;
int blH,blW;
int bdH,bdW;
int block[4][101][101];
int field[101][101];
int lineEmpNum[101];
void RotateBlock(){
for(int k=0;k<3;k++){
int newBlock[101][101];
memset(newBlock,0,sizeof(newBlock));
for(int... | a.cc: In function 'void RotateBlock()':
a.cc:17:9: error: 'memset' was not declared in this scope
17 | memset(newBlock,0,sizeof(newBlock));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <vector>
+++... |
s821403482 | p01215 | C++ | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class Main{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int n;
double g;
double x, y;
double[] xs... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.lang.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1... |
s982353728 | p01217 | C++ | include <iostream>
using namespace std;
bool ruijo[1000001];
int main(){
for(int i=1;i*i<=1000000;i++)ruijo[i*i]=true;
int n;
while(cin>>n&&n){
int res=0;
int cnt=0;
int lim=0;
int idx=3;
int sum=3;
for(int i=1;i<=n;i++){
if(lim==cnt+1)res=30;
else if(lim==cnt+2)res=30;
... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:10:9: error: 'cin' was not declared in this scope
10 | while(cin>>n&&n){
| ^~~
a.cc:31:5: error: 'cout' was not declared in this scope
31 | cout<<res<<endl;
| ... |
s994418405 | p01218 | C++ | #include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <cassert>
#include <queue>
#include <functional>
#include <map>
using namespace std;
const int MAX_V = 100010;
using Capacity = int;
using Cost = double;
const auto inf = numeri... | a.cc: In function 'int main()':
a.cc:167:9: error: 'a' was not declared in this scope
167 | a
| ^
|
s399350936 | p01218 | C++ | #include<cmath>
#include<iostream>
#include<map>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define ALL(C) (C).begin(),(C).end()
const int N = 100;
typedef long long ll;
class Point{
public:
double x,y,z;
bool operator<(const Point & a)const{
return z > a.z... | a.cc: In function 'double solve(int, int, Point*, int*, int, std::map<long long int, double>&)':
a.cc:55:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
55 | sort(in,in+4);
| ^~~~
| sqrt
a.cc: At global scope:
a.cc:74:1: warning: ISO C++ forbids declaration of 'main' with no t... |
s922378462 | p01219 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
namespace flow_algorithm
{
template<class Flow>
struct edge
{
int to;
Flow cap, rev;
};
/*
template<class Flow>
using edges = vector<edge<Flow>>;
template<class Flow>
us... | a.cc:24:23: error: 'll' was not declared in this scope
24 | typedef vector<edge<ll>> edges;
| ^~
a.cc:24:23: error: template argument 1 is invalid
a.cc:24:25: error: template argument 1 is invalid
24 | typedef vector<edge<ll>> edges;
| ^~
a.cc:24:25: e... |
s746365920 | p01219 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.be... | a.cc: In function 'void add_edge(ll, ll, ll)':
a.cc:30:17: warning: narrowing conversion of 'to' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
30 | edge q={to,cap,ll(G[to].size())};
| ^~
a.cc:30:20: warning: narrowing conversion of 'cap' from 'll' {aka 'long long int'} to 'int'... |
s720154473 | p01219 | C++ | #include <string>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;
#define INF 100000000000
#define SOUR (M+7)
#define SINK (M+7+1)
class Node
{
public:
vector<int> to;
};
int main()
{
int M;
long long N;
while(cin >> M >> N, (M||N))
{
Node n[150];
long long flow[150][150]={0},... | a.cc: In function 'int main()':
a.cc:22:15: error: 'cin' was not declared in this scope
22 | while(cin >> M >> N, (M||N))
| ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
4 | #include <algorithm>
+++ |+#incl... |
s714204941 | p01223 | Java | public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-- > 0){
int n=sc.nextInt()-1;
int h=sc.nextInt();
int mc = 0;
int mf = 0;
while(n-->0){
int nh = sc.nextInt();
if(nh-h>mc)mc=nh-h;
if(h-nh>mf)mf=h-nh;
h=n... | Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s076428375 | p01223 | C | #include <cstdio>
#include <iostream>
using namespace std;
int main(void)
{
int t, n;
int array[128];
cin >> t;
for (int c = 0; c < t; c++){
cin >> n;
int up_max = 0, dn_max = 0;
for (int i = 0; i < n; i++){
cin >> array[i];
if (i > 0){
if (up_max < array[i] - array[i-1]){
up_max = a... | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s799624348 | p01223 | C | #include <stdio.h>
int main(){
int t,n,i,a[100],t,Max,Min;
scanf("%d",&t);
while(t--){
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
for(i=0;i<n-1;i++){
a[i] = a[i+1]-a[i];
}
for(i=n-3;i >= 0;i--){
if(a[i] < a[i+1]) t=a[i];a[i] = a[i+1];a[i+1] = t;
}
... | main.c: In function 'main':
main.c:4:20: error: redeclaration of 't' with no linkage
4 | int t,n,i,a[100],t,Max,Min;
| ^
main.c:4:7: note: previous declaration of 't' with type 'int'
4 | int t,n,i,a[100],t,Max,Min;
| ^
|
s667764617 | p01223 | C | #include <stdio.h>
int main(){
int t,n,i,a[100],t,Max,Min;
scanf("%d",&t);
while(t--){
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
for(i=0;i<n-1;i++){
a[i] = a[i+1]-a[i];
}
for(i=n-3;i >= 0;i--){
if(a[i] < a[i+1]) {t=a[i];a[i] = a[i+1];a[i+1] = t;}
}
... | main.c: In function 'main':
main.c:4:20: error: redeclaration of 't' with no linkage
4 | int t,n,i,a[100],t,Max,Min;
| ^
main.c:4:7: note: previous declaration of 't' with type 'int'
4 | int t,n,i,a[100],t,Max,Min;
| ^
|
s514016420 | p01223 | C | #include<stdio.h>
int main(){
int n,m,a[200],up,down,i;
scanf("%d",&n);
while(n-->0){
up=0;
down=0;
scanf("%d",&m);
for(i=0;i<m-1;i++)
scanf("%d ",&a[i]);
scanf("%d",&a[m-1]);
for(i=0;i<m-1;i++){
if(a[i]<a[i+1]){
if(a[i+1]-a[i]>up)
up=a[i+1]-a[i];
}
else if(a[i]>a[i+1]){
if(a[i]-a[i+1]>down)
down=a[i]-a[i+1];
}
printf(... | main.c: In function 'main':
main.c:24:1: error: expected declaration or statement at end of input
24 | }
| ^
|
s872771339 | p01223 | C | a,z,x,i,j;main(t){for(scanf("%d",&t);t--;)for(a=z=0;scanf("%d%d",&x,&i);--x;printf("%d %d\n",-z,a))scanf("%d",&j),i-=j,a=i>a?i:a,z=i<z?i:z,i=j;exit(0);} | main.c:1:1: warning: data definition has no type or storage class
1 | a,z,x,i,j;main(t){for(scanf("%d",&t);t--;)for(a=z=0;scanf("%d%d",&x,&i);--x;printf("%d %d\n",-z,a))scanf("%d",&j),i-=j,a=i>a?i:a,z=i<z?i:z,i=j;exit(0);}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
ma... |
s323384723 | p01223 | C | #include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
int main(void){
int length;
int max=0, min=0;
int dif = 0;
int step;
char steps[256];
char index[1001];
int now;
int next = 0;
int i, n, m;
scanf("%d", &length);
for(i=0; i<length; i++){
scanf("%d", &step);
scanf("%s", steps)... | main.c: In function 'main':
main.c:25:51: error: expected ';' before '}' token
25 | next = atoi(index)
| ^
| ;
26 | }else{
| ... |
s911919208 | p01223 | C++ | #inclucd<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++){
int m;
cin>>m;
int obs[m+1];
obs[0]=0;
int prev,min,max;
max=0;
min=10000;
for(int j=1;j<=m;j++){
prev=obs[j-1];
cin>>obs[j];
if(max<abs(obs[j]-prev) && obs[j]>prev)max=... | a.cc:1:2: error: invalid preprocessing directive #inclucd; did you mean #include?
1 | #inclucd<bits/stdc++.h>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin>>n;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iost... |
s439263657 | p01223 | C++ | #include <stdio.h>
int main(){
int i,j,n,m,sai;
int a[100],up[100],down[100],dan[100];
int h=0,k=0,s=0,maxup,maxdown;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&m);
for(j=0;j<m;j++){
scanf("%d",&a[j]);
}
for(j=0;j<m-1;j++){
sai = a[j+1] - a[j];
if(sai>0){
up[k] = sai;
k++;
}e... | a.cc: In function 'int main()':
a.cc:51:40: error: 'abs' was not declared in this scope
51 | printf("%d %d\n",maxup,abs(maxdown));
| ^~~
|
s781379112 | p01223 | C++ | #include <stdio.h>
int main(){
int i,j,n,m,sai;
int a[100],up[100],down[100],dan[100];
int h=0,k=0,s=0,maxup,maxdown;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&m);
for(j=0;j<m;j++){
scanf("%d",&a[j]);
}
for(j=0;j<m-1;j++){
sai = a[j+1] - a[j];
if(sai>0){
up[k] = sai;
k++;
}e... | a.cc: In function 'int main()':
a.cc:51:40: error: 'abs' was not declared in this scope
51 | printf("%d %d\n",maxup,abs(maxdown));
| ^~~
|
s062940845 | p01223 | C++ | #include <stdio.h>
int main(){
int i,j,n,m,sai;
int a[1000],up[1000],down[1000],dan[1000];
int h=0,k=0,s=0,maxup,maxdown;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&m);
for(j=0;j<m;j++){
scanf("%d",&a[j]);
}
for(j=0;j<m-1;j++){
sai = a[j+1] - a[j];
if(sai>0){
up[k] = sai;
k++;
... | a.cc: In function 'int main()':
a.cc:51:40: error: 'abs' was not declared in this scope
51 | printf("%d %d\n",maxup,abs(maxdown));
| ^~~
|
s481243329 | p01223 | C++ | #include <stdio.h>
int main(){
int i,j,n,m,sai;
int a[1000],up[1000],down[1000],dan[1000];
int h=0,k=0,s=0,maxup,maxdown;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&m);
for(j=0;j<m;j++){
scanf("%d",&a[j]);
}
for(j=0;j<m-1;j++){
sai = a[j+1] - a[j];
if(sai>0){
up[k] = sai;
k++;
... | a.cc: In function 'int main()':
a.cc:51:40: error: 'abs' was not declared in this scope
51 | printf("%d %d\n",maxup,abs(maxdown));
| ^~~
|
s849870616 | p01223 | C++ | #include <stdio.h>
int main(){
int i,j,n,m,sai;
int a[1000],up[1000],down[1000],dan[1000];
int h=0,k=0,s=0,y=0,maxup,maxdown;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&m);
for(j=0;j<m;j++){
scanf("%d",&a[j]);
}
for(j=0;j<m-1;j++){
sai = a[j+1] - a[j];
if(sai>0){
up[k] = sai;
k+... | a.cc: In function 'int main()':
a.cc:55:40: error: 'abs' was not declared in this scope
55 | printf("%d %d\n",maxup,abs(maxdown));
| ^~~
|
s611477097 | p01223 | C++ | #include<stdio.h>
#include<iostream>
#include<fstream>
#include<stack>
#include<math.h>
using namespace std;
int main()
int n;
int c=0;
cin >> n;
for (int i = 0; i < n; i++){
int bn;
int b[101];
int max = 0, min = 1000;
cin >> bn;
for (int j = 0; j < n; j++)cin >> b[j];
for (int j = 0; j < n; j++){... | a.cc:13:9: error: expected initializer before 'int'
13 | int n;
| ^~~
a.cc:15:9: error: 'cin' does not name a type
15 | cin >> n;
| ^~~
a.cc:16:9: error: expected unqualified-id before 'for'
16 | for (int i = 0; i < n; i++){
| ^~~
a.cc:16:25: er... |
s016826146 | p01223 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n ,t, tt;
cin>>tt;
for(int j = 0; j < tt; j++){
int cu = 0, cd = 0, m = 0,
cin>>n;
for(int i = 0; i < n; i++){
cin>>t;
if(t - m > cu) cu = t - m;
if(m - t > cd) cd = m - t;
m = t;
}
cout<<cu<<" "<<cd<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:20: error: expected initializer before '>>' token
9 | cin>>n;
| ^~
|
s088864648 | p01223 | C++ | for(int i=0;i<n;i++){
cin >> m;
for(int j=0;j<m;j++) cin >> a[j];
// for(int j=1;j<m;j++) b[j-1] = a[j] - a[j-1];
mx = 0;
mn = 0;
for(int j=0;j+1<m;j++)
if(a[j] < a[j+1] )
mx = max(mx,a[j+1]-a[j]);
for(int j=0;j+1<m;j++)
if(a[j] > a[j+1])
mn = max(mn,a[j]-a[... | a.cc:1:1: error: expected unqualified-id before 'for'
1 | for(int i=0;i<n;i++){
| ^~~
a.cc:1:13: error: 'i' does not name a type
1 | for(int i=0;i<n;i++){
| ^
a.cc:1:17: error: 'i' does not name a type
1 | for(int i=0;i<n;i++){
| ^
a.cc:35:3: error: expected dec... |
s587571902 | p01223 | C++ | #include<cstdio>
#include<calgorithm>
int main(){
int a,b,c,umax,dmax;
while(1){
umax=0;
dmax=0;
scanf("%d",a);
if(a==0) return 0;
scanf("%d",b);
for(int i=1;i<a;i++){
scanf("%d",c);
if(b<c) umax=max(umax,c-b);
else dmax=max(dmax,b-c);
b=c;
}
printf("%d %d\n",umax,dmax);
}
} | a.cc:2:9: fatal error: calgorithm: No such file or directory
2 | #include<calgorithm>
| ^~~~~~~~~~~~
compilation terminated.
|
s957065039 | p01223 | C++ | /*Kim Jong Il. Do you like him?*/
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<stdlib.h>
#include<limits.h>
using namespace std;
int main(){
int n,n2,hn[1000][1000],sn[1000],xmax=0,xmin=0,ma[1000],mi[1000];
cin >> n;
for(int i=0;i<n;i++){
cin >> n2;
for(int j=0;j<n2;j++){
cin ... | a.cc:45:5: error: redefinition of 'int main()'
45 | int main(){
| ^~~~
a.cc:10:5: note: 'int main()' previously defined here
10 | int main(){
| ^~~~
|
s420298336 | p01223 | C++ | /*
* 2100.cpp
*
* Created on: 2012/07/08
* Author: shimomire
*/
#include <iostream>
#include<string>
#include <complex>
#include<list>
#include<float.h>
#include <functional>
#include <vector>
#include <map>
#include <queue>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define REP0(i,n) R... | a.cc: In function 'int main()':
a.cc:47:17: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
47 | sort(sub,sub+n);
| ^~~~
| sqrt
|
s803132817 | p01223 | C++ | #include <vector>
#include <iostream>
using namespace std;
int main(){
int t;
cin >> t;
for (int i = 0; i < t; i++){
int n;
cin >> n;
vector<int> height;
int h;
for (int j = 0; j < n; j++){
cin >> h;
height.push_back(h);
}
vector<int> diff;
for (int j = 0; j < n-1; j++){
diff.push_b... | a.cc: In function 'int main()':
a.cc:22:9: error: 'sort' was not declared in this scope; did you mean 'short'?
22 | sort(diff.begin(), diff.end());
| ^~~~
| short
|
s900932709 | p01223 | C++ | import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
try {
System.setIn(new FileInputStream("src/aoj2100/input.txt"));
// System.setOut(new PrintStream(new FileOutputStream("src/aoj1172/result.txt")... | a.cc:1:1: error: 'import' does not name a type
1 | import static java.lang.Math.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import static java.util.Arrays.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available wi... |
s303969497 | p01223 | C++ | #include <iostream>
using namespace std;
int main(){
int block[100];
int cnt,n;
int high,low;
cin >> cnt;
while(cnt--){
high = 0;
low = 0;
memset(block,0,sizeof(block));
cin >> n;
for(int i=0;i<n;i++) cin >> block[i];
for(int i=0;i<n-1;i++){
... | a.cc: In function 'int main()':
a.cc:12:9: error: 'memset' was not declared in this scope
12 | memset(block,0,sizeof(block));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include ... |
s479274238 | p01224 | Java | long divisors(long n) {
long sum = 0;
for (long d = 2; d * d <= n; d++) {
if (n % d == 0) {
sum += d;
if (d * d != n) sum += n / d;
}
}
return sum + 1;
}
Scanner sc;
void run() {
sc = new Scanner(System.in);
while(true) {
int N = sc.nextInt();
if (N == 0) break;
if (N == 1) {
... | Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
long divisors(long n) {
^
(use --enable-preview to enable unnamed classes)
Main.java:38: error: class, interface, enum, or record expected
}
^
2 errors
|
s856765902 | p01224 | Java | import java.util.Scanner;
public class Main2 {
/**
* @param args
*/
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
while(true){
int n=cin.nextInt();
if(n==0)break;
int cnt=0;
for(int i=1;i*i<n;i++){
if(n%i==0){
cnt+=i;
if(n/i!=i&&n/i!=n)
cnt+=n... | Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
^
1 error
|
s013515385 | p01224 | Java | srtbybns | Main.java:1: error: reached end of file while parsing
srtbybns
^
1 error
|
s119253231 | p01224 | C | #include <cstdio>
using namespace std;
int main(){
int n;
while(scanf("%d", &n), n){
int r = 2 * n;
for(int i = 1; r >= 0 && i * i <= n; ++i){
if(n % i == 0){
r -= i;
if(i * i != n){ r -= n / i; }
}
}
if(r == 0){... | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s917655222 | p01224 | C | #include<stdio.h>
int main(void){
int N;
int S=0;
int i;
while(1){
S=0;
scanf("%d",&N);
if(N==0)
break;
for(i=1;i<N;i++){
if(N%i==0)
S+=i;
if(N==S)
printf("perfect number\n");
else if(N>S)
printf("deficient number\n");
else
printf("abundant number\n");... | main.c: In function 'main':
main.c:22:1: error: expected declaration or statement at end of input
22 | }
| ^
|
s840286376 | p01224 | C | sec 584 KB 26 lines 330 bytes 2015-06-10 04:07
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <stdio.h>
int main(void)
{
int n;
int i,j,num;
while(scanf("%d",&n)&&n!=0){
num=0;
for(i=1;i*i<n;i++){
if(n%i==0) num=num+i+n/... | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant
1 | sec 584 KB 26 lines 330 bytes 2015-06-10 04:07
| ^~~
In file included from /usr/include/stdio.h:47,
from main.c:34:
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_function... |
s497687825 | p01224 | C | #include <iostream>
using namespace std;
int main(void){
int n,s=0;
cin>>n;
for(int i=1;i<=n;i++){
if(n%i==0){s+=i;}
}
if(n==s){cout<<"perfect number";}
else if(n>s){cout<<"deficient number";}
else {cout<<"abundant number";}
return 0;
}
| main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s449184359 | p01224 | C | main(n,r,i){for(;scanf("%d",&n),r=-n,n;printf("%s",n>r?"deficien":n<r?"abundan":"perfec"),puts("t number"))for(i=1;i*i<=n;i++)n%i?0:r+=i+n/i,(i-n/i)?0:r-=i;} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(n,r,i){for(;scanf("%d",&n),r=-n,n;printf("%s",n>r?"deficien":n<r?"abundan":"perfec"),puts("t number"))for(i=1;i*i<=n;i++)n%i?0:r+=i+n/i,(i-n/i)?0:r-=i;}
| ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'n' defaults to 'int... |
s662951170 | p01224 | C++ | #include<bits/stdc++.h>
using namespacd std;
ibt main(){
int n;
while(cin >> n, n){
int ans = 1;
for(int i = 0;i*i < n; i++){
if(n%i == 0){
ans += i;
if(n/i != i)ans += n/i;
}
}
if(n != 1 && ans < n){
cout << "deficient number" << endl;
}else if(ans > n){
cout << "abun... | a.cc:2:7: error: expected nested-name-specifier before 'namespacd'
2 | using namespacd std;
| ^~~~~~~~~
a.cc:4:1: error: 'ibt' does not name a type; did you mean 'int'?
4 | ibt main(){
| ^~~
| int
|
s991735996 | p01224 | C++ | #include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;
int main(){
int n;
while(cin >> n,n){
int sum = 0;
rang... | a.cc: In function 'int main()':
a.cc:16:46: error: 's' was not declared in this scope
16 | if(n / i != i && n / i != n) s+=n/i;
| ^
|
s108471209 | p01224 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
while(cin>>n&&n!=0){
long long sum=0;
for(int i=1;i<n;){
if(n%i==0) sum+=i;
if(n%2==1&&i%2==1) i+=2;
else i++;
}
if(n==sum)cout<<"perfect number"<<endl;
else if(sum<n)cout<<"
}
} | a.cc:13:37: warning: missing terminating " character
13 | else if(sum<n)cout<<"
| ^
a.cc:13:37: error: missing terminating " character
a.cc: In function 'int main()':
a.cc:14:9: error: expected primary-expression before '}' token
14 | }
| ... |
s337885061 | p01224 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
bool b[100001];
int main() {
fill(b, b + 100001, true);
vector<long long>c;
b[0] = false;
b[1] = false;
for (int i = 2; i <= 100000; i++) {
if (b[i]) {
int j = 2;
while (i*j <= 100000) {
b[i*j] = false;
j+... | a.cc: In function 'int main()':
a.cc:31:49: error: 'pow' was not declared in this scope
31 | sum2 += pow((*it), i);
| ^~~
|
s554525416 | p01224 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main() {
long long a = 6;
while (cin >> a&&a != 0) {
long long sum = 1,a2=a;
int i = 2;
while (a != 1) {
if (a%i == 0) {
int j = 1;
long long sum2 = 1;
while (a%i == 0) {
sum2 += (pow(i, j));
... | a.cc: In function 'int main()':
a.cc:16:50: error: 'pow' was not declared in this scope
16 | sum2 += (pow(i, j));
| ^~~
|
s754674041 | p01224 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main() {
long long a = 6;
while (cin >> a&&a != 0) {
long long sum = 1,a2=a;
int i = 2;
while (a != 1) {
if (a%i == 0) {
int j = 1;
long long sum2 = 1;
while (a%i == 0) {
sum2 += (pow(i, j));
... | a.cc: In function 'int main()':
a.cc:16:50: error: 'pow' was not declared in this scope
16 | sum2 += (pow(i, j));
| ^~~
|
s517696491 | p01224 | C++ | #include<cstdio>
int yaksu(int a){
int res=a;
for(int i=1;i<=a/2;i++){
if(a%i==0) res-=i;
if(res<0) break;
}
return res;
}
int main(){
int a,tc;
while(1){
scanf("%d",&a);
if(a==0) return 0;
tc=yaksu(a)
if(t... | a.cc: In function 'int main()':
a.cc:17:20: error: expected ';' before 'if'
17 | tc=yaksu(a)
| ^
| ;
18 | if(tc>0) printf("deficient number\n");
| ~~
a.cc:19:9: error: 'else' without a previous 'if'
19 | else if(t... |
s766324046 | p01224 | C++ | #include <iostream>
using namespace std;
int main()
{
int n, s, i;
while (cin >> n && n)
{
if (n % 2) t = 2; else t = 1;
for (i = 1+t, s = 1+t+n; i <= (int)((double)((n + 1) / 2)); i+=t)
{
if (n % i == 0)
{
if (i > 1)
{
if (i * i == n)
{
s += i;
if (n > s)
{
cou... | a.cc: In function 'int main()':
a.cc:8:28: error: 't' was not declared in this scope
8 | if (n % 2) t = 2; else t = 1;
| ^
a.cc:8:40: error: 't' was not declared in this scope
8 | if (n % 2) t = 2; else t = 1;
| ... |
s289811954 | p01224 | C++ | main(){int n,s,i;for(;;){scanf("%d",&n);if(!n)break;for(i=1;i*i<=n;i++){if(n!=i){if(n%i==0){s+=i;if(i!=n/i){s+=n/i;}}}}if(s<2*n){printf("deficient number\n");}else if(s==2*n){printf("perfect number\n");}else{printf("abundant number\n");}s=0;}return 0;} | a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main(){int n,s,i;for(;;){scanf("%d",&n);if(!n)break;for(i=1;i*i<=n;i++){if(n!=i){if(n%i==0){s+=i;if(i!=n/i){s+=n/i;}}}}if(s<2*n){printf("deficient number\n");}else if(s==2*n){printf("perfect number\n");}else{printf("abundant n... |
s242912165 | p01224 | C++ | #include <stdio.h> int main(){int n,s,i;for(;;){scanf("%d",&n);if(!n)break;for(i=1;i*i<=n;i++){if(n!=i){if(n%i==0){s+=i;if(i!=n/i){s+=n/i;}}}}if(s<2*n){printf("deficient number\n");}else if(s==2*n){printf("perfect number\n");}else{printf("abundant number\n");}s=0;}return 0;} | a.cc:1:20: warning: extra tokens at end of #include directive
1 | #include <stdio.h> int main(){int n,s,i;for(;;){scanf("%d",&n);if(!n)break;for(i=1;i*i<=n;i++){if(n!=i){if(n%i==0){s+=i;if(i!=n/i){s+=n/i;}}}}if(s<2*n){printf("deficient number\n");}else if(s==2*n){printf("perfect number\n");}else{printf("abundant nu... |
s919035134 | p01224 | C++ | #include<stdio.h>main(){
int n,s,i;for(;;){scanf("%d",&n);if(!n)break;for(i=1;i*i<=n;i++){if(n!=i){if(n%i==0){s+=i;if(i!=n/i){s+=n/i;}}}}if(s<2*n){printf("deficient number\n");}else if(s==2*n){printf("perfect number\n");}else{printf("abundant number\n");}s=0;}
return 0;} | a.cc:1:22: warning: extra tokens at end of #include directive
1 | #include<stdio.h>main(){
| ^
a.cc:1:9: fatal error: stdio.h>mai: No such file or directory
1 | #include<stdio.h>main(){
| ^~~~~~~~~~~~~
compilation terminated.
|
s099983949 | p01224 | C++ | #include<math.h>
c,n;main(i){for(;scanf("%d",&n),n;printf("%s number\n",n>c?"deficient":n<c?"abundant":"perfect"),c=0)if(n>2)for(c=1,i=2;i<=sqrt(n);i++)if(n%i==0){c+=i;if(i!=n/i)c+=n/i;}} | a.cc:2:1: error: 'c' does not name a type
2 | c,n;main(i){for(;scanf("%d",&n),n;printf("%s number\n",n>c?"deficient":n<c?"abundant":"perfect"),c=0)if(n>2)for(c=1,i=2;i<=sqrt(n);i++)if(n%i==0){c+=i;if(i!=n/i)c+=n/i;}}
| ^
a.cc:2:9: error: expected constructor, destructor, or type conversion before '(' token
... |
s066265951 | p01224 | C++ | #include <iostream>
using namespace std;
int main(){
while(cin>>N,N==0){
long long sum=0;
for(int i=1;i<=N;i++){
if(N%i==0)sum+=i;
}
if(N>sum)
cout<<"deficient number"<<endl;
else if(N>sum)
cout<<"abundant number"<<endl;
else
cout<<"perfect number"<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:4:20: error: 'N' was not declared in this scope
4 | while(cin>>N,N==0){
| ^
|
s693576145 | p01225 | Java | import java.util.*;
import java.lang.*;
/**
* Rummy
*/
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
loop: for (int i = 0; i < n; i++) {
int numList[] = new int[9];
List<Inte... | Main.java:174: error: class, interface, enum, or record expected
}}
^
1 error
|
s591325246 | p01225 | Java | import java.util.*;
import java.lang.*;
/**
* Rummy
*/
public class Rummy {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
loop: for (int i = 0; i < n; i++) {
int numList[] = new int[9];
List<Int... | Main.java:7: error: class Rummy is public, should be declared in a file named Rummy.java
public class Rummy {
^
1 error
|
s670806181 | p01225 | Java | import java.util.*;
import java.lang.*;
/**
* Rummy
*/
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
loop: for (int i = 0; i < n; i++) {
int numList[] = new int[9];
List<Inte... | Main.java:107: error: orphaned case
case 0:
^
Main.java:171: error: illegal start of type
return (finalflg1 && finalflg2 && finalflg0);
^
Main.java:171: error: <identifier> expected
return (finalflg1 && finalflg2 && finalflg0);
^
Main.java... |
s814341310 | p01225 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
public class main {
public static void main(String[] args) throws NumberFormatException, IOException {
String str;
BufferedReader br = new BufferedReader(new Inpu... | Main.java:8: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s453603725 | p01225 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
public class main {
public static void main(String[] args) throws NumberFormatException, IOException {
String str;
BufferedReader br = new BufferedReader(new Inpu... | Main.java:8: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s553121733 | p01225 | Java | public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
int[] n = new int[9];
int[] nr = new int[9];
int[] ng = new int[9];
int[] nb = new int[9];
int ir = 0;
int ig = 0;
int ib = 0;
int count = 0;
char c;
for(int i = 0; i < t; i++){... | Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s223550477 | p01225 | Java | public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
int[] n = new int[9];
int[] nr = new int[9];
int[] ng = new int[9];
int[] nb = new int[9];
int ir = 0;
int ig = 0;
int ib = 0;
int count = 0;
char c;
for(int i = 0; i < t; i++){... | Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s092397172 | p01225 | Java | package Rummy;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int T = Integer.parseInt(scan.nextLine());
String str = "";
for (int i = 0; i < T; i++) {
str = scan.... | Main.java:101: error: illegal start of type
return false;
^
Main.java:104: error: class, interface, enum, or record expected
}
^
2 errors
|
s719840576 | p01225 | Java | package aoj.rummy;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int T = Integer.parseInt(scan.nextLine());
String str = "";
for (int i = 0; i < T; i++) {
str = s... | Main.java:77: error: ';' expected
for (int j = 0; j < 9package aoj.rummy;
^
Main.java:77: error: not a statement
for (int j = 0; j < 9package aoj.rummy;
^
Main.java:79: error: illegal start of expression
import java.util.ArrayList;
^
Main.java:79: error: ... |
s710856626 | p01225 | Java | import java.util.Arrays;
import java.util.Scanner;
//Rummy
public class main {
int[] a, c;
int[][] as;
char[] s;
boolean dfs(int k){
if(k==9){
for(int i=0;i<3;i++)if(s[as[i][0]]!=s[as[i][1]]||s[as[i][1]]!=s[as[i][2]])return false;
for(int i=0;i<3;i++){
int[] t = new int[3];
for(int j=0;j<3;j++)t... | Main.java:5: error: class main is public, should be declared in a file named main.java
public class main {
^
Main.java:45: error: cannot find symbol
new AOJ2102().run();
^
symbol: class AOJ2102
location: class main
2 errors
|
s755865352 | p01225 | Java | import java.util.Arrays;
import java.util.Scanner;
//Rummy
public class Main {
int[] a, c;
int[][] as;
char[] s;
boolean dfs(int k){
if(k==9){
for(int i=0;i<3;i++)if(s[as[i][0]]!=s[as[i][1]]||s[as[i][1]]!=s[as[i][2]])return false;
for(int i=0;i<3;i++){
int[] t = new int[3];
for(int j=0;j<3;j++)t... | Main.java:45: error: cannot find symbol
new AOJ2102().run();
^
symbol: class AOJ2102
location: class Main
1 error
|
s746170918 | p01225 | Java | import java.io.*;
import java.util.ArrayList;
public class Rummy {
public static void main(String[] args) {
// ??\??????????????°??????????´???¨
int intHairetsuNum[] = new int[9];
String strHairetsuNum[] = new String[9];
// ??\??????????????????????´???¨
String strHairetsuColor[] = new String... | Main.java:111: error: illegal escape character
System.out.println("???????????\?????????????????????");
^
1 error
|
s217391188 | p01225 | Java | import java.io.*;
import java.util.ArrayList;
public class Rummy {
public static void main(String[] args) {
// ??\??????????????°??????????´???¨
int intHairetsuNum[] = new int[9];
String strHairetsuNum[] = new String[9];
// ??\??????????????????????´???¨
String strHairetsuColor[] = new String... | Main.java:111: error: illegal escape character
System.out.println("???????????\?????????????????????");
^
1 error
|
s595121724 | p01225 | Java | import java.io.*;
import java.util.ArrayList;
public class MainTwo {
public static void main(String[] args) {
// ??\??????????????°??????????´???¨
int[] intHairetsuNum = new int[9];
String[] strHairetsuNum = new String[9];
// ??\??????????????????????´???¨
String[] strHairetsuColor = new Stri... | Main.java:125: error: illegal escape character
System.out.println("???????????\?????????????????????");
^
1 error
|
s679595966 | p01225 | Java | import java.util.ArrayList;
import java.util.Scanner;
public class Main {
//?????°
private static int valueOfCard = 9; //?????????????????°
private static int numberOfCard = 9; //?????????????????????????¨??????°(1???9 = 9)
private static int colorOfCard = 3; //??????????????????????¨??????°(RGB = 3)
private stat... | Main.java:96: error: class Card is public, should be declared in a file named Card.java
public class Card {
^
1 error
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.