submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s787306520 | p00268 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef complex<double> P;
typedef pair<int,int> state;
int N,M;
P t[100];
int f[100][100];
int d[100][100];
bool check(int from,int to){
P base=t[to]-t[from];
for(int i=0;i<N;i++){
P target=t[i]-t[from];
if(imag(target*conj(base))<0)
return false;
}
return true;
}
void init(){
memset(f,0,sizeof(f));
memset(d,1,sizeof(d));
}
int solve(){
/*
int si=0,ti;
double mini=1e9;
for(int i=0;i<N;i++)
if(t[i].real()<t[si].real())si=i;
for(int i=0;i<N;i++)
if(f[si][i] && arg(t[i]-t[si])< mini)
ti=i,mini=arg(t[i]-t[si]);
Q.push_back(state(si,ti));
*/
deque<state> Q;
d[si][ti]=0;
for(int i=0;i<N;i++){
for(int j=0;j<N;j++){
if(f[i][j]&&check(i,j)){
d[i][j]=0;
Q.push_front(state(i,j));
}
}
}
int ans=0;
while(!Q.empty()){
state p=Q.front();
Q.pop_front();
int from=p.first;
int to=p.second;
ans=d[from][to];
if(d[from][to]+1<d[to][from]){
d[to][from]=d[from][to]+1;
Q.push_back(state(to,from));
}
int id=-1;
double mini=1e9;
for(int i=0;i<N;i++){
if(f[to][i]&&i!=from){
if( arg( (t[i]-t[to])*conj(t[to]-t[from]) ) < mini){
id=i;
mini=arg( (t[i]-t[to])*conj(t[to]-t[from]) );
}
}
}
if(id!=-1&&d[to][id]>d[from][to]){
d[to][id]=d[from][to];
Q.push_front(state(to,id));
}
}
return ans;
}
int main(){
while(1){
cin>>N>>M;
if(N==0&&M==0)break;
init();
for(int i=0;i<N;i++){
int x,y;
cin>>x>>y;
t[i]=P(x,y);
}
for(int i=0;i<M;i++){
int x,y;
cin>>x>>y;
x--,y--;
f[x][y]=f[y][x]=true;
}
cout<<solve()<<endl;
}
return 0;
} | a.cc: In function 'int solve()':
a.cc:41:5: error: 'si' was not declared in this scope; did you mean 'sin'?
41 | d[si][ti]=0;
| ^~
| sin
a.cc:41:9: error: 'ti' was not declared in this scope; did you mean 'tm'?
41 | d[si][ti]=0;
| ^~
| tm
|
s973461273 | p00269 | C++ |
#include <queue>
#include <cstdio>
#include <numeric>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
const int INF=1<<29;
const int V_MAX=1+201+200+2;
const int CAPA_INF=INF; // foolish :(
const int COST_INF=INF; // foolish :(
template<class T,class U>
struct edge{
int v,rev;
T capa;
U cost;
T flow;
};
template<class T,class U>
void add_directed_edge(vector< edge<T,U> > *G,int u,int v,T capa,U cost){
G[u].push_back((edge<T,U>){v,G[v].size() ,capa, cost,0});
G[v].push_back((edge<T,U>){u,G[u].size()-1, 0,-cost,0});
}
template<class T,class U>
pair<T,U> augment(int n,vector< edge<T,U> > *G,int s,int t,U *pot){
static int pre[V_MAX];
static U d[V_MAX];
rep(u,n) d[u]=(u==s?0:COST_INF);
// Dijkstra
bool ok=false;
priority_queue< pair<U,int> > Q; Q.push(make_pair(0,s));
while(!Q.empty()){
int u=Q.top().second;
U cost=-Q.top().first; Q.pop();
if(cost<d[u]) continue;
if(u==t) ok=true;
rep(i,G[u].size()){
edge<T,U> &e=G[u][i];
U cost2=cost+e.cost+pot[u]-pot[e.v];
if(e.capa-e.flow>0 && cost2<d[e.v]){
d[e.v]=cost2;
pre[e.v]=e.rev;
Q.push(make_pair(-cost2,e.v));
}
}
}
if(!ok) return make_pair(0,0);
T water=CAPA_INF;
for(int v=t;v!=s;){
edge<T,U> &e1=G[v][pre[v]];
edge<T,U> &e2=G[e1.v][e1.rev];
water=min(water,e2.capa-e2.flow);
v=e1.v;
}
U cost=0;
for(int v=t;v!=s;){
edge<T,U> &e1=G[v][pre[v]];
edge<T,U> &e2=G[e1.v][e1.rev];
e1.flow-=water;
e2.flow+=water;
cost+=water*e2.cost;
v=e1.v;
}
rep(u,n) pot[u]+=d[u];
return make_pair(water,cost);
}
template<class T,class U>
pair<T,U> primal_dual(int n,vector< edge<T,U> > *G,int s,int t){
static U pot[V_MAX];
rep(u,n) pot[u]=0;
T ans1=0;
U ans2=0;
while(1){
pair<T,U> tmp=augment(n,G,s,t,pot);
if(tmp.first==0) break;
ans1+=tmp.first;
ans2+=tmp.second;
}
return make_pair(ans1,ans2);
}
int d,k,l,c[8][8];
int num[8];
int dp[8][8][9][3*3*3*3*3*3*3*3];
inline int encode(){
int res=0;
rep(i,k) res=3*res+num[i];
return res;
}
int dfs(int day,int i,int a){ // i-th parts, already bought a parts today
if(count(num,num+k,0)==k) return 0;
if(day==d) return INF;
if(i==k) return dfs(day+1,0,0);
int S=encode();
if(dp[day][i][a][S]) return dp[day][i][a][S];
// trivial pruning
if(l-a+l*(d-day)<accumulate(num,num+k,0)) return INF;
int res=dfs(day,i+1,a);
if(num[i]>0 && a<l){
num[i]--;
res=min(res,dfs(day,i,a+1)+c[day][i]);
num[i]++;
}
return dp[day][i][a][S]=res;
}
int main(){
while(scanf("%d%d%d",&d,&k,&l),d){
rep(i,d) rep(j,k) scanf("%d",c[i]+j);
int m,n,p; scanf("%d%d%d",&m,&n,&p);
int r[200][8],t[200][8];
rep(i,m) rep(j,k) scanf("%d",r[i]+j);
rep(i,p) rep(j,k) scanf("%d",t[i]+j);
memset(dp,0,sizeof dp);
// build graph
vector< edge<int,int> > G[V_MAX];
int N=1+p+1+m+2;
int s=0,t1=N-2,t2=N-1;
// source to fukuro
rep(i,p) add_directed_edge(G,s,1+i,1,0);
add_directed_edge(G,s,1+p,n,0);
// fukuro to kadai
rep(i,p) rep(j,m) {
bool subset=true;
rep(ii,k) if(t[i][ii]>r[j][ii]) subset=false;
if(!subset) continue; // too many parts in fukuro i
rep(ii,k) num[ii]=r[j][ii]-t[i][ii];
int cost=dfs(0,0,0);
if(cost<INF) add_directed_edge(G,1+i,1+p+1+j,1,cost);
}
// without fukuro to kadai
rep(j,m){
rep(ii,k) num[ii]=r[j][ii];
int cost=dfs(0,0,0);
if(cost<INF) add_directed_edge(G,1+p,1+p+1+j,1,cost);
}
// kadai to sink
rep(j,m) add_directed_edge(G,1+p+1+j,t1,1,0);
add_directed_edge(G,t1,t2,n,0);
pair<int,int> ans=primal_dual(N,G,s,t2);
printf("%d\n",ans.first<n?-1:ans.second);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:140:17: error: 'memset' was not declared in this scope
140 | memset(dp,0,sizeof dp);
| ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include <algorithm>
+++ |+#include <cstring>
6 |
a.cc: In instantiation of 'void add_directed_edge(std::vector<edge<T, U> >*, int, int, T, U) [with T = int; U = int]':
a.cc:147:29: required from here
147 | rep(i,p) add_directed_edge(G,s,1+i,1,0);
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
a.cc:27:47: warning: narrowing conversion of '(G + ((sizetype)(((long unsigned int)v) * 24)))->std::vector<edge<int, int> >::size()' from 'std::vector<edge<int, int> >::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing]
27 | G[u].push_back((edge<T,U>){v,G[v].size() ,capa, cost,0});
| ~~~~~~~~~^~
a.cc:28:49: warning: narrowing conversion of '((G + ((sizetype)(((long unsigned int)u) * 24)))->std::vector<edge<int, int> >::size() - 1)' from 'std::vector<edge<int, int> >::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing]
28 | G[v].push_back((edge<T,U>){u,G[u].size()-1, 0,-cost,0});
| ~~~~~~~~~~~^~
|
s133669605 | p00270 | C++ | #include <queue>
#include <cstdio>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
const int INF=1<<29;
struct edge{ int v,cost; };
int main(){
int n,m; scanf("%d%d",&n,&m);
static vector<edge> G[100000];
rep(i,m){
int u,v,cost; scanf("%d%d%d",&u,&v,&cost); u--; v--;
G[u].push_back((edge){v,cost});
G[v].push_back((edge){u,cost});
}
int a,b,q; scanf("%d%d%d",&a,&b,&q); a--; b--;
static int c[40000],d[40000];
rep(i,q) scanf("%d%d",c+i,d+i), c[i]--, d[i]--;
// calculate distances from a
static int dist_a[100000];
rep(u,n) dist_a[u]=(u==a?0:INF);
priority_queue< pair<int,int> > Qa; Qa.push(make_pair(0,a));
while(!Qa.empty()){
int d_now=-Qa.top().first,u=Qa.top().second; Qa.pop();
if(d_now>dist_a[u]) continue;
rep(i,G[u].size()){
int v=G[u][i].v,cost=G[u][i].cost;
if(dist_a[v]>dist_a[u]+cost){
dist_a[v]=dist_a[u]+cost;
Qa.push(make_pair(-dist_a[v],v));
}
}
}
// calculate distances from b
static int dist_b[100000];
rep(u,n) dist_b[u]=(u==b?0:INF);
priority_queue< pair<int,int> > Qb; Qb.push(make_pair(0,b));
while(!Qb.empty()){
int d_now=-Qb.top().first,u=Qb.top().second; Qb.pop();
if(d_now>dist_b[u]) continue;
rep(i,G[u].size()){
int v=G[u][i].v,cost=G[u][i].cost;
if(dist_b[v]>dist_b[u]+cost){
dist_b[v]=dist_b[u]+cost;
Qb.push(make_pair(-dist_b[v],v));
}
}
}
// build the shortest path DAG from a to b
static vector<int> H[100000];
rep(u,n) rep(i,G[u].size()) {
int v=G[u][i].v,cost=G[u][i].cost;
if(dist_a[u]+cost+dist_b[v]==dist_a[b]) H[u].push_back(v);
}
// find a topological order of H
vector<int> top;
static bool vis[100000];
queue<int> Q; Q.push(a);
while(!Q.empty()){
int u=Q.front(); Q.pop();
top.push_back(u);
rep(i,H[u].size()){
int v=H[u][i];
if(!vis[v]) vis[v]=true, Q.push(v);
}
}
// query
rep(i,(q+63)/64){
static ll dp[100000];
memset(dp,0,sizeof dp);
rep(j,64) if(64*i+j<q) dp[c[64*i+j]]|=1LL<<j;
rep(i,n){
int u=top[i];
rep(j,H[u].size()){
int v=H[u][j];
dp[v]|=dp[u];
}
}
rep(j,64) if(64*i+j<q) puts(dp[d[64*i+j]]&(1LL<<j)?"Yes":"No");
}
return 0;
} | a.cc: In function 'int main()':
a.cc:82:17: error: 'memset' was not declared in this scope
82 | memset(dp,0,sizeof dp);
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <cstdio>
+++ |+#include <cstring>
3 |
|
s363521804 | p00270 | C++ | #include<iostream>
#include<algorithm>
#include<string>
#include<cstdio>
#include<vector>
#include<queue>
#include<stack>
using namespace std;
typedef pair<int,int> P;
#define rep(i,x) for(int i=0;i<x;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)
#define pb push_back
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define sor(vec) sort(vec.begin(),vec.end())
#define rev(vec) reverse(vec.begin(),vec.end())
#define pque(x) priority_queue<x>
#define rpque(x) priority_queue<x,vector<x>,greater<x> >
#define fr first
#define sc second
const int INF=1000000000;
int main(){
int s,r,u,v,w,a,b,q;
static vector<P> G[100010];
scanf("%d%d",&s,&r);
rep(i,r){
scanf("%d%d%d",&u,&v,&w);
G[u].pb(P(v,w));
G[v].pb(P(u,w));
}
scanf("%d%d%d",&a,&b,&q);
static bool used[100010];
static int d[100010];
rpque(P) que;
static vector<int> prev[100010];
rep(i,100010)used[i]=false;
rep(i,100010)d[i]=INF;
d[a]=0;
que.push(P(0,a));
while(!que.empty()){
P p=que.top(); que.pop();
if(!used[p.sc]){
rep(i,G[p.sc].size()){
P ed=G[p.sc][i];
if(d[ed.fr]>d[p.sc]+ed.sc){
d[ed.fr]=d[p.sc]+ed.sc;
prev[ed.fr].clear();
prev[ed.fr].pb(p.sc);
que.push(P(d[ed.fr],ed.fr));
}
else if(d[ed.fr]==d[p.sc]+ed.sc){
prev[ed.fr].pb(p.sc);
}
}
used[p.sc]=true;
}
}
/*rep1(i,s){
printf("%d:",i);
rep(j,prev[i].size()){
printf("%d ",prev[i][j]);
}
printf("\n");
}*/
rep(i,100010)used[i]=false;
queue<int> que0;
static vector<int> nG[100010];
que0.push(b); used[b]=true;
while(!que0.empty()){
int x=que0.front(); que0.pop();
rep(i,prev[x].size()){
int p=prev[x][i];
nG[p].pb(x);
if(!used[p]){
que0.push(p);
used[p]=true;
}
}
}
/*rep1(i,s){
printf("%d:",i);
rep(j,nG[i].size()){
printf("%d ",nG[i][j]);
}
printf("\n");
}*/
static bool used0[100010];
rep(i,100010)used0[i]=used[i];
rep(i,q){
int c,e;
scanf("%d%d",&c,&e);
if(!used0[e]){
printf("No\n");
continue;
}
rep(i,100010)used[i]=false;
stack<int> sta;
sta.push(c); used[c]=true;
bool ret=false;
while(!sta.empty()){
int x=sta.top(); sta.pop();
if(x==e){ ret=true; break; }
rrep(i,nG[x].size()){
int nex=nG[x][i];
if(!used[nex]){
sta.push(nex);
used[nex]=true;
}
}
}
if(ret)printf("Yes\n");
else printf("No\n");
}
} | a.cc: In function 'int main()':
a.cc:122:25: error: 'rrep' was not declared in this scope; did you mean 'rep'?
122 | rrep(i,nG[x].size()){
| ^~~~
| rep
|
s791811347 | p00270 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<queue>
using namespace std;
typedef pair<long long, long long> P;
#define INF (1LL << 60)
vector<P> edge[105000];
long long adist[105000], bdist[105000];
long long a, b, c, d, q, u, v, w, s, r;
void dijkstra(long long *dist, long long x){
for(int i = 0;i < 105000;i++)dist[i] = INF;
dist[x] = 0;
priority_queue<P, vector<P>, greater<P> > pq;
pq.push(P(0, x));
while(!pq.empty()){
P tmp = pq.top();pq.pop();
long long from = tmp.second;
if(dist[from] < tmp.first)break;
for(long long i = 0;i < edge[from].size();i++){
long long tw = edge[from][i].first, to = edge[from][i].second;
if(dist[to] > dist[from] + tw){
dist[to] = dist[from] + tw;
pq.push(P(dist[to], to));
if(to >= 105000)return 1;
}
}
}
}
bool solve(long long c, long long d){
if(adist[c] + bdist[c] != adist[b])return false;
if(c == d)return true;
for(long long i = 0;i < edge[c].size();i++){
long long r = edge[c][i].first, to = edge[c][i].second;
if(adist[c] + r != adist[to])continue;
if(solve(to, d))return true;
}
return false;
}
int main(){
cin >> s >> r;
for(long long i = 0;i < r;i++){
cin >> u >> v >> w;
edge[u].push_back(P(w, v));
edge[v].push_back(P(w, u));
}
cin >> a >> b >> q;
dijkstra(adist, a);
dijkstra(bdist, b);
for(long long i = 0;i < q;i++){
cin >> c >> d;
if(solve(c, d))
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
} | a.cc: In function 'void dijkstra(long long int*, long long int)':
a.cc:27:40: error: return-statement with a value, in function returning 'void' [-fpermissive]
27 | if(to >= 105000)return 1;
| ^
|
s476677198 | p00270 | C++ | #include<iostream>
#include<algorithm>
#include<queue>
#include<map>
using namespace std;
#define INF (1LL << 60)
typedef pair<long long, long long> P;
vector<P> valid_edge;
long long adist[105000], bdist[105000];
vector<P> edge[105000];
long long come[105000];
void dijkstra(long long start, long long *dist){
fill(dist, dist + 103000, INF);
priority_queue<P, vector<P>, greater<P> > pq;
dist[start] = 0;
pq.push(P(0, start));
while(!pq.empty()){
P tmp = pq.top();pq.pop();
long long from = tmp.second, d = tmp.first;
if(dist[from] < d)continue;
for(long long i = 0;i < edge[from].size();i++){
long long to = edge[from][i].first, r = edge[from][i].second;
if(dist[from] + r >= dist[to])continue;
dist[to] = dist[from] + r;
pq.push(P(dist[to], to));
}
}
}
int main(){
long long s, r, a, b, q, u[210000], v[210000], w[210000];
cin >> s >> r;
for(long long i = 0;i < r;i++){
cin >> u[i] >> v[i] >> w[i];
edge[u[i]].push_back(P(v[i], w[i]));
edge[v[i]].push_back(P(u[i], w[i]));
}
cin >> a >> b >> q;
dijkstra(a, adist);
dijkstra(b, bdist);
if(adist[b] != bdist[a])reutrn 1;
for(int i = 0;i < r;i++){
if(adist[u[i]] == INF || adist[v[i]] == INF ||
bdist[u[i]] == INF || bdist[v[i]] == INF)
continue;
if(adist[u[i]] + bdist[u[i]] == bdist[a] &&
adist[v[i]] + bdist[v[i]] == bdist[a] &&
adist[u[i]] + w[i] == adist[v[i]]){
valid_edge.push_back(P(u[i], v[i]));
}
swap(u[i], v[i]);
if(adist[u[i]] + bdist[u[i]] == bdist[a] &&
adist[v[i]] + bdist[v[i]] == bdist[a] &&
adist[u[i]] + w[i] == adist[v[i]]){
valid_edge.push_back(P(u[i], v[i]));
}
}
long long c[64], d[64];
long long dp[105000];
for(long long i = 0;i < q;i += 50){
fill(dp, dp + 105000, 0);
for(long long j = 0;j < 50 && i + j < q;j++){
cin >> c[j] >> d[j];
dp[c[j]] |= (1ULL << j);
}
for(long long j = 0;j < valid_edge.size();j++){
long long from = valid_edge[j].first;
long long to = valid_edge[j].second;
dp[to] |= dp[from];
}
for(long long j = 0;j < 50 && i + j < q;j++){
if(dp[d[j]] & (1ULL << j))cout << "Yes" << endl;
else cout << "No" << endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:42:25: error: 'reutrn' was not declared in this scope
42 | if(adist[b] != bdist[a])reutrn 1;
| ^~~~~~
|
s391165223 | p00271 | Java | package kyuu1;
import java.util.Scanner;
public class SelectionSort2 {
Scanner sc = new Scanner(System.in);
int[] kode = {100,101,102,103,104,105,106,107,108,109};
int n;
int m;
int taihi;
int soeji;
int max;
public void sort(){
for(n=0;n<kode.length-1;n++){
soeji = n;
max = kode[n];
for(m=n+1;m<kode.length;m++){
if(max<kode[m]){
soeji = m;
max = kode[m];
}
}
if(n != soeji){
taihi = kode[n];
kode[n] = kode[soeji];
kode[soeji] = taihi;
}
}
}
public void hyouji(){
for(n=0;n<kode.length;n++){
System.out.println(kode[n]);
}
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
SelectionSort2 sele2 = new SelectionSort2();
sele2.sort();
sele2.hyouji();
}
} | Main.java:5: error: class SelectionSort2 is public, should be declared in a file named SelectionSort2.java
public class SelectionSort2 {
^
1 error
|
s015218070 | p00271 | Java | public class Main {
Scanner sc =new Scanner(System.in);
int x;
int nissu = sc.nextInt();
int[] goukei = new int[nissu];
double gnyuryo,gpuryo;;
public void ryoukin(){
for(x=0;x<=nissu-1;x++){
int nyuryo = sc.nextInt();
int puryo = sc.nextInt();
int nyumai = sc.nextInt();
int pumai = sc.nextInt();
if(nyumai>=5&&pumai>=2){
gnyuryo = (nyuryo * nyumai)* 0.8 ;
gpuryo = (puryo * pumai)* 0.8;
}else{
if(nyumai==6&&pumai<=0){
goukei[x] = (int)((goukei[x]+puryo*2)*0.8);
}}
gpuryo = puryo * pumai;
gnyuryo = nyuryo * nyumai;
goukei[x] = (int) (gnyuryo + gpuryo);
}
}
public void hyouji(){
for(x=0;x<=nissu-1;x++){
System.out.println(goukei[x]);
}
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Main kin = new Main();
kin.ryoukin();
kin.hyouji();
}
} | Main.java:2: error: cannot find symbol
Scanner sc =new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:2: error: cannot find symbol
Scanner sc =new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s848178396 | p00271 | Java | public class Main {
Scanner sc = new Scanner(System.in);
int[] dai = new int[8];
int[] tei = new int[8];
int[] sa = new int[8];
int nikka ;
int ww ;
public void syukei(){
for (nikka=1;nikka <8;nikka++){
System.out.println(nikka + "日目の最大気温を入力してください。;");
dai[nikka] = sc.nextInt();
System.out.println(nikka + "日目の最低気温を入力してください。;");
tei[nikka] = sc.nextInt();
sa[nikka] = dai[nikka] - tei [nikka];
}
}
public void hyouji(){
for(ww=1;ww<8;ww++){
System.out.println(sa[ww]);
}
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Mondai20131 wao = new Mondai20131();
wao.syukei();
wao.hyouji(); | Main.java:37: error: reached end of file while parsing
wao.hyouji();
^
1 error
|
s524115369 | p00271 | Java | package ;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner sc = new Scanner(System.in);
int a,b,c;
c = 1;
do{
a = sc.nextInt();
b = sc.nextInt();
System.out.println(a - b);
c++;
}while(c > 7);
}
} | Main.java:1: error: <identifier> expected
package ;
^
1 error
|
s740048926 | p00271 | Java | public class Main {
Scanner sc = new Scanner(System.in);
int x;
int[] kionsa = {1,2,3,4,5,6,7};
public void nyuryoku(){
for(x=0;x<=6;x++){
int saiko = sc.nextInt();
int saitei = sc.nextInt();
kionsa[x] = saiko-saitei;
}
}
public void nyuuryoku2(){
for(x=0;x<=6;x++){
System.out.println(kionsa[x]);
}
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Main hai =new Main();
hai.nyuryoku();
hai.nyuuryoku2();
}
} | Main.java:2: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:2: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s325434399 | p00271 | Java | package kouza;
import java.util.Scanner;
public class main {
Scanner sc = new Scanner(System.in);
int a,b,k;
int sa[]=new int[7];{
for(k=0;k<=7;k++){
a = sc.nextInt();
b = sc.nextInt();
System.out.print(a - b);
}
}
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
main sa = new main();
}
} | Main.java:5: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s935504584 | p00271 | Java | import java.util.Scanner;
public class Main {
Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
int a;
int []kotae = new int [8];
int saikou =sc.nextInt();
int saitei=sc.nextInt();
int aa=0;
for(a=0;a<7;a++){
kotae[a] = saikou-saitei;
System.out.print(saikou);
System.out.print(saitei);
System.out.println(kotae[a]);
}
}
} | Main.java:7: error: non-static variable sc cannot be referenced from a static context
int saikou =sc.nextInt();
^
Main.java:8: error: non-static variable sc cannot be referenced from a static context
int saitei=sc.nextInt();
^
2 errors
|
s630565893 | p00271 | Java | import java.util.Scanner;
public class Main {
Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
int a;
int []kotae = new int [8];
int saikou =sc.nextInt();
int saitei=sc.nextInt();
int aa=0;
for(a=0;a<7;a++){
kotae[a] = saikou-saitei;
System.out.print(saikou);
System.out.print(saitei);
System.out.println(kotae[a]);
}
}
} | Main.java:7: error: non-static variable sc cannot be referenced from a static context
int saikou =sc.nextInt();
^
Main.java:8: error: non-static variable sc cannot be referenced from a static context
int saitei=sc.nextInt();
^
2 errors
|
s342185310 | p00271 | Java | package pasokonkousien;
import java.util.Scanner;
public class Toi12013 {
Scanner sc = new Scanner(System.in);
int[] saikou = {30,39,19,25,22,23,10};
int[] saitei = {19,20,18,20,21,10,-10};
int n;
int [] sa = new int [8];
public void hiki(){
for(n=0;n<7;n++){
sa[n]=saikou[n] - saitei[n];
System.out.println(sa[n]);
}
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Toi12013 toi = new Toi12013();
toi.hiki();
}
} | Main.java:5: error: class Toi12013 is public, should be declared in a file named Toi12013.java
public class Toi12013 {
^
1 error
|
s599195827 | p00271 | Java | mport java.util.Scanner;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner sc = new Scanner(System.in);
int[] sa = new int[7];
for(int i=0;i<7;i++){
int a = sc.nextInt();
int b = sc.nextInt();
sa[i] = a-b;
}
for(int i = 0;i<7;i++){
System.out.println(sa[i]);
}
}
} | Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
|
s011646976 | p00271 | Java | package ;
import java.util.Scanner;
public class Main {
public Main(){
Scanner sc = new Scanner(System.in);
int a,b,k;
int sa[]=new int[7];
for(k=0;k<7;k++){
a = sc.nextInt();
b = sc.nextInt();
System.out.print(a - b);
}
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Main sa = new Main();
}
} | Main.java:1: error: <identifier> expected
package ;
^
1 error
|
s435816388 | p00271 | Java | public class Main {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int i,a,b;
for(i=0; i<7; i++) {
a = sc.nextInt();
b = sc.nextInt();
System.out.println(a-b);
}
}
} | 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
|
s330878527 | p00271 | Java | package pasokonkousien;
import java.util.Scanner;
public class Toi12013 {
Scanner sc = new Scanner(System.in);
int[] a = {30,39,19,25,22,23,10};
int[] b = {19,20,18,20,21,10,-10};
int n;
int [] c = new int [8];
public void hiki(){
for(n=0;n<7;n++){
c[n]=a[n] - b[n];
System.out.println(c[n]);
}
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Toi12013 toi = new Toi12013();
toi.hiki();
}
} | Main.java:5: error: class Toi12013 is public, should be declared in a file named Toi12013.java
public class Toi12013 {
^
1 error
|
s477679500 | p00271 | Java | import java.util.Scanner
public class Main{
int a,b,i;
public static void main(String[] args){
for(i=0;i<=7;i++){
a = sc.nextInt();
b = sc.nextInt();
}
for(int j=0;j<=7;j++){
System.out.println(a-b);
}
} | Main.java:1: error: ';' expected
import java.util.Scanner
^
Main.java:12: error: reached end of file while parsing
}
^
2 errors
|
s210237281 | p00271 | Java | import java.util.Scanner
public class Main{
int a,b,i;
public static void main(String[] args){
for(i=0;i<=7;i++){
a = sc.nextInt();
b = sc.nextInt();
}
for(int j=0;j<=7;j++){
System.out.println(a-b);
}
}
} | Main.java:1: error: ';' expected
import java.util.Scanner
^
1 error
|
s179071025 | p00271 | Java | public class Main{
int a,b,i;
public static void main(String[] args){
for(i=0;i<=7;i++){
a = sc.nextInt();
b = sc.nextInt();
}
for(int j=0;j<=7;j++){
System.out.println(a-b);
}
}
} | Main.java:4: error: non-static variable i cannot be referenced from a static context
for(i=0;i<=7;i++){
^
Main.java:4: error: non-static variable i cannot be referenced from a static context
for(i=0;i<=7;i++){
^
Main.java:4: error: non-static variable i cannot be referenced from a static context
for(i=0;i<=7;i++){
^
Main.java:5: error: non-static variable a cannot be referenced from a static context
a = sc.nextInt();
^
Main.java:5: error: cannot find symbol
a = sc.nextInt();
^
symbol: variable sc
location: class Main
Main.java:6: error: non-static variable b cannot be referenced from a static context
b = sc.nextInt();
^
Main.java:6: error: cannot find symbol
b = sc.nextInt();
^
symbol: variable sc
location: class Main
Main.java:9: error: non-static variable a cannot be referenced from a static context
System.out.println(a-b);
^
Main.java:9: error: non-static variable b cannot be referenced from a static context
System.out.println(a-b);
^
9 errors
|
s279156682 | p00271 | Java | import java.util.Scanner;
public class Main{
int a,b,i;
public void solve(){
for(i=0;i<=7;i++){
a = sc.nextInt();
b = sc.nextInt();
}
for(int j=0;j<=7;j++){
System.out.println(a-b);
}
}
public static void main(String[] args){
Main obj= new Main();
obj.solve();
}
}
} | Main.java:18: error: class, interface, enum, or record expected
}
^
1 error
|
s801377507 | p00271 | Java | import java.util.Scanner;
public class Main{
int a;
int b;
int sa;
public void solve(){
Scanner sc=new Scanner(System.in);
for(int i=0;i<;i++){
a=sc.nextInt();
b=sc.nextInt();
sa=a-b;
System.out.println(sa);
}
}
public static void main(String[]args){
Main obj=new Main();
obj.solve();
}
} | Main.java:10: error: illegal start of expression
for(int i=0;i<;i++){
^
1 error
|
s266655560 | p00271 | Java | //問題1 2704 上石彩花
imoort java.util.Scanner;
public class Main{
public void solve(){
Scanner sc=new Scanner(System.in);
int a,b,sa;
for(int i=0;i<7;i++){
a=sc.nextInt();
b=sc.nextInt();
sa=a-(b);
System.out.println(sa);
}
}
public static void main(String[]arges){
Main obj=new Main();
obj.solve();
}
} | Main.java:2: error: class, interface, enum, or record expected
imoort java.util.Scanner;
^
1 error
|
s732012529 | p00271 | Java | //問題1 2704 上石彩花
imoort java.util.Scanner;
public class Main{
public void solve(){
Scanner sc=new Scanner(System.in);
int a,b,sa;
for(int i=0;i<7;i++){
a=sc.nextInt();
b=sc.nextInt();
System.out.println(a-b);
}
}
public static void main(String[]arges){
Main obj=new Main();
obj.solve();
} | Main.java:2: error: class, interface, enum, or record expected
imoort java.util.Scanner;
^
Main.java:18: error: reached end of file while parsing
}
^
2 errors
|
s224459173 | p00271 | Java | import java.util.Scanner;
public class kion{
int a;
int b;
int sa;
public void solve(){
Scanner sc = new Scanner(System.in);
for(int i=0;i<=6;i++){
a = sc.nextInt();
b = sc.nextInt();
sa = a-b;
System.out.println(sa);
}
}
public static void main(String[] args){
kion obj = new kion();
obj.solve();
}
}
| Main.java:2: error: class kion is public, should be declared in a file named kion.java
public class kion{
^
1 error
|
s792338460 | p00271 | Java | #include<iostream>
#include<cstdio>
using namespace std;
int main(){
int a[10];
int n[10],k[10];
for(int i=0;i<7;i++){
cin>>n[i]>>k[i];
}
for(int i=0;i<7;i++){
a[i]=n[i]-k[i];
}
for(int i=0;i<7;i++){
cout<<a[i]<<endl;
}
return 0;
} | Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:2: error: illegal character: '#'
#include<cstdio>
^
Main.java:6: error: not a statement
int n[10],k[10];
^
Main.java:8: error: not a statement
cin>>n[i]>>k[i];
^
Main.java:14: error: not a statement
cout<<a[i]<<endl;
^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
(use --enable-preview to enable unnamed classes)
Main.java:5: error: ']' expected
int a[10];
^
Main.java:6: error: ']' expected
int n[10],k[10];
^
8 errors
|
s565051696 | p00271 | Java | import java.util.*;
public class mon1{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int a = 0;
int b = 0;
int c = 0;
for(int i=1;i<=7;i++){
a = scan.nextInt();
b = scan.nextInt();
if(a >= b){
c = a - b;
}
System.out.println(c);
}
}
}
| Main.java:3: error: class mon1 is public, should be declared in a file named mon1.java
public class mon1{
^
1 error
|
s276966908 | p00271 | Java |
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int sum = 0;
int sum2=0;
for(int i = 0; i < 7; i++){
sum = sc.nextInt();
sum2=sc.nexInt();
System.out.println(sum-sum2);
}
sc.close();
}
}
| Main.java:2: error: class, interface, enum, or record expected
2
^
1 error
|
s324963093 | p00271 | Java |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int sum = 0;
int sum2=0;
for(int i = 0; i < 7; i++){
sum = sc.nextInt();
sum2=sc.nexInt();
System.out.println(sum-sum2);
}
sc.close();
}
}
| Main.java:14: error: cannot find symbol
sum2=sc.nexInt();
^
symbol: method nexInt()
location: variable sc of type Scanner
1 error
|
s713573010 | p00271 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
for(int i=0;i<7;i++){
int a=scan,nextInt();
int b=scan,nextInt();
a=a-b;
System.out.println(a);
}
}
} | Main.java:7: error: ';' expected
int a=scan,nextInt();
^
Main.java:8: error: ';' expected
int b=scan,nextInt();
^
2 errors
|
s627355929 | p00271 | Java | for i in range(0,7):
a,b=map(int,raw_input().split())
print a-b | Main.java:1: error: class, interface, enum, or record expected
for i in range(0,7):
^
1 error
|
s253007644 | p00271 | C | #include <stdio.h>
int main(){
int a,b,c;
scanf("%d %d",&a,&b);
c=a-b;
printf("%d\n",c);
scanf("%d %d",&a,&b);
c=a-b;
printf("%d\n",c);
scanf("%d %d",&a,&b);
c=a-b;
printf("%d\n",c);
scanf("%d %d",&a,&b);
c=a-b;
printf("%d\n",c);
scanf("%d %d",&a,&b);
c=a-b;
printf("%d\n",c);
scanf("%d %d",&a,&b);
c=a-b;
printf("%d\n",c);
scanf("%d %d ,&a,&b);
c=a-b;
printf("%d\n",c);
return 0;
} | main.c: In function 'main':
main.c:22:11: warning: missing terminating " character
22 | scanf("%d %d ,&a,&b);
| ^
main.c:22:11: error: missing terminating " character
22 | scanf("%d %d ,&a,&b);
| ^~~~~~~~~~~~~~~
main.c:23:10: error: expected ')' before ';' token
23 | c=a-b;
| ^
| )
main.c:22:10: note: to match this '('
22 | scanf("%d %d ,&a,&b);
| ^
main.c:23:6: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
23 | c=a-b;
| ~^~~~
| |
| int
In file included from main.c:1:
/usr/include/stdio.h:428:42: note: expected 'const char *' but argument is of type 'int'
428 | extern int scanf (const char *__restrict __format, ...) __wur;
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:25:18: error: expected ';' before '}' token
25 | return 0;
| ^
| ;
26 | }
| ~
|
s549672588 | p00271 | C | #include<iostream>
#include<algorithm>
using namespace std;
int a, b;
int main(){
for(int i = 0;i < 7;i++){
cin >> a >> b;
cout << abs(a - b) << endl;
}
return 0;
} | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s482860024 | p00271 | C | #include<stdio.h>
int main()
{
int a,b,i,h[10]
for(i=0;i<7;i++){
scanf(%d%d,&a,&b)
h[i]=a-b;
}
for(i=0;i<7;i++){
printf("%d\n",h[i])
}
return 0;
} | main.c: In function 'main':
main.c:5:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'for'
5 | for(i=0;i<7;i++){
| ^~~
main.c:5:18: error: expected ';' before ')' token
5 | for(i=0;i<7;i++){
| ^
| ;
main.c:5:18: error: expected statement before ')' token
main.c:6:11: error: expected expression before '%' token
6 | scanf(%d%d,&a,&b)
| ^
main.c:6:22: error: expected ';' before 'h'
6 | scanf(%d%d,&a,&b)
| ^
| ;
7 | h[i]=a-b;
| ~
main.c:10:17: error: 'h' undeclared (first use in this function)
10 | printf("%d\n",h[i])
| ^
main.c:10:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:22: error: expected ';' before '}' token
10 | printf("%d\n",h[i])
| ^
| ;
11 | }
| ~
|
s698234430 | p00271 | C | #include <stdio.h>
int main(){
int max1,mini1,max2,mini2,max3,mini3,max4,mini4,max5,mini5,max6,mini6,max7,mini7;
scanf("%d%d",&max1,&mini1);
scanf("%d%d",&#include <stdio.h>
int main(){
int max1,mini1,max2,mini2,max3,mini3,max4,mini4,max5,mini5,max6,mini6,max7,mini7;
scanf("%d%d",&max1,&mini1);
scanf("%d%d",&max2,&mini2);
scanf("%d%d",&max3,&mini3);
scanf("%d%d",&max4,&mini4);
scanf("%d%d",&max5,&mini5);
scanf("%d%d",&max6,&mini6);
scanf("%d%d",&max7,&mini7);
printf("%d\n",max1-mini1);
printf("%d\n",max2-mini2);
printf("%d\n",max3-mini3);
printf("%d\n",max4-mini4);
printf("%d\n",max5-mini5);
printf("%d\n",max6-mini6);
printf("%d\n",max7-mini7);
return 0;
}max2,&mini2);
scanf("%d%d",&max3,&mini3);
scanf("%d%d",&max4,&mini4);
scanf("%d%d",&max5,&mini5);
scanf("%d%d",&max6,&mini6);
scanf("%d%d",&max7,&mini7);
printf("%d\n",max1-mini1);
printf("%d\n",max2-mini2);
printf("%d\n",max3-mini3);
printf("%d\n",max4-mini4);
printf("%d\n",max5-mini5);
printf("%d\n",max6-mini6);
printf("%d\n",max7-mini7);
return 0;
} | main.c: In function 'main':
main.c:5:15: error: stray '#' in program
5 | scanf("%d%d",&#include <stdio.h>
| ^
main.c:5:16: error: 'include' undeclared (first use in this function)
5 | scanf("%d%d",&#include <stdio.h>
| ^~~~~~~
main.c:5:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:25: error: 'stdio' undeclared (first use in this function); did you mean 'stdin'?
5 | scanf("%d%d",&#include <stdio.h>
| ^~~~~
| stdin
main.c:6:1: error: expected expression before 'int'
6 | int main(){
| ^~~
|
s655334919 | p00271 | C | #include <stdio.h>
int main(void)
{
int i, a, b;
for (i = 0; i < 7; i++) {
scanf_s("%d %d", &a, &b);
printf("%d\n", a - b);
}
return 0;
} | main.c: In function 'main':
main.c:7:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
7 | scanf_s("%d %d", &a, &b);
| ^~~~~~~
| scanf
|
s885442419 | p00271 | C | #include<stdio.h>
int main(void){
int a,b,c,i=7;
while(i!=0){
scanf("%d %d",&a,&b);
c=-1*(-1*a--1*b);
printf("%d\n",c);
}
return 0;
} | main.c: In function 'main':
main.c:6:24: error: expected ')' before numeric constant
6 | c=-1*(-1*a--1*b);
| ~ ^
| )
|
s502666018 | p00271 | C | #include<stdio.h>
int main(void){
int a,b,c,i=7;
while(i!=0){
scanf("%d %d",&a,&b);
c=-1*(-1*a--1*b);
printf("%d\n",c);
}
return 0;
} | main.c: In function 'main':
main.c:6:24: error: expected ')' before numeric constant
6 | c=-1*(-1*a--1*b);
| ~ ^
| )
|
s104695387 | p00271 | C | #include<stdio.h>
int main(void){
int a,b,c,i=7;
while(i!=0){
scanf("%d %d",&a,&b);
c=-1*(-1*a--1*b);
printf("%d\n",c);
}
return 0;
} | main.c: In function 'main':
main.c:6:24: error: expected ')' before numeric constant
6 | c=-1*(-1*a--1*b);
| ~ ^
| )
|
s063199278 | p00271 | C | #include<stdio.h>
int main(void){
int a,b,c,i=7;
while(i!=0){
scanf("%d %d",&a,&b);
c=-1*(-1*a--1*b);
printf("%d\n",c);
}
return 0;
} | main.c: In function 'main':
main.c:6:24: error: expected ')' before numeric constant
6 | c=-1*(-1*a--1*b);
| ~ ^
| )
|
s376690387 | p00271 | C | #include<stdio.h>
int main(void){
int a,b,c,i=7;
while(i!=0){
scanf("%d %d",&a,&b);
c=-1*(-1*a--1*b);
printf("%d\n",c);
}
return 0;
} | main.c: In function 'main':
main.c:6:24: error: expected ')' before numeric constant
6 | c=-1*(-1*a--1*b);
| ~ ^
| )
|
s320295091 | p00271 | C | #include<stdio.h>
int main(void){
int a,b,c,i=7;
while(i!=0){
scanf("%d %d",&a,&b);
c=-1*(-1*a--1*b);
printf("%d\n",c);
}
return 0;
} | main.c: In function 'main':
main.c:6:24: error: expected ')' before numeric constant
6 | c=-1*(-1*a--1*b);
| ~ ^
| )
|
s025549658 | p00271 | C | #include<stdio.h>
int main(void)
{
int a[7], b, c, i;
for (i = 0;i < 7;i++)
{
scanf_s("%d %d", &b, &c);
a[i] = b - c;
}
for (i = 0;i < 7;i++)
{
printf("%d\n", a[i]);
}
return 0;
} | main.c: In function 'main':
main.c:8:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
8 | scanf_s("%d %d", &b, &c);
| ^~~~~~~
| scanf
|
s129567165 | p00271 | C | #include<stdio.h>
int main()
{
int i,ma,mi;
for(i=0;i<7;i++)
{
scanf("%d %d",&ma,&mi);
printf("%d\n",ma-mi);
}
reutrn 0;
} | main.c: In function 'main':
main.c:10:9: error: 'reutrn' undeclared (first use in this function)
10 | reutrn 0;
| ^~~~~~
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:15: error: expected ';' before numeric constant
10 | reutrn 0;
| ^~
| ;
|
s460435098 | p00271 | C | #include <iostream>
using namespace std;
int main(){
int i = 6;
int max, min;
while(i){
i--;
cin >> max >> min;
cout << max - min << endl;
}
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s155110656 | p00271 | C | #include<stdio.h>
int main(void){
int i;
int a[7], b[7];
for (i = 0; i < 7; i++)
scanf_s("%d%d", &a[i], &b[i]);
int x = 0;
for (i = 0; i < 7; i++){
x = a[i] - b[i];
printf("%d\n", x);
}
}
| main.c: In function 'main':
main.c:7:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
7 | scanf_s("%d%d", &a[i], &b[i]);
| ^~~~~~~
| scanf
|
s405673835 | p00271 | C | #include <stdio.h>
int main(void)
}
int a = 0;
int b = 0;
for(i=0; i<7; i++)
{
scanf("%d", a);
scanf("%d", b);
if(a > b) {
printf("%d", a-b);
} else {
printf("%d", b-a);
}
}
return 0;
} | main.c: In function 'main':
main.c:4:1: error: expected declaration specifiers before '}' token
4 | }
| ^
main.c:5:9: error: parameter 'a' is initialized
5 | int a = 0;
| ^~~
main.c:6:9: error: parameter 'b' is initialized
6 | int b = 0;
| ^~~
main.c:8:9: error: expected declaration specifiers before 'for'
8 | for(i=0; i<7; i++)
| ^~~
main.c:8:18: error: expected declaration specifiers before 'i'
8 | for(i=0; i<7; i++)
| ^
main.c:8:23: error: expected declaration specifiers before 'i'
8 | for(i=0; i<7; i++)
| ^
main.c:22:9: error: expected declaration specifiers before 'return'
22 | return 0;
| ^~~~~~
main.c:23:1: error: expected declaration specifiers before '}' token
23 | }
| ^
main.c:3:5: error: old-style parameter declarations in prototyped function definition
3 | int main(void)
| ^~~~
main.c:24: error: expected '{' at end of input
|
s484793317 | p00271 | C | #include <stdio.h>
{
int a = 0;
int b = 0;
for(int i=0; i<7; i++)
{
scanf("%d", a);
scanf("%d", b);
if(a > b) {
printf("%d", a-b);
} else {
printf("%d", b-a);
}
}
return 0;
} | main.c:2:1: error: expected identifier or '(' before '{' token
2 | {
| ^
|
s752899914 | p00271 | C | #include "stdio.h"
int _tmain(int argc, _TCHAR* argv[])
{
int a = 0;
int b = 0;
for(int i=0; i<7; i++)
{
scanf("%d", &a);
scanf("%d", &b);
if(a > b) {
printf("%d", a-b);
} else {
printf("%d", b-a);
}
}
return 0;
} | main.c:3:22: error: unknown type name '_TCHAR'
3 | int _tmain(int argc, _TCHAR* argv[])
| ^~~~~~
|
s267436926 | p00271 | C++ | #include<iostream>
using namesoace std;
int main(){
int N = 7,a,b;
while(N--){
cin >>a >>b;
cout << a-b << endl;
}
} | a.cc:2:7: error: expected nested-name-specifier before 'namesoace'
2 | using namesoace std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin >>a >>b;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:7:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
7 | cout << a-b << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:7:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
7 | cout << a-b << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s437838120 | p00271 | C++ | #include<cstdio>
using namespace std;
int main(){
for(i=0;i<7;i++){
scanf("%d %d",&a,&b);
printf("%d",a-b);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:4:9: error: 'i' was not declared in this scope
4 | for(i=0;i<7;i++){
| ^
a.cc:5:24: error: 'a' was not declared in this scope
5 | scanf("%d %d",&a,&b);
| ^
a.cc:5:27: error: 'b' was not declared in this scope
5 | scanf("%d %d",&a,&b);
| ^
|
s313755906 | p00271 | C++ | public class Main {
Scanner sc = new Scanner(System.in);
int[] dai = new int[8];
int[] tei = new int[8];
int[] sa = new int[8];
int nikka ;
int ww ;
public void syukei(){
for (nikka=1;nikka <8;nikka++){
System.out.println(nikka + "日目の最大気温を入力してください。;");
dai[nikka] = sc.nextInt();
System.out.println(nikka + "日目の最低気温を入力してください。;");
tei[nikka] = sc.nextInt();
sa[nikka] = dai[nikka] - tei [nikka];
}
}
public void hyouji(){
for(ww=1;ww<8;ww++){
System.out.println(sa[ww]);
}
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Mondai20131 wao = new Mondai20131();
wao.syukei();
wao.hyouji(); | a.cc:1:1: error: expected unqualified-id before 'public'
1 | public class Main {
| ^~~~~~
|
s235036352 | p00271 | C++ | #include<cstdio>
int main(){
for(int a,b;scanf("%d%d",%a,%b);)printf("%d\n",a-b);
} | a.cc: In function 'int main()':
a.cc:3:34: error: expected primary-expression before '%' token
3 | for(int a,b;scanf("%d%d",%a,%b);)printf("%d\n",a-b);
| ^
a.cc:3:37: error: expected primary-expression before '%' token
3 | for(int a,b;scanf("%d%d",%a,%b);)printf("%d\n",a-b);
| ^
|
s370198212 | p00271 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<cstdio>
#include<algorithm
int main(){
for(int i=0;i<7;i++){
int a,b;
cin>>a>>b;
cout<<a-b<<endl;
}
return 0;
} | a.cc:5:19: error: missing terminating > character
5 | #include<algorithm
| ^
a.cc: In function 'int main()':
a.cc:9:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin>>a>>b;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:10:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
10 | cout<<a-b<<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:10:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
10 | cout<<a-b<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s955540573 | p00271 | C++ | #include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;
int main() {
REP(i, 7){
int a, b; cin >>a >>b;
cout <<a-b <<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:32:2: error: expected '}' at end of input
32 | }
| ^
a.cc:27:12: note: to match this '{'
27 | int main() {
| ^
|
s222112043 | p00271 | C++ | for i in range(7):
a, b = map(int, input().split())
print(a-b) | a.cc:1:1: error: expected unqualified-id before 'for'
1 | for i in range(7):
| ^~~
|
s953487886 | p00271 | C++ | import java.util.Scanner;
public class Main{
int a;
int b;
int sa;
public void solve(){
Scanner sc=new Scanner(System.in);
for(int i=0;i<8;i++){
a=sc.nextInt();
b=sc.nextInt();
sa=a-b;
System.out.println(sa);
}
}
public static void main(String[]args){
Main obj=new Main();
obj.solve();
}
} | 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: expected unqualified-id before 'public'
2 | public class Main{
| ^~~~~~
|
s952174399 | p00271 | C++ | //2714 加藤聖弥 問1
import java.util.Scanner;
public class Main{
int high;
int low;
int sa;
int n;
public void solve(){
Scanner sc=new Scanner(System.in);
n=0;
while(n<7){
high=sc.nextInt();
low=sc.nextInt();
sa=high-low;
System.out.println(sa);
n+=1;
}
}
public static void main(String[] args){
Main obj=new Main();
obj.solve();
} | 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-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main{
| ^~~~~~
|
s132507448 | p00271 | C++ | //2714 加藤聖弥 問1
import java.util.Scanner;
public class Main{
int high;
int low;
int sa;
int n;
public void solve(){
Scanner sc=new Scanner(System.in);
n=0;
while(n<7){
high=sc.nextInt();
low=sc.nextInt();
sa=high-low;
System.out.println(sa);
n+=1;
}
}
public static void main(String[] args){
Main obj=new Main();
obj.solve();
}
} | 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-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main{
| ^~~~~~
|
s481918696 | p00271 | C++ | import java.util.Scanner;
public class Main{
int high;
int low;
int sa;
int n;
public void solve(){
Scanner sc=new Scanner(System.in);
n=0;
while(n<7){
high=sc.nextInt();
low=sc.nextInt();
sa=high-low;
System.out.println(sa);
n+=1;
}
}
public static void main(String[] args){
Main obj=new Main();
obj.solve();
}
} | 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: expected unqualified-id before 'public'
2 | public class Main{
| ^~~~~~
|
s245799857 | p00271 | C++ | #include<stdio.h>
int main(void)
{
int a,b,s;
int x[7]
for(i=0;i<=7,i++){
scanf("%d %d",&a,&b);
}
s=a-b;
printf("%d\n",s);
return 0
} | a.cc: In function 'int main()':
a.cc:6:9: error: expected initializer before 'for'
6 | for(i=0;i<=7,i++){
| ^~~
a.cc:6:17: error: 'i' was not declared in this scope
6 | for(i=0;i<=7,i++){
| ^
a.cc:11:17: error: expected ';' before '}' token
11 | return 0
| ^
| ;
12 | }
| ~
|
s049113821 | p00271 | C++ | #include<stdio.h>
int main(void)
{
int a,b,s,i;
int x[7];
for(i=0;i<=7;i++){
scanf("%d %d",&a,&b);
}
s=a-b;
printf("%d\n",s);
return 0
} | a.cc: In function 'int main()':
a.cc:11:17: error: expected ';' before '}' token
11 | return 0
| ^
| ;
12 | }
| ~
|
s585085188 | p00271 | C++ | #include<stdio.h>
#include<windows.h>
#include<iostream>
#include <string>
#define loop(i,x) for(int i=0;i<x;i++)
using namespace std;
int main(){
int a[7];
int b[7];
int x = 7;
loop(i,x){
cin >> a[i]>>b[i];
}
loop(i, x){
cout << a[i] - b[i] << endl;
}
cout << endl;
return 0;
} | a.cc:2:9: fatal error: windows.h: No such file or directory
2 | #include<windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s472520756 | p00271 | C++ | #include<stdio.h>
#include<windows.h>
#include<iostream>
#include <string>
#define loop(i,x) for(int i=0;i<x;i++)
using namespace std;
int main(){
int a[7];
int b[7];
int x = 7;
for (int i = 0; i < x;i++){
cin >> a[i]>>b[i];
}
for (int i = 0; i<x; i++){
cout << a[i] - b[i] << endl;
}
cout << endl;
return 0;
} | a.cc:2:9: fatal error: windows.h: No such file or directory
2 | #include<windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s847824061 | p00271 | C++ | #include<stdio.h>
#include<windows.h>
#include<iostream>
#include <string>
#define loop(i,x) for(int i=0;i<x;i++)
using namespace std;
int main(){
int a[7];
int b[7];
int x = 7;
for (int i = 0; i < x;i++){
cin >> a[i]>>b[i];
}
for (int n = 0; n<x; n++){
cout << a[n] - b[n] << endl;
}
cout << endl;
return 0;
} | a.cc:2:9: fatal error: windows.h: No such file or directory
2 | #include<windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s907692196 | p00271 | C++ | #include<stdio.h>
#include<windows.h>
#include<iostream>
#include <string>
using namespace std;
int main(){
int a[7];
int b[7];
int x = 7;
for (int i = 0; i < x;i++){
cin >> a[i]>>b[i];
}
for (int n = 0; n<x; n++){
cout << a[n] - b[n] << endl;
}
cout << endl;
return 0;
} | a.cc:2:9: fatal error: windows.h: No such file or directory
2 | #include<windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s907866849 | p00271 | C++ | #include <stdio.h>
int main()
{
int a,b,cou;
for(cou=0;cou<7;cou++){
scanf("%d %d",&a,&b);
printf("%d\n"a-b);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:12: error: unable to find string literal operator 'operator""a' with 'const char [4]', 'long unsigned int' arguments
7 | printf("%d\n"a-b);
| ^~~~~~~
|
s849364415 | p00271 | C++ | #include<iostream>
using namespace std;
int main() {
int a, b, i;
for (; i = 0, i < 7, i++;) {
cin >> a >> b;
cout << a[i] - b[i] << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:26: error: invalid types 'int[int]' for array subscript
7 | cout << a[i] - b[i] << endl;
| ^
a.cc:7:33: error: invalid types 'int[int]' for array subscript
7 | cout << a[i] - b[i] << endl;
| ^
|
s405913984 | p00271 | C++ | #include<iostream>
using namespace std;
int main() {
int a, b, n;
for (;n = 0, n < 7, n++;) {
cin >> a >> b;
cout << a[i] - b[i]<< endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:27: error: 'i' was not declared in this scope
7 | cout << a[i] - b[i]<< endl;
| ^
|
s674484939 | p00271 | C++ | #include<iostream>
using namespace std;
int main() {
int a[7], b[7], i;
for (i = 0; i < 7; i++) {
cin >> a >> b;
cout << a[i] - b[i]<< endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:21: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [7]')
6 | cin >> a >> b;
| ~~~ ^~ ~
| | |
| | int [7]
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:24: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*'
6 | cin >> a >> b;
| ^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:24: error: invalid conversion from 'int*' to 'short int' [-fpermissive]
6 | cin >> a >> b;
| ^
| |
| int*
a.cc:6:24: error: cannot bind rvalue '(short int)((int*)(& a))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:24: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive]
6 | cin >> a >> b;
| ^
| |
| int*
a.cc:6:24: error: cannot bind rvalue '(short unsigned int)((int*)(& a))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:24: error: invalid conversion from 'int*' to 'int' [-fpermissive]
6 | cin >> a >> b;
| ^
| |
| int*
a.cc:6:24: error: cannot bind rvalue '(int)((int*)(& a))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:24: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive]
6 | cin >> a >> b;
| ^
| |
| int*
a.cc:6:24: error: cannot bind rvalue '(unsigned int)((int*)(& a))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:24: error: invalid conversion from 'int*' to 'long int' [-fpermissive]
6 | cin >> a >> b;
| ^
| |
| int*
a.cc:6:24: error: cannot bind rvalue '(long int)((int*)(& a))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:24: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive]
6 | cin >> a >> b;
| ^
| |
| int*
a.cc:6:24: error: cannot bind rvalue '(long unsigned int)((int*)(& a))' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:24: error: invalid conversion from 'int*' to 'long long int' [-fpermissive]
6 | cin >> a >> b;
| ^
| |
| int*
a.cc:6:24: error: cannot bind rvalue '(long long int)((int*)(& a))' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:24: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive]
6 | cin >> a >> b;
| ^
| |
| int*
a.cc:6:24: error: cannot bind rvalue '(long long unsigned int)((int*)(& a))' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:24: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
6 | cin >> a >> b;
| ^
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'int [7]' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'int [7]' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'int [7]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'int [7]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: |
s291741448 | p00271 | C++ | #include <iostream>
#include <algorithm>
#define INF 1000000
using namespace std;
int cost[100][100];
int time[100][100];
int d[100];
int m;
void dcost(int s) {
bool used[100];
fill(used, used + 100, false);
fill(d, d + 100, INF);
d[s] = 0;
while (1) {
int v = -1;
for (int u = 0; u < m; ++u) {
if (!used[u] && (v == -1 || d[u] < d[v])) v = u;
}
if (v == -1) break;
used[v] = true;
for (int u = 0; u < m; ++u) {
d[u] = d[u] < d[v] + cost[v][u] ? d[u] : d[v] + cost[v][u];
}
}
}
void dtime(int s) {
bool used[100];
fill(used, used + 100, false);
fill(d, d + 100, INF);
d[s] = 0;
while (1) {
int v = -1;
for (int u = 0; u < m; ++u) {
if (!used[u] && (v == -1 || d[u] < d[v])) v = u;
}
if (v == -1) break;
used[v] = true;
for (int u = 0; u < m; ++u) {
d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
}
}
}
int main() {
int n, k, a, b, p, q, r;
while (cin >> n >> m, !(n == 0 && m == 0)) {
fill(cost[0], cost[100], INF);
fill(time[0], time[100], INF);
while (n--) {
cin >> a >> b;
a--; b--;
cin >> cost[a][b] >> time[a][b];
cost[b][a] = cost[a][b];
time[b][a] = time[a][b];
}
cin >> k;
while (k--) {
cin >> p >> q >> r;
p--; q--;
if (r == 1) dtime(p);
else dcost(p);
cout << d[q] << endl;
}
}
return 0;
} | a.cc:6:18: error: 'int time [100][100]' redeclared as different kind of entity
6 | int time[100][100];
| ^
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
from /usr/include/c++/14/ext/atomicity.h:35,
from /usr/include/c++/14/bits/ios_base.h:39,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
76 | extern time_t time (time_t *__timer) __THROW;
| ^~~~
a.cc: In function 'void dtime(int)':
a.cc:43:52: warning: pointer to a function used in arithmetic [-Wpointer-arith]
43 | d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
| ^
a.cc:43:55: warning: pointer to a function used in arithmetic [-Wpointer-arith]
43 | d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
| ^
a.cc:43:44: warning: pointer to a function used in arithmetic [-Wpointer-arith]
43 | d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
| ~~~~~^~~~~~~~~~~~
a.cc:43:37: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
43 | d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
| ~~~~~^~~~~~~~~~~~~~~~~~~
a.cc:43:79: warning: pointer to a function used in arithmetic [-Wpointer-arith]
43 | d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
| ^
a.cc:43:82: warning: pointer to a function used in arithmetic [-Wpointer-arith]
43 | d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
| ^
a.cc:43:71: warning: pointer to a function used in arithmetic [-Wpointer-arith]
43 | d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
| ~~~~~^~~~~~~~~~~~
a.cc:43:57: error: operands to '?:' have different types 'int' and 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'}
43 | d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:53:28: warning: pointer to a function used in arithmetic [-Wpointer-arith]
53 | fill(time[0], time[100], INF);
| ^
a.cc:53:39: warning: pointer to a function used in arithmetic [-Wpointer-arith]
53 | fill(time[0], time[100], INF);
| ^
a.cc:57:52: warning: pointer to a function used in arithmetic [-Wpointer-arith]
57 | cin >> cost[a][b] >> time[a][b];
| ^
a.cc:57:55: warning: pointer to a function used in arithmetic [-Wpointer-arith]
57 | cin >> cost[a][b] >> time[a][b];
| ^
a.cc:57:43: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'})
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~~~~~~~~~ ^~ ~~~~~~~~~~
| | |
| | time_t(time_t*) noexcept {aka long int(long int*) noexcept}
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'}
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'short int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(short int)(time + (((sizetype)a) + ((sizetype)b)))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'short unsigned int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(short unsigned int)(time + (((sizetype)a) + ((sizetype)b)))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(int)(time + (((sizetype)a) + ((sizetype)b)))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'unsigned int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(unsigned int)(time + (((sizetype)a) + ((sizetype)b)))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'long int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(long int)(time + (((sizetype)a) + ((sizetype)b)))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _T |
s694874340 | p00271 | C++ | #include <iostream>
#include <algorithm>
#define INF 1000000
using namespace std;
int cost[100][100];
int time[100][100];
int d[100];
int m;
void dcost(int s) {
bool used[100];
fill(used, used + 100, false);
fill(d, d + 100, INF);
d[s] = 0;
while (1) {
int v = -1;
for (int u = 0; u < m; ++u) {
if (!used[u] && (v == -1 || d[u] < d[v])) v = u;
}
if (v == -1) break;
used[v] = true;
for (int u = 0; u < m; ++u) {
d[u] = d[u] < d[v] + cost[v][u] ? d[u] : d[v] + cost[v][u];
}
}
}
void dtime(int s) {
bool used[100];
fill(used, used + 100, false);
fill(d, d + 100, INF);
d[s] = 0;
while (1) {
int v = -1;
for (int u = 0; u < m; ++u) {
if (!used[u] && (v == -1 || d[u] < d[v])) v = u;
}
if (v == -1) break;
used[v] = true;
for (int u = 0; u < m; ++u) {
d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
}
}
}
int main() {
int n, k, a, b, p, q, r;
while (cin >> n >> m, !(n == 0 && m == 0)) {
fill(cost[0], cost[100], INF);
fill(time[0], time[100], INF);
while (n--) {
cin >> a >> b;
a--; b--;
cin >> cost[a][b] >> time[a][b];
cost[b][a] = cost[a][b];
time[b][a] = time[a][b];
}
cin >> k;
while (k--) {
cin >> p >> q >> r;
p--; q--;
if (r == 1) dtime(p);
else dcost(p);
cout << d[q] << endl;
}
}
return 0;
} | a.cc:6:18: error: 'int time [100][100]' redeclared as different kind of entity
6 | int time[100][100];
| ^
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
from /usr/include/c++/14/ext/atomicity.h:35,
from /usr/include/c++/14/bits/ios_base.h:39,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
76 | extern time_t time (time_t *__timer) __THROW;
| ^~~~
a.cc: In function 'void dtime(int)':
a.cc:43:52: warning: pointer to a function used in arithmetic [-Wpointer-arith]
43 | d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
| ^
a.cc:43:55: warning: pointer to a function used in arithmetic [-Wpointer-arith]
43 | d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
| ^
a.cc:43:44: warning: pointer to a function used in arithmetic [-Wpointer-arith]
43 | d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
| ~~~~~^~~~~~~~~~~~
a.cc:43:37: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
43 | d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
| ~~~~~^~~~~~~~~~~~~~~~~~~
a.cc:43:79: warning: pointer to a function used in arithmetic [-Wpointer-arith]
43 | d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
| ^
a.cc:43:82: warning: pointer to a function used in arithmetic [-Wpointer-arith]
43 | d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
| ^
a.cc:43:71: warning: pointer to a function used in arithmetic [-Wpointer-arith]
43 | d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
| ~~~~~^~~~~~~~~~~~
a.cc:43:57: error: operands to '?:' have different types 'int' and 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'}
43 | d[u] = d[u] < d[v] + time[v][u] ? d[u] : d[v] + time[v][u];
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:53:28: warning: pointer to a function used in arithmetic [-Wpointer-arith]
53 | fill(time[0], time[100], INF);
| ^
a.cc:53:39: warning: pointer to a function used in arithmetic [-Wpointer-arith]
53 | fill(time[0], time[100], INF);
| ^
a.cc:57:52: warning: pointer to a function used in arithmetic [-Wpointer-arith]
57 | cin >> cost[a][b] >> time[a][b];
| ^
a.cc:57:55: warning: pointer to a function used in arithmetic [-Wpointer-arith]
57 | cin >> cost[a][b] >> time[a][b];
| ^
a.cc:57:43: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'})
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~~~~~~~~~ ^~ ~~~~~~~~~~
| | |
| | time_t(time_t*) noexcept {aka long int(long int*) noexcept}
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'}
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'short int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(short int)(time + (((sizetype)a) + ((sizetype)b)))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'short unsigned int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(short unsigned int)(time + (((sizetype)a) + ((sizetype)b)))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(int)(time + (((sizetype)a) + ((sizetype)b)))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'unsigned int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(unsigned int)(time + (((sizetype)a) + ((sizetype)b)))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'long int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(long int)(time + (((sizetype)a) + ((sizetype)b)))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _T |
s727519795 | p00271 | C++ | #include <iostream>
#include <algorithm>
#define INF 1000000
using namespace std;
int cost[100][100];
int t[100][100];
int d[100];
int m;
void dcost(int s) {
bool used[100];
fill(used, used + 100, false);
fill(d, d + 100, INF);
d[s] = 0;
while (1) {
int v = -1;
for (int u = 0; u < m; ++u) {
if (!used[u] && (v == -1 || d[u] < d[v])) v = u;
}
if (v == -1) break;
used[v] = true;
for (int u = 0; u < m; ++u) {
d[u] = d[u] < d[v] + cost[v][u] ? d[u] : d[v] + cost[v][u];
}
}
}
void dtime(int s) {
bool used[100];
fill(used, used + 100, false);
fill(d, d + 100, INF);
d[s] = 0;
while (1) {
int v = -1;
for (int u = 0; u < m; ++u) {
if (!used[u] && (v == -1 || d[u] < d[v])) v = u;
}
if (v == -1) break;
used[v] = true;
for (int u = 0; u < m; ++u) {
d[u] = d[u] < d[v] + t[v][u] ? d[u] : d[v] + t[v][u];
}
}
}
int main() {
int n, k, a, b, p, q, r;
while (cin >> n >> m, !(n == 0 && m == 0)) {
fill(cost[0], cost[100], INF);
fill(time[0], time[100], INF);
while (n--) {
cin >> a >> b;
a--; b--;
cin >> cost[a][b] >> time[a][b];
cost[b][a] = cost[a][b];
time[b][a] = time[a][b];
}
cin >> k;
while (k--) {
cin >> p >> q >> r;
p--; q--;
if (r == 1) dtime(p);
else dcost(p);
cout << d[q] << endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:53:28: warning: pointer to a function used in arithmetic [-Wpointer-arith]
53 | fill(time[0], time[100], INF);
| ^
a.cc:53:39: warning: pointer to a function used in arithmetic [-Wpointer-arith]
53 | fill(time[0], time[100], INF);
| ^
a.cc:57:52: warning: pointer to a function used in arithmetic [-Wpointer-arith]
57 | cin >> cost[a][b] >> time[a][b];
| ^
a.cc:57:55: warning: pointer to a function used in arithmetic [-Wpointer-arith]
57 | cin >> cost[a][b] >> time[a][b];
| ^
a.cc:57:43: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'})
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~~~~~~~~~ ^~ ~~~~~~~~~~
| | |
| | time_t(time_t*) noexcept {aka long int(long int*) noexcept}
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'}
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'short int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(short int)(time + (((sizetype)a) + ((sizetype)b)))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'short unsigned int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(short unsigned int)(time + (((sizetype)a) + ((sizetype)b)))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(int)(time + (((sizetype)a) + ((sizetype)b)))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'unsigned int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(unsigned int)(time + (((sizetype)a) + ((sizetype)b)))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'long int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(long int)(time + (((sizetype)a) + ((sizetype)b)))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'long unsigned int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(long unsigned int)(time + (((sizetype)a) + ((sizetype)b)))' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'long long int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(long long int)(time + (((sizetype)a) + ((sizetype)b)))' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:57:55: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'long long unsigned int' [-fpermissive]
57 | cin >> cost[a][b] >> time[a][b];
| ~~~~~~~~~^
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:57:55: error: cannot bind rvalue '(long long unsigned int)(time + (((s |
s438997208 | p00271 | C++ | #include<stdio.h>
int main(){
int i,a,b;
for(i=0;i<7;i++){
scanf("%d %d",&a,&b);
printf("%d\n",|b-a|);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:23: error: expected primary-expression before '|' token
6 | printf("%d\n",|b-a|);
| ^
a.cc:6:28: error: expected primary-expression before ')' token
6 | printf("%d\n",|b-a|);
| ^
|
s766783659 | p00271 | C++ | #include<stdio.h>
int main(){
int i,a,b;
for(i=0;i<7;i++){
scanf("%d %d",&a,&b);
if(b>a){
b=b-a;
else{
b=a-b;
}
printf("%d\n",b);
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:9: error: expected '}' before 'else'
8 | else{
| ^~~~
a.cc:6:16: note: to match this '{'
6 | if(b>a){
| ^
a.cc: At global scope:
a.cc:14:9: error: expected unqualified-id before 'return'
14 | return 0;
| ^~~~~~
a.cc:15:1: error: expected declaration before '}' token
15 | }
| ^
|
s266589268 | p00271 | C++ | #include<stdio.h>
int main(void){
int a,b,c,i=7;
while(i!=0){
scanf("%d %d",&a,&b);
c=-1*(-1*a--1*b);
printf("%d\n",c);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:24: error: expected ')' before numeric constant
6 | c=-1*(-1*a--1*b);
| ~ ^
| )
|
s582247837 | p00271 | C++ | #include<stdio.h>
int main(){
int i,a,b;
for(i=0;i<7;i++){
scanf("%d %d",&a,&b);
if(b>a){
b=b-a;
}
else{
b=a-b;
}
printf("%d\n",b);
}
}
return 0;
} | a.cc:15:9: error: expected unqualified-id before 'return'
15 | return 0;
| ^~~~~~
a.cc:16:1: error: expected declaration before '}' token
16 | }
| ^
|
s010068312 | p00271 | C++ | #include<stdio.h>
int main(void)
{
int a[7],k[7];
for(i=0;i!=10;i++){
scanf("%d %d",&a[i],&k[i]);
goukei[i]=a[i]-k[i];
printf("%d",goukei[i]);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:13: error: 'i' was not declared in this scope
5 | for(i=0;i!=10;i++){
| ^
a.cc:7:9: error: 'goukei' was not declared in this scope
7 | goukei[i]=a[i]-k[i];
| ^~~~~~
|
s299914020 | p00271 | C++ | #include<stdio.h>
int main(void)
{
int a[7],k[7];
for(i=0;i!=10;i++){
scanf("%d %d",&a[i],&k[i]);
goukei[i]=a[i]-k[i];
printf("%d",goukei[i]);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:13: error: 'i' was not declared in this scope
5 | for(i=0;i!=10;i++){
| ^
a.cc:7:9: error: 'goukei' was not declared in this scope
7 | goukei[i]=a[i]-k[i];
| ^~~~~~
|
s006775505 | p00271 | C++ | #include <iostream>
#include <stdio.h>
using namespace std
int t[7][7];
int main(){
for(int i = 0; i < 7; i++){
scanf("%d %d", &t[i][0], &t[i][1]);
}
for(int i = 0; i < 7; i++){
printf("%d\n", t[i][0] - t[i][1]);
}
return 0;
} | a.cc:3:20: error: expected ';' before 'int'
3 | using namespace std
| ^
| ;
4 |
5 | int t[7][7];
| ~~~
|
s796430268 | p00271 | C++ | #include <bits/stdc++.h>
using namesapce std;
int main(){
int a,b,c,d,e,f,g,h,i,j,k,l,m,n;
cin >> a>>b>>c>>d>>e>>f>>g>>h>>i>>j>>k>>l>>m>>n;
a =a-b;
c=c-d;
e=e-f;
g=g-h;
i=i-j;
k=k-l;
m =m-n;
cout <<a<<endl;
cout <<c<<endl;
cout <<e<<endl;
cout <<g<<endl;
cout <<i<<endl;
cout <<k<<endl;
cout <<m<<endl;
}
}
| a.cc:2:7: error: expected nested-name-specifier before 'namesapce'
2 | using namesapce std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin >> a>>b>>c>>d>>e>>f>>g>>h>>i>>j>>k>>l>>m>>n;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
16 | cout <<a<<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:16:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
16 | cout <<a<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc: At global scope:
a.cc:29:1: error: expected declaration before '}' token
29 | }
| ^
|
s590810717 | p00271 | C++ | #include <bits/stdc++.h>
using namesapce std;
int main(){
int a[14];
int o,p,q,r,s,t,u;
for(int i=0;i<14;i++){
cin >>a[i];
}
o=a[0]-a[1];
p=a[2]-a[3];
q=a[4]-a[5];
r=a[6]-a[7];
s=a[8]-a[9];
t=a[10]-a[11];
u=a[12]-a[13];
cout <<o<endl;
cout <<p<endl;
cout <<q<endl;
cout <<r<endl;
cout <<s<endl;
cout <<t<endl;
cout <<u<<endl;
}
}
| a.cc:2:7: error: expected nested-name-specifier before 'namesapce'
2 | using namesapce std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin >>a[i];
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:18:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
18 | cout <<o<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:18:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
18 | cout <<o<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc: At global scope:
a.cc:31:1: error: expected declaration before '}' token
31 | }
| ^
|
s272880449 | p00271 | C++ | #include <bits/stdc++.h>
using namesapce std;
int main(){
int a[14];
int o,p,q,r,s,t,u;
for(int i=0;i<14;i++){
cin >>a[i];
}
o=a[0]-a[1];
p=a[2]-a[3];
q=a[4]-a[5];
r=a[6]-a[7];
s=a[8]-a[9];
t=a[10]-a[11];
u=a[12]-a[13];
cout <<o<endl;
cout <<p<endl;
cout <<q<endl;
cout <<r<endl;
cout <<s<endl;
cout <<t<endl;
cout <<u<<endl;
}
| a.cc:2:7: error: expected nested-name-specifier before 'namesapce'
2 | using namesapce std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin >>a[i];
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:18:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
18 | cout <<o<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:18:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
18 | cout <<o<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s859530292 | p00271 | C++ | #include <bits/stdc++.h>
using namesapce std;
int main(){
int a[14];
int o,p,q,r,s,t,u;
for(int i=0;i<14;i++){
cin >>a[i];
}
o=a[0]-a[1];
p=a[2]-a[3];
q=a[4]-a[5];
r=a[6]-a[7];
s=a[8]-a[9];
t=a[10]-a[11];
u=a[12]-a[13];
cout <<o<endl;
cout <<p<endl;
cout <<q<endl;
cout <<r<endl;
cout <<s<endl;
cout <<t<endl;
cout <<u<<endl;
}
| a.cc:2:7: error: expected nested-name-specifier before 'namesapce'
2 | using namesapce std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin >>a[i];
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:18:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
18 | cout <<o<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:18:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
18 | cout <<o<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s049154259 | p00271 | C++ | #include<bits/stdc++.h>
using namesapce std;
int main(){
int a[14];
int o,p,q,r,s,t,u;
for(int i=0;i<14;i++){
cin >>a[i];
}
o=a[0]-a[1];
p=a[2]-a[3];
q=a[4]-a[5];
r=a[6]-a[7];
s=a[8]-a[9];
t=a[10]-a[11];
u=a[12]-a[13];
cout <<o<endl;
cout <<p<endl;
cout <<q<endl;
cout <<r<endl;
cout <<s<endl;
cout <<t<endl;
cout <<u<<endl;
}
| a.cc:2:7: error: expected nested-name-specifier before 'namesapce'
2 | using namesapce std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin >>a[i];
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:18:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
18 | cout <<o<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:18:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
18 | cout <<o<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s872455114 | p00271 | C++ | #include<bits.stdc++.h>
using namespace std;
int main(){
int a,b;
for(int i=0;i<7;i++){
cin >> a >> b;
cout << a-b << endl;
}
}
| a.cc:1:9: fatal error: bits.stdc++.h: No such file or directory
1 | #include<bits.stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s183732876 | p00271 | C++ | #include<bits/stdc++.h>
using namesapce std;
int main(){
int a[14];
int o,p,q,r,s,t,u;
for(int i=0;i<14;i++){
cin >>a[i];
}
o=a[0]-a[1];
p=a[2]-a[3];
q=a[4]-a[5];
r=a[6]-a[7];
s=a[8]-a[9];
t=a[10]-a[11];
u=a[12]-a[13];
cout <<o<endl;
cout <<p<endl;
cout <<q<endl;
cout <<r<endl;
cout <<s<endl;
cout <<t<endl;
cout <<u<<endl;
}
| a.cc:2:7: error: expected nested-name-specifier before 'namesapce'
2 | using namesapce std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin >>a[i];
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:18:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
18 | cout <<o<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:18:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
18 | cout <<o<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s604683759 | p00271 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a[14];
int o,p,q,r,s,t,u;
for(int i=0;i<14;i++){
cin >>a[i];
}
o=a[0]-a[1];
p=a[2]-a[3];
q=a[4]-a[5];
r=a[6]-a[7];
s=a[8]-a[9];
t=a[10]-a[11];
u=a[12]-a[13];
cout <<o<endl;
cout <<p<endl;
cout <<q<endl;
cout <<r<endl;
cout <<s<endl;
cout <<t<endl;
cout <<u<<endl;
}
| a.cc: In function 'int main()':
a.cc:18:13: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
18 | cout <<o<endl;
| ~~~~~~~~^~~~~
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:18:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
18 | cout <<o<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:18:14: note: 'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
18 | cout <<o<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:18:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
18 | cout <<o<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:18:14: note: couldn't deduce template parameter '_Bi_iter'
18 | cout <<o<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:18:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
18 | cout <<o<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:18:14: note: couldn't deduce template parameter '_Bi_iter'
18 | cout <<o<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:18:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
18 | cout <<o<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:18:14: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
18 | cout <<o<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:18:14: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
18 | cout <<o<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:18:14: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
18 | cout <<o<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:18:14: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
18 | cout <<o<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:18:14: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
18 | cout <<o<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:18:14: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
18 | cout <<o<endl;
| ^~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:18:14: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
18 | cout <<o<endl;
| ^~~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:18:14: note: couldn't deduce template parameter '_CharT'
18 | cout <<o<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:18:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
18 | cout <<o<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed:
a.cc:18:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits |
s488904038 | p00271 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a[14];
int b[7];
for(int i=0;i<14;i++){
cin >>a[i];
}
b[0]=a[0]-a[1];
b[1]=a[2]-a[3];
b[2]=a[4]-a[5];
b[3]=a[6]-a[7];
b[4]=a[8]-a[9];
b[5]=a[10]-a[11];
b[6]=a[12]-a[13];
for(i=0;i<7;i++){
cout <<b[i]<endl;
}
}
| a.cc: In function 'int main()':
a.cc:18:5: error: 'i' was not declared in this scope
18 | for(i=0;i<7;i++){
| ^
|
s188045955 | p00271 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c
for(int i =0;i<4;i++){
cin >> a>>b;
if (a == 1) {
c = 6000*b;
cout << c<<endl;
} else if (a == 2) {
c = 4000*b;
cout <<c<<endl;
} else if (a ==3) {
c = 3000*b;
cout <<c<<endl;
} else if (a ==4) {
c = 2000*b;
cout <<c<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:6:4: error: expected initializer before 'for'
6 | for(int i =0;i<4;i++){
| ^~~
a.cc:6:17: error: 'i' was not declared in this scope
6 | for(int i =0;i<4;i++){
| ^
a.cc:21:2: error: expected '}' at end of input
21 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s464588008 | p00271 | C++ | #include<stdio.h>
int main(void){
int i;
int a[7], b[7];
for (i = 0; i < 7; i++)
scanf_s("%d%d", &a[i], &b[i]);
int x = 0;
for (i = 0; i < 7; i++){
x = a[i] - b[i];
printf("%d\n", x);
}
}
| a.cc: In function 'int main()':
a.cc:7:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
7 | scanf_s("%d%d", &a[i], &b[i]);
| ^~~~~~~
| scanf
|
s866531304 | p00271 | C++ | #include<stdio.h>
int main(void){
int i;
int a[7], b[7];
for (i = 0; i < 7; i++)
scanf_s("%d%d", &a[i], &b[i]);
int x = 0;
for (i = 0; i < 7; i++){
x = a[i] - b[i];
printf("%d\n", x);
}
}
| a.cc: In function 'int main()':
a.cc:7:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
7 | scanf_s("%d%d", &a[i], &b[i]);
| ^~~~~~~
| scanf
|
s371982065 | p00271 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(void){
int a,b'
while(cin >> a >> b){
cout << b-a << endl;
}
return 0;
} | a.cc:8:8: warning: missing terminating ' character
8 | int a,b'
| ^
a.cc:8:8: error: missing terminating ' character
a.cc: In function 'int main()':
a.cc:9:1: error: expected initializer before 'while'
9 | while(cin >> a >> b){
| ^~~~~
|
s928459491 | p00271 | C++ | // Enjoy your stay.
#include <bits/stdc++.h>
#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(auto it=(X).begin();it!=(X).end();it++)
#define ite iterator
#define mp make_pair
#define mt make_tuple
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define pb push_back
#define sec second
#define sz(x) ((int)(x).size())
using namespace std;
typedef istringstream iss;
typedef long long ll;
typedef pair<ll,ll> pi;
typedef stringstream sst;
typedef vector<ll> vi;
int main(){
cin.tie(0);
ios_base::sync_with_stdio(0);
rep(i,7){
int a,b;
cin>>a>>b;
cout<<a-b<<endl;
}
}
} | a.cc:39:1: error: expected declaration before '}' token
39 | }
| ^
|
s342680403 | p00271 | C++ | // Enjoy your stay.
#include <bits/stdc++.h>
#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
//#define foreach(it,X) for(auto it=(X).begin();it!=(X).end();it++)
#define ite iterator
#define mp make_pair
#define mt make_tuple
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define pb push_back
#define sec second
#define sz(x) ((int)(x).size())
using namespace std;
typedef istringstream iss;
typedef long long ll;
typedef pair<ll,ll> pi;
typedef stringstream sst;
typedef vector<ll> vi;
int main(){
cin.tie(0);
ios_base::sync_with_stdio(0);
rep(i,7){
int a,b;
cin>>a>>b;
cout<<a-b<<endl;
}
}
} | a.cc:39:1: error: expected declaration before '}' token
39 | }
| ^
|
s487103677 | p00271 | C++ | #include <iostream>
2:
3:using namespace std;
4:
5:int main()
6:{
7: int a, b;
8:
9: while (cin >> a >> b) {
10: cout << a - b << endl;
11: }
12:
13: return 0;
14:} | a.cc:2:4: error: expected unqualified-id before numeric constant
2 | 2:
| ^
a.cc:4:4: error: expected unqualified-id before numeric constant
4 | 4:
| ^
|
s492551126 | p00271 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b;
for(int i=0;i<7;i++){
cin>>a>>b;
cout<<a-b<<edndl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:28: error: 'edndl' was not declared in this scope
7 | cout<<a-b<<edndl;
| ^~~~~
|
s321965760 | p00272 | Java | public class Main {
Scanner sc =new Scanner(System.in);
int kingaku;
int[] goukei = new int[4];
int x;
public void syurui(){
for(x=0;x<=3;x++){
int syurui = sc.nextInt();
int maisuu = sc.nextInt();
switch(syurui){
case 1: kingaku = 6000; break;
case 2: kingaku = 4000; break;
case 3: kingaku = 3000; break;
case 4: kingaku = 2000; break;
}
goukei[x] = kingaku * maisuu;
}
}
public void hyouji(){
for(x=0;x<=3;x++){
System.out.println(goukei[x]);
}
}
public static void main(String[] args) {
Main hai = new Main();
hai.syurui();
hai.hyouji();
}
} | Main.java:2: error: cannot find symbol
Scanner sc =new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:2: error: cannot find symbol
Scanner sc =new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.